Add cvar "protocol" so user can change protocol version on command line, for standalone games. Most of the patch by Simon McVittie with a few minor modifications by myself

This commit is contained in:
Thilo Schulz 2011-03-05 19:10:23 +00:00
parent 3639108763
commit 0387b8002e
7 changed files with 14 additions and 6 deletions

View file

@ -302,8 +302,8 @@ void SV_DirectConnect( netadr_t from ) {
Q_strncpyz( userinfo, Cmd_Argv(1), sizeof(userinfo) );
version = atoi( Info_ValueForKey( userinfo, "protocol" ) );
if ( version != PROTOCOL_VERSION ) {
NET_OutOfBandPrint( NS_SERVER, from, "print\nServer uses protocol version %i.\n", PROTOCOL_VERSION );
if ( version != com_protocol->integer ) {
NET_OutOfBandPrint( NS_SERVER, from, "print\nServer uses protocol version %i (yours is %i).\n", com_protocol->integer, version );
Com_DPrintf (" rejected connect from version %i\n", version);
return;
}