More bugfixes

This commit is contained in:
momo5502 2016-02-13 14:03:23 +01:00
parent caec3f954f
commit 8f91c7dc6a
4 changed files with 21 additions and 4 deletions

View File

@ -1,2 +1,2 @@
@echo off @echo off
premake5 %* vs2015 tools\premake5 %* vs2015

View File

@ -155,7 +155,7 @@ workspace "iw4x"
-- Pre-build -- Pre-build
prebuildcommands { prebuildcommands {
"cd %{_MAIN_SCRIPT_DIR}", "cd %{_MAIN_SCRIPT_DIR}",
"premake5 generate-buildinfo" "tools\\premake5 generate-buildinfo"
} }
-- Post-build -- Post-build

View File

@ -153,6 +153,9 @@ namespace Components
ServerList::RefreshContainer.Mutex.lock(); ServerList::RefreshContainer.Mutex.lock();
ServerList::RefreshContainer.SendCount = 0;
ServerList::RefreshContainer.SentCount = 0;
for (auto server : tempList) for (auto server : tempList)
{ {
ServerList::InsertRequest(server.Addr, false); ServerList::InsertRequest(server.Addr, false);
@ -228,10 +231,9 @@ namespace Components
ServerList::VisibleList.clear(); ServerList::VisibleList.clear();
ServerList::RefreshContainer.Mutex.lock(); ServerList::RefreshContainer.Mutex.lock();
ServerList::RefreshContainer.Servers.clear(); ServerList::RefreshContainer.Servers.clear();
ServerList::RefreshContainer.Mutex.unlock();
ServerList::RefreshContainer.SendCount = 0; ServerList::RefreshContainer.SendCount = 0;
ServerList::RefreshContainer.SentCount = 0; ServerList::RefreshContainer.SentCount = 0;
ServerList::RefreshContainer.Mutex.unlock();
if (ServerList::IsOfflineList()) if (ServerList::IsOfflineList())
{ {
@ -349,6 +351,21 @@ namespace Components
if (!alreadyInserted) if (!alreadyInserted)
{ {
ServerList::RefreshContainer.Servers.push_back(container); ServerList::RefreshContainer.Servers.push_back(container);
auto list = ServerList::GetList();
if (list)
{
for (auto server : *list)
{
if (server.Addr == container.Target)
{
ServerList::RefreshContainer.SendCount--;
ServerList::RefreshContainer.SentCount--;
break;
}
}
}
ServerList::RefreshContainer.SendCount++; ServerList::RefreshContainer.SendCount++;
} }