mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix banmaster compilation. Fix some sign-compare warnings
This commit is contained in:
parent
de4a95c5d2
commit
47a1e2b230
|
@ -134,7 +134,7 @@ void PurgeBans()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConBan(IConsole::IResult *pResult, void *pUser, int ClientID)
|
void ConBan(IConsole::IResult *pResult, void *pUser)
|
||||||
{
|
{
|
||||||
NETADDR Addr;
|
NETADDR Addr;
|
||||||
const char *pStr = pResult->GetString(0);
|
const char *pStr = pResult->GetString(0);
|
||||||
|
@ -149,12 +149,12 @@ void ConBan(IConsole::IResult *pResult, void *pUser, int ClientID)
|
||||||
dbg_msg("banmaster", "invalid network address to ban, str='%s'", pStr);
|
dbg_msg("banmaster", "invalid network address to ban, str='%s'", pStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConUnbanAll(IConsole::IResult *pResult, void *pUser, int ClientID)
|
void ConUnbanAll(IConsole::IResult *pResult, void *pUser)
|
||||||
{
|
{
|
||||||
ClearBans();
|
ClearBans();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConSetBindAddr(IConsole::IResult *pResult, void *pUser, int ClientID)
|
void ConSetBindAddr(IConsole::IResult *pResult, void *pUser)
|
||||||
{
|
{
|
||||||
if(m_aBindAddr[0])
|
if(m_aBindAddr[0])
|
||||||
return;
|
return;
|
||||||
|
@ -177,7 +177,7 @@ int main(int argc, const char **argv) // ignore_convention
|
||||||
IStorage *pStorage = CreateStorage("Teeworlds", argc, argv); // ignore_convention
|
IStorage *pStorage = CreateStorage("Teeworlds", argc, argv); // ignore_convention
|
||||||
|
|
||||||
m_pConsole = CreateConsole(CFGFLAG_BANMASTER);
|
m_pConsole = CreateConsole(CFGFLAG_BANMASTER);
|
||||||
m_pConsole->RegisterPrintCallback(StandardOutput, 0);
|
m_pConsole->RegisterPrintCallback(2, StandardOutput, 0);
|
||||||
m_pConsole->Register("ban", "s?r", CFGFLAG_BANMASTER, ConBan, 0, "Bans the specified ip");
|
m_pConsole->Register("ban", "s?r", CFGFLAG_BANMASTER, ConBan, 0, "Bans the specified ip");
|
||||||
m_pConsole->Register("unban_all", "", CFGFLAG_BANMASTER, ConUnbanAll, 0, "Unbans all ips");
|
m_pConsole->Register("unban_all", "", CFGFLAG_BANMASTER, ConUnbanAll, 0, "Unbans all ips");
|
||||||
m_pConsole->Register("bind", "s", CFGFLAG_BANMASTER, ConSetBindAddr, 0, "Binds to the specified address");
|
m_pConsole->Register("bind", "s", CFGFLAG_BANMASTER, ConSetBindAddr, 0, "Binds to the specified address");
|
||||||
|
@ -222,7 +222,7 @@ int main(int argc, const char **argv) // ignore_convention
|
||||||
char aAddressStr[NETADDR_MAXSTRSIZE];
|
char aAddressStr[NETADDR_MAXSTRSIZE];
|
||||||
net_addr_str(&Packet.m_Address, aAddressStr, sizeof(aAddressStr));
|
net_addr_str(&Packet.m_Address, aAddressStr, sizeof(aAddressStr));
|
||||||
|
|
||||||
if(Packet.m_DataSize >= sizeof(BANMASTER_IPCHECK) && mem_comp(Packet.m_pData, BANMASTER_IPCHECK, sizeof(BANMASTER_IPCHECK)) == 0)
|
if((unsigned)Packet.m_DataSize >= sizeof(BANMASTER_IPCHECK) && mem_comp(Packet.m_pData, BANMASTER_IPCHECK, sizeof(BANMASTER_IPCHECK)) == 0)
|
||||||
{
|
{
|
||||||
char *pAddr = (char *)Packet.m_pData + sizeof(BANMASTER_IPCHECK);
|
char *pAddr = (char *)Packet.m_pData + sizeof(BANMASTER_IPCHECK);
|
||||||
NETADDR CheckAddr;
|
NETADDR CheckAddr;
|
||||||
|
|
|
@ -1111,7 +1111,7 @@ void CServer::PumpNetwork()
|
||||||
{
|
{
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if(Packet.m_DataSize >= sizeof(BANMASTER_IPBAN) &&
|
if((unsigned)Packet.m_DataSize >= sizeof(BANMASTER_IPBAN) &&
|
||||||
mem_comp(Packet.m_pData, BANMASTER_IPBAN, sizeof(BANMASTER_IPBAN)) == 0)
|
mem_comp(Packet.m_pData, BANMASTER_IPBAN, sizeof(BANMASTER_IPBAN)) == 0)
|
||||||
{
|
{
|
||||||
if(!g_Config.m_SvGlobalBantime)
|
if(!g_Config.m_SvGlobalBantime)
|
||||||
|
|
Loading…
Reference in a new issue