summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/sv_ccmds.c13
-rw-r--r--src/server/sv_client.c1
-rw-r--r--src/server/sv_game.c11
-rw-r--r--src/server/sv_main.c7
4 files changed, 22 insertions, 10 deletions
diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c
index 367ca23d..1da5aaeb 100644
--- a/src/server/sv_ccmds.c
+++ b/src/server/sv_ccmds.c
@@ -259,6 +259,17 @@ static void SV_KillServer_f( void ) {
/*
==================
+SV_CompleteMapName
+==================
+*/
+static void SV_CompleteMapName( char *args, int argNum ) {
+ if( argNum == 2 ) {
+ Field_CompleteFilename( "maps", "bsp", qtrue );
+ }
+}
+
+/*
+==================
SV_AddOperatorCommands
==================
*/
@@ -276,7 +287,9 @@ void SV_AddOperatorCommands( void ) {
Cmd_AddCommand ("map_restart", SV_MapRestart_f);
Cmd_AddCommand ("sectorlist", SV_SectorList_f);
Cmd_AddCommand ("map", SV_Map_f);
+ Cmd_SetCommandCompletionFunc( "map", SV_CompleteMapName );
Cmd_AddCommand ("devmap", SV_Map_f);
+ Cmd_SetCommandCompletionFunc( "devmap", SV_CompleteMapName );
Cmd_AddCommand ("killserver", SV_KillServer_f);
}
diff --git a/src/server/sv_client.c b/src/server/sv_client.c
index 4fa0b24f..4b7b3bb6 100644
--- a/src/server/sv_client.c
+++ b/src/server/sv_client.c
@@ -1251,6 +1251,7 @@ void SV_ExecuteClientCommand( client_t *cl, const char *s, qboolean clientOK ) {
if (clientOK) {
// pass unknown strings to the game
if (!u->name && sv.state == SS_GAME) {
+ Cmd_Args_Sanitize();
VM_Call( gvm, GAME_CLIENT_COMMAND, cl - svs.clients );
}
}
diff --git a/src/server/sv_game.c b/src/server/sv_game.c
index df13500d..d375c095 100644
--- a/src/server/sv_game.c
+++ b/src/server/sv_game.c
@@ -285,14 +285,9 @@ void SV_GetUsercmd( int clientNum, usercmd_t *cmd ) {
//==============================================
static int FloatAsInt( float f ) {
- union
- {
- int i;
- float f;
- } temp;
-
- temp.f = f;
- return temp.i;
+ floatint_t fi;
+ fi.f = f;
+ return fi.i;
}
/*
diff --git a/src/server/sv_main.c b/src/server/sv_main.c
index 7b66aa6f..01da0f5d 100644
--- a/src/server/sv_main.c
+++ b/src/server/sv_main.c
@@ -225,6 +225,7 @@ but not on every player enter or exit.
void SV_MasterHeartbeat( void ) {
static netadr_t adr[MAX_MASTER_SERVERS];
int i;
+ int res;
// "dedicated 1" is for lan play, "dedicated 2" is for inet public play
if ( !com_dedicated || com_dedicated->integer != 2 ) {
@@ -251,11 +252,13 @@ void SV_MasterHeartbeat( void ) {
sv_master[i]->modified = qfalse;
Com_Printf( "Resolving %s\n", sv_master[i]->string );
- if ( !NET_StringToAdr( sv_master[i]->string, &adr[i], NA_UNSPEC ) ) {
+ res = NET_StringToAdr( sv_master[i]->string, &adr[i], NA_UNSPEC );
+ if ( !res ) {
Com_Printf( "Couldn't resolve address: %s\n", sv_master[i]->string );
continue;
}
- if ( !strchr( sv_master[i]->string, ':' ) ) {
+ if ( res == 2 ) {
+ // if no port was specified, use the default master port
adr[i].port = BigShort( PORT_MASTER );
}
Com_Printf( "%s resolved to %s\n", sv_master[i]->string, NET_AdrToStringwPort(adr[i]));