mirror of
https://github.com/UberGames/ioef.git
synced 2025-02-19 18:31:52 +00:00
When dropping bots, don't move to CS_ZOMBIE. Go straight to CS_FREE.
They aren't a real network connection, so you don't want to waste time before opening the slot for humans. Fixes Bugzilla #4243.
This commit is contained in:
parent
842f27818b
commit
8d0f212521
1 changed files with 10 additions and 5 deletions
|
@ -531,12 +531,13 @@ or crashing -- SV_FinalMessage() will handle that
|
||||||
void SV_DropClient( client_t *drop, const char *reason ) {
|
void SV_DropClient( client_t *drop, const char *reason ) {
|
||||||
int i;
|
int i;
|
||||||
challenge_t *challenge;
|
challenge_t *challenge;
|
||||||
|
const qboolean isBot = drop->netchan.remoteAddress.type == NA_BOT;
|
||||||
|
|
||||||
if ( drop->state == CS_ZOMBIE ) {
|
if ( drop->state == CS_ZOMBIE ) {
|
||||||
return; // already dropped
|
return; // already dropped
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drop->netchan.remoteAddress.type != NA_BOT) {
|
if ( !isBot ) {
|
||||||
// see if we already have a challenge for this ip
|
// see if we already have a challenge for this ip
|
||||||
challenge = &svs.challenges[0];
|
challenge = &svs.challenges[0];
|
||||||
|
|
||||||
|
@ -556,7 +557,6 @@ void SV_DropClient( client_t *drop, const char *reason ) {
|
||||||
// tell everyone why they got dropped
|
// tell everyone why they got dropped
|
||||||
SV_SendServerCommand( NULL, "print \"%s" S_COLOR_WHITE " %s\n\"", drop->name, reason );
|
SV_SendServerCommand( NULL, "print \"%s" S_COLOR_WHITE " %s\n\"", drop->name, reason );
|
||||||
|
|
||||||
|
|
||||||
if (drop->download) {
|
if (drop->download) {
|
||||||
FS_FCloseFile( drop->download );
|
FS_FCloseFile( drop->download );
|
||||||
drop->download = 0;
|
drop->download = 0;
|
||||||
|
@ -569,15 +569,20 @@ void SV_DropClient( client_t *drop, const char *reason ) {
|
||||||
// add the disconnect command
|
// add the disconnect command
|
||||||
SV_SendServerCommand( drop, "disconnect \"%s\"", reason);
|
SV_SendServerCommand( drop, "disconnect \"%s\"", reason);
|
||||||
|
|
||||||
if ( drop->netchan.remoteAddress.type == NA_BOT ) {
|
if ( isBot ) {
|
||||||
SV_BotFreeClient( drop - svs.clients );
|
SV_BotFreeClient( drop - svs.clients );
|
||||||
}
|
}
|
||||||
|
|
||||||
// nuke user info
|
// nuke user info
|
||||||
SV_SetUserinfo( drop - svs.clients, "" );
|
SV_SetUserinfo( drop - svs.clients, "" );
|
||||||
|
|
||||||
Com_DPrintf( "Going to CS_ZOMBIE for %s\n", drop->name );
|
if ( isBot ) {
|
||||||
drop->state = CS_ZOMBIE; // become free in a few seconds
|
// bots shouldn't go zombie, as there's no real net connection.
|
||||||
|
drop->state = CS_FREE;
|
||||||
|
} else {
|
||||||
|
Com_DPrintf( "Going to CS_ZOMBIE for %s\n", drop->name );
|
||||||
|
drop->state = CS_ZOMBIE; // become free in a few seconds
|
||||||
|
}
|
||||||
|
|
||||||
// if this was the last client on the server, send a heartbeat
|
// if this was the last client on the server, send a heartbeat
|
||||||
// to the master so it is known the server is empty
|
// to the master so it is known the server is empty
|
||||||
|
|
Loading…
Reference in a new issue