From f87fd36be76a1d394871895fb8020eea62e5b8db Mon Sep 17 00:00:00 2001 From: g-cont Date: Tue, 8 Dec 2015 00:00:00 +0300 Subject: [PATCH] 08 Dec 2015 --- engine/client/gl_image.c | 2 +- engine/client/s_vox.c | 6 ++++-- engine/common/build.c | 2 +- engine/server/sv_client.c | 22 +++++++++++++++++++--- engine/server/sv_main.c | 6 +++--- engine/server/sv_phys.c | 4 ++-- mainui/menu_langame.cpp | 7 +------ 7 files changed, 31 insertions(+), 18 deletions(-) diff --git a/engine/client/gl_image.c b/engine/client/gl_image.c index 9c8bc276..02ae3236 100644 --- a/engine/client/gl_image.c +++ b/engine/client/gl_image.c @@ -4409,7 +4409,7 @@ static rgbdata_t *R_InitVSDCTCubemap( texFlags_t *flags ) // YY // ZZ // stores abs(dir.xy), offset.xy/2.5 - byte data[4*6] = + static byte data[4*6] = { 0xFF, 0x00, 0x33, 0x33, // +X: <1, 0>, <0.5, 0.5> 0xFF, 0x00, 0x99, 0x33, // -X: <1, 0>, <1.5, 0.5> diff --git a/engine/client/s_vox.c b/engine/client/s_vox.c index 12ffa8d7..4f5eeb6e 100644 --- a/engine/client/s_vox.c +++ b/engine/client/s_vox.c @@ -404,8 +404,10 @@ void VOX_LoadFirstWord( channel_t *pchan, voxword_t *pwords ) // sentence array, and set the channel to point to the // sentence array while( pwords[i].sfx != NULL ) - pchan->words[i] = pwords[i++]; - + { + pchan->words[i] = pwords[i]; + i++; + } pchan->words[i].sfx = NULL; pchan->wordIndex = 0; diff --git a/engine/common/build.c b/engine/common/build.c index b362a90a..056c0953 100644 --- a/engine/common/build.c +++ b/engine/common/build.c @@ -48,6 +48,6 @@ int Q_buildnum( void ) return b; #else - return 3153; + return 3224; #endif } \ No newline at end of file diff --git a/engine/server/sv_client.c b/engine/server/sv_client.c index 53aa2860..41445810 100644 --- a/engine/server/sv_client.c +++ b/engine/server/sv_client.c @@ -289,6 +289,9 @@ void SV_DisconnectClient( edict_t *pClient ) Mem_Free( pClient->pvPrivateData ); pClient->pvPrivateData = NULL; } + + // invalidate serial number + pClient->serialnumber++; } /* @@ -809,16 +812,29 @@ recalc ping on current client int SV_CalcPing( sv_client_t *cl ) { float ping = 0; - int i, count; + int i, count, back; client_frame_t *frame; // bots don't have a real ping - if( cl->fakeclient ) + if( cl->fakeclient || !cl->frames ) return 5; count = 0; - for( i = 0; i < SV_UPDATE_BACKUP; i++ ) + if ( SV_UPDATE_BACKUP <= 31 ) + { + back = SV_UPDATE_BACKUP / 2; + if ( back <= 0 ) + { + return 0; + } + } + else + { + back = 16; + } + + for( i = 0; i < back; i++ ) { frame = &cl->frames[(cl->netchan.incoming_acknowledged - (i + 1)) & SV_UPDATE_MASK]; diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index 3f55bc23..0c86037a 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -438,7 +438,7 @@ void SV_CheckTimeouts( void ) continue; } - if(( cl->state == cs_connected || cl->state == cs_spawned ) && cl->lastmessage < droppoint ) + if(( cl->state == cs_connected || cl->state == cs_spawned ) && cl->lastmessage < droppoint && !NET_IsLocalAddress( cl->netchan.remote_address )) { SV_BroadcastPrintf( PRINT_HIGH, "%s timed out\n", cl->name ); SV_DropClient( cl ); @@ -686,7 +686,7 @@ void SV_Init( void ) rcon_password = Cvar_Get( "rcon_password", "", 0, "remote connect password" ); sv_stepsize = Cvar_Get( "sv_stepsize", "18", CVAR_ARCHIVE|CVAR_PHYSICINFO, "how high you can step up" ); sv_newunit = Cvar_Get( "sv_newunit", "0", 0, "sets to 1 while new unit is loading" ); - hostname = Cvar_Get( "hostname", "unnamed", CVAR_SERVERNOTIFY|CVAR_SERVERNOTIFY|CVAR_ARCHIVE, "host name" ); + hostname = Cvar_Get( "hostname", "unnamed", CVAR_SERVERNOTIFY|CVAR_ARCHIVE, "host name" ); timeout = Cvar_Get( "timeout", "125", CVAR_SERVERNOTIFY, "connection timeout" ); zombietime = Cvar_Get( "zombietime", "2", CVAR_SERVERNOTIFY, "timeout for clients-zombie (who died but not respawned)" ); sv_pausable = Cvar_Get( "pausable", "1", CVAR_SERVERNOTIFY, "allow players to pause or not" ); @@ -712,7 +712,7 @@ void SV_Init( void ) sv_check_errors = Cvar_Get( "sv_check_errors", "0", CVAR_ARCHIVE, "check edicts for errors" ); physinfo = Cvar_Get( "@physinfo", "0", CVAR_READ_ONLY, "" ); // use ->modified value only serverinfo = Cvar_Get( "@serverinfo", "0", CVAR_READ_ONLY, "" ); // use ->modified value only - public_server = Cvar_Get ("public", "0", 0, "change server type from private to public" ); + public_server = Cvar_Get ("public", "0", CVAR_SERVERNOTIFY, "change server type from private to public" ); sv_lighting_modulate = Cvar_Get( "r_lighting_modulate", "0.6", CVAR_ARCHIVE, "lightstyles modulate scale" ); sv_reconnect_limit = Cvar_Get ("sv_reconnect_limit", "3", CVAR_ARCHIVE, "max reconnect attempts" ); sv_failuretime = Cvar_Get( "sv_failuretime", "0.5", 0, "after this long without a packet from client, don't send any more until client starts sending again" ); diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 85379362..ff03904a 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -190,7 +190,7 @@ qboolean SV_RunThink( edict_t *ent ) { float thinktime; - if(!( ent->v.flags & FL_SPECTATOR )) + if(!( ent->v.flags & FL_KILLME )) { thinktime = ent->v.nextthink; if( thinktime <= 0.0f || thinktime > sv.time + host.frametime ) @@ -205,7 +205,7 @@ qboolean SV_RunThink( edict_t *ent ) svgame.dllFuncs.pfnThink( ent ); } - if( ent->v.flags & FL_SPECTATOR ) + if( ent->v.flags & FL_KILLME ) SV_FreeEdict( ent ); return !ent->free; diff --git a/mainui/menu_langame.cpp b/mainui/menu_langame.cpp index d1292c14..7c355af2 100644 --- a/mainui/menu_langame.cpp +++ b/mainui/menu_langame.cpp @@ -124,12 +124,7 @@ static void UI_LanGame_GetGamesList( void ) { if( i >= UI_MAX_SERVERS ) break; info = uiStatic.serverNames[i]; -#if 1 - // NOTE: Xash3D is support hot switching between games in multiplayer - // but this feature not detail tested and may be bugly - if( stricmp( gMenu.m_gameinfo.gamefolder, Info_ValueForKey( info, "gamedir" ))) - continue; // filter by game -#endif + StringConcat( uiLanGame.gameDescription[i], Info_ValueForKey( info, "host" ), GAME_LENGTH ); StringConcat( uiLanGame.gameDescription[i], uiEmptyString, GAME_LENGTH ); StringConcat( uiLanGame.gameDescription[i], Info_ValueForKey( info, "map" ), MAPNAME_LENGTH );