Some fixes.

This commit is contained in:
momo5502 2016-02-05 13:10:22 +01:00
parent 70d49efac5
commit 497a4ecefb
3 changed files with 27 additions and 15 deletions

View File

@ -353,17 +353,19 @@ namespace Components
wattron(Console::OutputWindow, COLOR_PAIR(9)); wattron(Console::OutputWindow, COLOR_PAIR(9));
int currentTime = static_cast<int>(GetTickCount64()); // Make our compiler happy // int currentTime = static_cast<int>(GetTickCount64()); // Make our compiler happy
//
// if (!Console::HasConsole)
// {
// Console::RefreshOutput();
// }
// else if ((currentTime - Console::LastRefresh) > 100)
// {
// Console::RefreshOutput();
// Console::LastRefresh = currentTime;
// }
if (!Console::HasConsole) Console::RefreshOutput();
{
Console::RefreshOutput();
}
else if ((currentTime - Console::LastRefresh) > 100)
{
Console::RefreshOutput();
Console::LastRefresh = currentTime;
}
} }
Console::Console() Console::Console()

View File

@ -231,6 +231,8 @@ namespace Components
// Post initialization point // Post initialization point
Utils::Hook(0x60BFBF, Dedicated::PostInitializationStub, HOOK_JUMP).Install()->Quick(); Utils::Hook(0x60BFBF, Dedicated::PostInitializationStub, HOOK_JUMP).Install()->Quick();
#ifdef USE_LEGACY_SERVER_LIST
// Heartbeats // Heartbeats
Dedicated::OnFrame([] () Dedicated::OnFrame([] ()
{ {
@ -242,6 +244,7 @@ namespace Components
Dedicated::Heartbeat(); Dedicated::Heartbeat();
} }
}); });
#endif
} }
} }
} }

View File

@ -202,12 +202,15 @@ namespace Components
{ {
if (dedi.address == address) if (dedi.address == address)
{ {
dedi.state = (info.Get("challenge") == dedi.challenge ? Node::STATE_VALID : Node::STATE_INVALID); if (dedi.state == Node::STATE_QUERYING)
dedi.lastTime = Game::Com_Milliseconds();
if (dedi.state == Node::STATE_VALID)
{ {
Logger::Print("Validated dedi %s\n", address.GetString()); dedi.state = (info.Get("challenge") == dedi.challenge ? Node::STATE_VALID : Node::STATE_INVALID);
dedi.lastTime = Game::Com_Milliseconds();
if (dedi.state == Node::STATE_VALID)
{
Logger::Print("Validated dedi %s\n", address.GetString());
}
} }
break; break;
} }
@ -415,6 +418,10 @@ namespace Components
Node::SendNodeList(address); Node::SendNodeList(address);
Node::SendDediList(address); Node::SendDediList(address);
// Send our heartbeat as well :P
// Otherwise, if there's only 1 node in the network (us), we might not get listed as dedi
Network::Send(address, "heartbeat\n");
}); });
} }