Merge admin_name with GetCallerName
authorMario <mario@smbclan.net>
Sat, 18 Mar 2017 12:05:03 +0000 (22:05 +1000)
committerMario <mario@smbclan.net>
Sat, 18 Mar 2017 12:05:03 +0000 (22:05 +1000)
qcsrc/server/command/common.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh

index e331482..9f3a200 100644 (file)
@@ -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
index 81dc777..c403e28 100644 (file)
@@ -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));
index e91a7c2..afa6d10 100644 (file)
@@ -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;
index 730a528..4cc3bc3 100644 (file)
@@ -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);