mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix compiler warnings
This commit is contained in:
parent
281004bb85
commit
2ec2873b3e
2 changed files with 56 additions and 56 deletions
|
|
@ -5339,7 +5339,7 @@ static void Got_Automatecmd(UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
if (server || consoleplayer == playernum)
|
if (server || consoleplayer == playernum)
|
||||||
{
|
{
|
||||||
if (command == NULL || strlen(command) == 0)
|
if (command[0] == '\0')
|
||||||
{
|
{
|
||||||
CONS_Printf(
|
CONS_Printf(
|
||||||
"Removed the %s automate command.\n",
|
"Removed the %s automate command.\n",
|
||||||
|
|
|
||||||
110
src/i_tcp.c
110
src/i_tcp.c
|
|
@ -1555,6 +1555,61 @@ static boolean SOCK_Ban(INT32 node)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean SOCK_SetBanUsername(const char *username)
|
||||||
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)username;
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
if (username == NULL || strlen(username) == 0)
|
||||||
|
{
|
||||||
|
username = "Direct IP ban";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (banned[numbans - 1].username)
|
||||||
|
{
|
||||||
|
Z_Free(banned[numbans - 1].username);
|
||||||
|
banned[numbans - 1].username = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
banned[numbans - 1].username = Z_StrDup(username);
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean SOCK_SetBanReason(const char *reason)
|
||||||
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)reason;
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
if (reason == NULL || strlen(reason) == 0)
|
||||||
|
{
|
||||||
|
reason = "No reason given";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (banned[numbans - 1].reason)
|
||||||
|
{
|
||||||
|
Z_Free(banned[numbans - 1].reason);
|
||||||
|
banned[numbans - 1].reason = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
banned[numbans - 1].reason = Z_StrDup(reason);
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean SOCK_SetUnbanTime(time_t timestamp)
|
||||||
|
{
|
||||||
|
#ifdef NONET
|
||||||
|
(void)reason;
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
banned[numbans - 1].timestamp = timestamp;
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static boolean SOCK_SetBanAddress(const char *address, const char *mask)
|
static boolean SOCK_SetBanAddress(const char *address, const char *mask)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
#ifdef NONET
|
||||||
|
|
@ -1619,61 +1674,6 @@ static boolean SOCK_SetBanAddress(const char *address, const char *mask)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean SOCK_SetBanUsername(const char *username)
|
|
||||||
{
|
|
||||||
#ifdef NONET
|
|
||||||
(void)username;
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
if (username == NULL || strlen(username) == 0)
|
|
||||||
{
|
|
||||||
username = "Direct IP ban";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (banned[numbans - 1].username)
|
|
||||||
{
|
|
||||||
Z_Free(banned[numbans - 1].username);
|
|
||||||
banned[numbans - 1].username = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
banned[numbans - 1].username = Z_StrDup(username);
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static boolean SOCK_SetBanReason(const char *reason)
|
|
||||||
{
|
|
||||||
#ifdef NONET
|
|
||||||
(void)reason;
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
if (reason == NULL || strlen(reason) == 0)
|
|
||||||
{
|
|
||||||
reason = "No reason given";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (banned[numbans - 1].reason)
|
|
||||||
{
|
|
||||||
Z_Free(banned[numbans - 1].reason);
|
|
||||||
banned[numbans - 1].reason = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
banned[numbans - 1].reason = Z_StrDup(reason);
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static boolean SOCK_SetUnbanTime(time_t timestamp)
|
|
||||||
{
|
|
||||||
#ifdef NONET
|
|
||||||
(void)reason;
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
banned[numbans - 1].timestamp = timestamp;
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void SOCK_ClearBans(void)
|
static void SOCK_ClearBans(void)
|
||||||
{
|
{
|
||||||
numbans = 0;
|
numbans = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue