diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-08-23 13:07:13 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-08-23 13:07:13 +0000 |
commit | 635b90d78f91f500e105b6280de24740edc5634e (patch) | |
tree | 08ffbe653ef45d009a6ef8aaa2705b7a71c68653 /source/net_common.c | |
parent | 4312c28e10db1a52b875133697b72a860d85f210 (diff) |
Changes to `net_ip', `net_port' and `net_clientport' cvars now take
effect immediately (`net_restart' is no longer required).
Console title now properly updates on server port change.
Added ability to display ban reason to clients, which should be
specified as `comment' argument to `addban' command.
Diffstat (limited to 'source/net_common.c')
-rw-r--r-- | source/net_common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/net_common.c b/source/net_common.c index 0bbb94f..3db96f8 100644 --- a/source/net_common.c +++ b/source/net_common.c @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "net_sock.h" #include "net_stream.h" #include "sys_public.h" +#include "sv_public.h" #if defined( _WIN32 ) #define WIN32_LEAN_AND_MEAN @@ -1155,6 +1156,8 @@ static void NET_Restart_f( void ) { if( sock != INVALID_SOCKET ) { NET_Listen( qtrue ); } + + SV_SetConsoleTitle(); } /* @@ -1224,6 +1227,10 @@ static size_t NET_DnRate_m( char *buffer, size_t size ) { return Com_sprintf( buffer, size, "%"PRIz, net_rate_dn ); } +static void net_param_changed( cvar_t *self ) { + NET_Restart_f(); +} + /* ==================== NET_Init @@ -1243,8 +1250,11 @@ void NET_Init( void ) { #endif net_ip = Cvar_Get( "net_ip", "localhost", 0 ); + net_ip->changed = net_param_changed; net_port = Cvar_Get( "net_port", va( "%i", PORT_SERVER ), 0 ); + net_port->changed = net_param_changed; net_clientport = Cvar_Get( "net_clientport", va( "%i", PORT_ANY ), 0 ); + net_clientport->changed = net_param_changed; net_dropsim = Cvar_Get( "net_dropsim", "0", 0 ); net_log_active = Cvar_Get( "net_log_active", "0", 0 ); net_log_active->changed = net_log_active_changed; |