diff options
author | Andrey Nazarov <skuller@skuller.net> | 2012-08-05 19:43:00 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2012-08-05 19:43:00 +0400 |
commit | dbf3445a4e965c21cfd6fc363c09f83355b4f0fa (patch) | |
tree | 966c9e21c5d104c51920e06ff3affc632c9ba847 | |
parent | 85bfaaba79c518a6833d08733784af4049aa1b95 (diff) |
Rename Com_IsDedicated() to COM_DEDICATED.
-rw-r--r-- | inc/common/common.h | 4 | ||||
-rw-r--r-- | src/common/common.c | 7 | ||||
-rw-r--r-- | src/server/commands.c | 4 | ||||
-rw-r--r-- | src/server/game.c | 2 | ||||
-rw-r--r-- | src/server/init.c | 2 | ||||
-rw-r--r-- | src/server/main.c | 12 | ||||
-rw-r--r-- | src/server/mvd/client.c | 14 | ||||
-rw-r--r-- | src/server/user.c | 2 | ||||
-rw-r--r-- | src/unix/system.c | 2 |
9 files changed, 25 insertions, 24 deletions
diff --git a/inc/common/common.h b/inc/common/common.h index c911276..f365e30 100644 --- a/inc/common/common.h +++ b/inc/common/common.h @@ -103,9 +103,9 @@ void Com_FlushLogs(void); #endif #if USE_CLIENT -#define Com_IsDedicated() (dedicated->integer != 0) +#define COM_DEDICATED (dedicated->integer != 0) #else -#define Com_IsDedicated() 1 +#define COM_DEDICATED 1 #endif #ifdef _DEBUG diff --git a/src/common/common.c b/src/common/common.c index 36de5be..2bd30cb 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -923,7 +923,7 @@ void Qcommon_Init(int argc, char **argv) com_fatal_error = Cvar_Get("com_fatal_error", "0", 0); com_version = Cvar_Get("version", com_version_string, CVAR_SERVERINFO | CVAR_ROM); - allow_download = Cvar_Get("allow_download", Com_IsDedicated() ? "0" : "1", CVAR_ARCHIVE); + allow_download = Cvar_Get("allow_download", COM_DEDICATED ? "0" : "1", CVAR_ARCHIVE); allow_download_players = Cvar_Get("allow_download_players", "1", CVAR_ARCHIVE); allow_download_models = Cvar_Get("allow_download_models", "1", CVAR_ARCHIVE); allow_download_sounds = Cvar_Get("allow_download_sounds", "1", CVAR_ARCHIVE); @@ -1007,7 +1007,8 @@ void Qcommon_Init(int argc, char **argv) // add + commands from command line if (!Com_AddLateCommands()) { // if the user didn't give any commands, run default action - char *cmd = Com_IsDedicated() ? "dedicated_start" : "client_start"; + char *cmd = COM_DEDICATED ? "dedicated_start" : "client_start"; + if ((cmd = Cmd_AliasCommand(cmd)) != NULL) { Cbuf_AddText(&cmd_buffer, cmd); Cbuf_Execute(&cmd_buffer); @@ -1021,7 +1022,7 @@ void Qcommon_Init(int argc, char **argv) // even not given a starting map, dedicated server starts // listening for rcon commands (create socket after all configs // are executed to make sure port number is properly set) - if (Com_IsDedicated()) { + if (COM_DEDICATED) { NET_Config(NET_SERVER); } diff --git a/src/server/commands.c b/src/server/commands.c index 8cacd79..cb06f2f 100644 --- a/src/server/commands.c +++ b/src/server/commands.c @@ -721,7 +721,7 @@ static void SV_ConSay_f(void) SV_ClientPrintf(client, PRINT_CHAT, "console: %s\n", s); } - if (Com_IsDedicated()) { + if (COM_DEDICATED) { Com_LPrintf(PRINT_TALK, "console: %s\n", s); } } @@ -1549,7 +1549,7 @@ void SV_InitOperatorCommands(void) { Cmd_Register(c_server); - if (Com_IsDedicated()) + if (COM_DEDICATED) Cmd_AddCommand("say", SV_ConSay_f); } diff --git a/src/server/game.c b/src/server/game.c index 277841a..017c61f 100644 --- a/src/server/game.c +++ b/src/server/game.c @@ -145,7 +145,7 @@ static void PF_bprintf(int level, const char *fmt, ...) MSG_WriteData(string, len + 1); // echo to console - if (Com_IsDedicated()) { + if (COM_DEDICATED) { // mask off high bits for (i = 0; i < len; i++) string[i] &= 127; diff --git a/src/server/init.c b/src/server/init.c index 12c6937..405e427 100644 --- a/src/server/init.c +++ b/src/server/init.c @@ -308,7 +308,7 @@ void SV_InitGame(unsigned mvd_spawn) // dedicated servers can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch - if (Com_IsDedicated()) { + if (COM_DEDICATED) { if (!Cvar_VariableInteger("coop")) Cvar_Set("deathmatch", "1"); } diff --git a/src/server/main.c b/src/server/main.c index 483cbb9..f547b5d 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -187,7 +187,7 @@ static void print_drop_reason(client_t *client, const char *reason, clstate_t ol client->name, prefix, reason); // print to server console - if (Com_IsDedicated() && client->netchan) + if (COM_DEDICATED && client->netchan) Com_Printf("%s[%s]%s%s\n", client->name, NET_AdrToString(&client->netchan->remote_address), prefix, reason); @@ -1674,7 +1674,7 @@ static void SV_MasterHeartbeat(void) size_t len; master_t *m; - if (!Com_IsDedicated()) + if (!COM_DEDICATED) return; // only dedicated servers send heartbeats if (!sv_public->integer) @@ -1718,7 +1718,7 @@ static void SV_MasterShutdown(void) m->last_ack = 0; } - if (!Com_IsDedicated()) + if (!COM_DEDICATED) return; // only dedicated servers send heartbeats if (!sv_public || !sv_public->integer) @@ -1753,7 +1753,7 @@ unsigned SV_Frame(unsigned msec) // advance local server time svs.realtime += msec; - if (Com_IsDedicated()) { + if (COM_DEDICATED) { // process console commands if not running a client Cbuf_Execute(&cmd_buffer); } @@ -1809,7 +1809,7 @@ unsigned SV_Frame(unsigned msec) sv.framenum++; } - if (Com_IsDedicated()) { + if (COM_DEDICATED) { // run cmd buffer in dedicated mode if (cmd_buffer.waitCount > 0) { cmd_buffer.waitCount--; @@ -1861,7 +1861,7 @@ void SV_UserinfoChanged(client_t *cl) for (i = 0; i < len; i++) name[i] &= 127; if (cl->name[0] && strcmp(cl->name, name)) { - if (Com_IsDedicated()) { + if (COM_DEDICATED) { Com_Printf("%s[%s] changed name to %s\n", cl->name, NET_AdrToString(&cl->netchan->remote_address), name); } diff --git a/src/server/mvd/client.c b/src/server/mvd/client.c index 81a770a..4036a2f 100644 --- a/src/server/mvd/client.c +++ b/src/server/mvd/client.c @@ -200,7 +200,7 @@ void MVD_Destroyf(mvd_t *mvd, const char *fmt, ...) Com_Printf("[%s] =X= %s\n", mvd->name, text); // notify spectators - if (Com_IsDedicated()) { + if (COM_DEDICATED) { MVD_BroadcastPrintf(mvd, PRINT_HIGH, 0, "[MVD] %s\n", text); } @@ -871,7 +871,7 @@ static qboolean gtv_wait_stop(mvd_t *mvd) stop: // notify spectators - if (Com_IsDedicated()) { + if (COM_DEDICATED) { MVD_BroadcastPrintf(mvd, PRINT_HIGH, 0, "[MVD] Streaming resumed.\n"); } @@ -910,7 +910,7 @@ static void gtv_wait_start(mvd_t *mvd) mvd->dirty = qtrue; // notify spectators - if (Com_IsDedicated()) { + if (COM_DEDICATED) { MVD_BroadcastPrintf(mvd, PRINT_HIGH, 0, "[MVD] Buffering data, please wait...\n"); } @@ -1110,7 +1110,7 @@ static void parse_hello(gtv_t *gtv) MVD_Spawn(); } else { // notify spectators - if (Com_IsDedicated() && gtv->mvd) { + if (COM_DEDICATED && gtv->mvd) { MVD_BroadcastPrintf(gtv->mvd, PRINT_HIGH, 0, "[MVD] Restored connection to the game server!\n"); } @@ -1207,7 +1207,7 @@ static void parse_stream_data(gtv_t *gtv) // oops, overflowed Com_Printf("[%s] =!= Delay buffer overflowed!\n", gtv->name); - if (Com_IsDedicated()) { + if (COM_DEDICATED) { // notify spectators MVD_BroadcastPrintf(mvd, PRINT_HIGH, 0, "[MVD] Delay buffer overflowed!\n"); @@ -1568,7 +1568,7 @@ static void gtv_destroy(gtv_t *gtv) // free it here, since it is not yet // added to global channel list MVD_Free(mvd); - } else if (Com_IsDedicated()) { + } else if (COM_DEDICATED) { // notify spectators MVD_BroadcastPrintf(mvd, PRINT_HIGH, 0, "[MVD] Disconnected from the game server!\n"); @@ -1601,7 +1601,7 @@ static void gtv_drop(gtv_t *gtv) gtv->retry_backoff += 15 * 1000; } else { // notify spectators - if (Com_IsDedicated() && gtv->mvd) { + if (COM_DEDICATED && gtv->mvd) { MVD_BroadcastPrintf(gtv->mvd, PRINT_HIGH, 0, "[MVD] Lost connection to the game server!\n"); } diff --git a/src/server/user.c b/src/server/user.c index 2970b5c..cb5cca9 100644 --- a/src/server/user.c +++ b/src/server/user.c @@ -858,7 +858,7 @@ static void SV_CvarResult_f(void) if (!strcmp(c, "version")) { if (!sv_client->version_string) { v = Cmd_RawArgsFrom(2); - if (Com_IsDedicated()) { + if (COM_DEDICATED) { Com_Printf("%s[%s]: %s\n", sv_client->name, NET_AdrToString(&sv_client->netchan->remote_address), v); } diff --git a/src/unix/system.c b/src/unix/system.c index b51be6c..443eefa 100644 --- a/src/unix/system.c +++ b/src/unix/system.c @@ -650,7 +650,7 @@ void Sys_Init(void) signal(SIGHUP, term_handler); } else #endif - if (Com_IsDedicated()) { + if (COM_DEDICATED) { signal(SIGHUP, hup_handler); } |