From: Mario Date: Sat, 18 Mar 2017 12:05:03 +0000 (+1000) Subject: Merge admin_name with GetCallerName X-Git-Tag: xonotic-v0.8.2~38 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=12700950f6fdaf354a4a8aafa85dc87c9b62331a;p=xonotic%2Fxonotic-data.pk3dir.git Merge admin_name with GetCallerName --- diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index e331482fc..9f3a200da 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -25,7 +25,7 @@ string GetCommandPrefix(entity caller) string GetCallerName(entity caller) { if (caller) return playername(caller, false); - else return admin_name(); // ((autocvar_sv_adminnick != "") ? autocvar_sv_adminnick : autocvar_hostname); + else return ((autocvar_sv_adminnick != "") ? autocvar_sv_adminnick : "SERVER ADMIN"); // autocvar_hostname } // verify that the client provided is acceptable for kicking diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 81dc77725..c403e28f1 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -134,8 +134,8 @@ void GameCommand_adminmsg(float request, float argc) } else { - centerprint(client, strcat("^3", admin_name(), ":\n^7", admin_message)); - sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", admin_message, "\n")); + centerprint(client, strcat("^3", GetCallerName(NULL), ":\n^7", admin_message)); + sprint(client, strcat("\{1}\{13}^3", GetCallerName(NULL), "^7: ", admin_message, "\n")); } successful = strcat(successful, (successful ? ", " : ""), playername(client, false)); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index e91a7c219..afa6d1044 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -61,15 +61,6 @@ void WarpZone_crosshair_trace(entity pl) } -string admin_name() -{ - if(autocvar_sv_adminnick != "") - return autocvar_sv_adminnick; - else - return "SERVER ADMIN"; -} - - void GameLogEcho(string s) { string fn; diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index 730a528b9..4cc3bc3de 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -32,8 +32,6 @@ float cvar_normal(string n) entity eliminatedPlayers; void EliminatedPlayers_Init(float(entity) isEliminated_func); -string admin_name(); - void write_recordmarker(entity pl, float tstart, float dt); void play2all(string samp);