Fix all the bugs ;D

This commit is contained in:
momo5502 2016-01-04 10:54:31 +01:00
parent 50fc70b071
commit ba9bcf0f67
4 changed files with 15 additions and 16 deletions

View File

@ -29,7 +29,6 @@ namespace Components
if (wFlag[0] == L'-')
{
Flags::EnabledFlags.push_back(std::string(++wFlag.begin(), wFlag.end()));
OutputDebugStringA(Flags::EnabledFlags[Flags::EnabledFlags.size() - 1].data());
}
}
}

View File

@ -140,17 +140,19 @@ namespace Components
int Network::PacketInterceptionHandler(const char* packet)
{
std::string packetCommand = packet;
auto pos = packetCommand.find_first_of("\\\n ");
if (pos != std::string::npos)
{
packetCommand = packetCommand.substr(0, pos);
}
packetCommand = Utils::StrToLower(packetCommand);
// Check if custom handler exists
for (auto i = Network::PacketHandlers.begin(); i != Network::PacketHandlers.end(); i++)
{
std::string packetCommand = packet;
auto pos = packetCommand.find_first_of("\n ");
if (pos != std::string::npos)
{
packetCommand = packetCommand.substr(0, pos);
}
if (Utils::StrToLower(i->first) == Utils::StrToLower(packetCommand))
if (Utils::StrToLower(i->first) == packetCommand)
{
Network::SelectedPacket = i->first;
return 0;

View File

@ -163,9 +163,9 @@ namespace Components
}
}
void ServerList::InsertRequest(Network::Address address, bool accquireMutex)
void ServerList::InsertRequest(Network::Address address, bool acquireMutex)
{
if (accquireMutex) ServerList::RefreshContainer.Mutex.lock();
if (acquireMutex) ServerList::RefreshContainer.Mutex.lock();
ServerList::Container::ServerContainer container;
container.Sent = false;
@ -187,7 +187,7 @@ namespace Components
ServerList::RefreshContainer.SendCount++;
}
if (accquireMutex) ServerList::RefreshContainer.Mutex.unlock();
if (acquireMutex) ServerList::RefreshContainer.Mutex.unlock();
}
void ServerList::Insert(Network::Address address, Utils::InfoString info)
@ -250,8 +250,6 @@ namespace Components
ServerList::GetList().push_back(server);
ServerList::VisibleList.push_back(index);
ServerList::SortList();
OutputDebugStringA(Utils::VA("Inserted with IP: %s", server.Addr.GetString()));
}
break;
@ -310,7 +308,7 @@ namespace Components
void ServerList::Frame()
{
ServerList::RefreshContainer.Mutex.lock();
if (!ServerList::RefreshContainer.Mutex.try_lock()) return;
if (ServerList::RefreshContainer.AwatingList)
{

View File

@ -27,7 +27,7 @@ namespace Components
static void Refresh();
static void RefreshVisibleList();
static void InsertRequest(Network::Address address, bool accquireMutex = true);
static void InsertRequest(Network::Address address, bool acquireMutex = true);
static void Insert(Network::Address address, Utils::InfoString info);
static bool IsFavouriteList();