mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Reject banned players with refusereason
This commit is contained in:
parent
8486a9386d
commit
c13e1a74dd
2 changed files with 15 additions and 4 deletions
|
@ -1205,6 +1205,8 @@ GetRefuseReason (INT32 node)
|
||||||
{
|
{
|
||||||
if (!node || FindRejoinerNum(node) != -1)
|
if (!node || FindRejoinerNum(node) != -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
else if (bannednode && bannednode[node])
|
||||||
|
return REFUSE_BANNED;
|
||||||
else if (!cv_allownewplayer.value)
|
else if (!cv_allownewplayer.value)
|
||||||
return REFUSE_JOINS_DISABLED;
|
return REFUSE_JOINS_DISABLED;
|
||||||
else if (D_NumPlayers() >= cv_maxplayers.value)
|
else if (D_NumPlayers() >= cv_maxplayers.value)
|
||||||
|
@ -1874,6 +1876,10 @@ static const char * InvalidServerReason (INT32 i)
|
||||||
|
|
||||||
switch (info->refusereason)
|
switch (info->refusereason)
|
||||||
{
|
{
|
||||||
|
case REFUSE_BANNED:
|
||||||
|
return
|
||||||
|
"You have been banned\n"
|
||||||
|
"from the server.\n" EOT;
|
||||||
case REFUSE_JOINS_DISABLED:
|
case REFUSE_JOINS_DISABLED:
|
||||||
return
|
return
|
||||||
"The server is not accepting\n"
|
"The server is not accepting\n"
|
||||||
|
|
|
@ -22,11 +22,15 @@
|
||||||
#include "mserv.h"
|
#include "mserv.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The 'packet version' is used to distinguish packet formats.
|
The 'packet version' is used to distinguish packet
|
||||||
This version is independent of VERSION and SUBVERSION. Different
|
formats. This version is independent of VERSION and
|
||||||
applications may follow different packet versions.
|
SUBVERSION. Different applications may follow different
|
||||||
|
packet versions.
|
||||||
|
|
||||||
|
If you change the struct or the meaning of a field
|
||||||
|
therein, increment this number.
|
||||||
*/
|
*/
|
||||||
#define PACKETVERSION 3
|
#define PACKETVERSION 4
|
||||||
|
|
||||||
// Network play related stuff.
|
// Network play related stuff.
|
||||||
// There is a data struct that stores network
|
// There is a data struct that stores network
|
||||||
|
@ -197,6 +201,7 @@ typedef struct
|
||||||
enum {
|
enum {
|
||||||
REFUSE_JOINS_DISABLED = 1,
|
REFUSE_JOINS_DISABLED = 1,
|
||||||
REFUSE_SLOTS_FULL,
|
REFUSE_SLOTS_FULL,
|
||||||
|
REFUSE_BANNED,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAXSERVERNAME 32
|
#define MAXSERVERNAME 32
|
||||||
|
|
Loading…
Reference in a new issue