]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use playername in a few more places
authorMario <mario@smbclan.net>
Wed, 15 Feb 2017 10:52:10 +0000 (20:52 +1000)
committerMario <mario@smbclan.net>
Wed, 15 Feb 2017 10:52:10 +0000 (20:52 +1000)
qcsrc/common/playerstats.qc
qcsrc/server/cheats.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/player.qc
qcsrc/server/scores.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/hitplot.qc

index 2a15b36d187a768ee7b4e97764446a85bf9f9af2..7f31e20d311746958f80082fababa2a9e01ab253 100644 (file)
@@ -133,7 +133,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
        db_put(PS_GR_OUT_DB, sprintf("%s:_playerid", p.playerstats_id), ftos(p.playerid));
 
        if(p.cvar_cl_allow_uid2name == 1 || IS_BOT_CLIENT(p))
-               db_put(PS_GR_OUT_DB, sprintf("%s:_netname", p.playerstats_id), p.netname);
+               db_put(PS_GR_OUT_DB, sprintf("%s:_netname", p.playerstats_id), playername(p, false));
 
        if(teamplay)
                db_put(PS_GR_OUT_DB, sprintf("%s:_team", p.playerstats_id), ftos(p.team));
index dd1e395c722156026e00d9047a1617eee54b283b..d54feeac84111662ae3d320880b488c38775c902 100644 (file)
@@ -77,13 +77,13 @@ float CheatsAllowed(entity this, float i, float argc, float fr) // the cheat get
 
        // if we get here, player is not allowed to cheat. Log it.
        if(i)
-               bprintf("Player %s^7 tried to use cheat 'impulse %d'\n", this.netname, i);
+               bprintf("Player %s^7 tried to use cheat 'impulse %d'\n", playername(this, false), i);
        else if(argc)
-               bprintf("Player %s^7 tried to use cheat '%s'\n", this.netname, argv(0));
+               bprintf("Player %s^7 tried to use cheat '%s'\n", playername(this, false), argv(0));
        else if(fr)
-               bprintf("Player %s^7 tried to use cheat frame %d\n", this.netname, fr);
+               bprintf("Player %s^7 tried to use cheat frame %d\n", playername(this, false), fr);
        else
-               bprintf("Player %s^7 tried to use an unknown cheat\n", this.netname);
+               bprintf("Player %s^7 tried to use an unknown cheat\n", playername(this, false));
 
        return 0;
 }
index 91030beacd74a171f54c37c1dcf75141d467c3ff..da9fd8621f171b34aed6ab9ca144b3e0a563fa37 100644 (file)
@@ -242,12 +242,12 @@ void ClientCommand_ready(entity caller, float request)  // todo: anti-spam for t
                                                if (caller.ready)            // toggle
                                                {
                                                        caller.ready = false;
-                                                       bprint(caller.netname, "^2 is ^1NOT^2 ready\n");
+                                                       bprint(playername(caller, false), "^2 is ^1NOT^2 ready\n");
                                                }
                                                else
                                                {
                                                        caller.ready = true;
-                                                       bprint(caller.netname, "^2 is ready\n");
+                                                       bprint(playername(caller, false), "^2 is ready\n");
                                                }
 
                                                // cannot reset the game while a timeout is active!
index 8c9d915a213a80e31c35fd2c1fcbfb065921c7c1..81dc7772595ab6efa0cd65d687ba6d79c233061a 100644 (file)
@@ -138,8 +138,8 @@ void GameCommand_adminmsg(float request, float argc)
                                                sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", admin_message, "\n"));
                                        }
 
-                                       successful = strcat(successful, (successful ? ", " : ""), client.netname);
-                                       LOG_TRACE("Message sent to ", client.netname);
+                                       successful = strcat(successful, (successful ? ", " : ""), playername(client, false));
+                                       LOG_TRACE("Message sent to ", playername(client, false));
                                        continue;
                                }
 
@@ -542,7 +542,7 @@ void GameCommand_defer_clear(float request, float argc)
                                if (accepted > 0)
                                {
                                        stuffcmd(client, "defer clear\n");
-                                       LOG_INFO("defer clear stuffed to ", client.netname, "\n");
+                                       LOG_INFO("defer clear stuffed to ", playername(client, false), "\n");
                                }
                                else { LOG_INFO("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
 
@@ -1047,11 +1047,11 @@ void GameCommand_moveplayer(float request, float argc)
                                                        if (client.caplayer) client.caplayer = 0;
                                                        PutObserverInServer(client);
 
-                                                       successful = strcat(successful, (successful ? ", " : ""), client.netname);
+                                                       successful = strcat(successful, (successful ? ", " : ""), playername(client, false));
                                                }
                                                else
                                                {
-                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already spectating.\n");
+                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already spectating.\n");
                                                }
                                                continue;
                                        }
@@ -1071,7 +1071,7 @@ void GameCommand_moveplayer(float request, float argc)
                                                                if (team_id == client.team)  // already on the destination team
                                                                {
                                                                        // keep the forcing undone
-                                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
+                                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
                                                                        continue;
                                                                }
                                                                else if (team_id == 0)  // auto team
@@ -1100,8 +1100,8 @@ void GameCommand_moveplayer(float request, float argc)
                                                                // If so, lets continue and finally move the player
                                                                client.team_forced = 0;
                                                                MoveToTeam(client, team_id, 6);
-                                                               successful = strcat(successful, (successful ? ", " : ""), client.netname);
-                                                               LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
+                                                               successful = strcat(successful, (successful ? ", " : ""), playername(client, false));
+                                                               LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
                                                                continue;
                                                        }
                                                        else
index e6e9f481f635ae5e1682897268b1f7b3a2a6e910..067ed02e938064cdd78d354372d4d3873515680f 100644 (file)
@@ -743,10 +743,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
                        privatemsgprefixlen = strlen(msgstr);
                        msgstr = strcat(msgstr, msgin);
                        cmsgstr = strcat(colorstr, colorprefix, namestr, "^3 tells you:\n^7", msgin);
-                       if(autocvar_g_chat_teamcolors)
-                               privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", playername(privatesay, true), ": ^7");
-                       else
-                               privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", privatesay.netname, ": ^7");
+                       privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", playername(privatesay, autocvar_g_chat_teamcolors), ": ^7");
                }
                else if(teamsay)
                {
index b46663043343d7a9e781c75477ecae6b94d4f7cd..eace0ee5995b0b20d42417c20a6dd860105c18d0 100644 (file)
@@ -824,7 +824,7 @@ void Score_NicePrint_Player(entity to, entity p, float w)
 
        sk = p.scorekeeper;
 
-       s = strcat(s, p.netname);
+       s = strcat(s, playername(p, false));
        for (;;)
        {
                i = strlennocol(s) - NAMEWIDTH;
@@ -856,7 +856,7 @@ void Score_NicePrint_Spectators(entity to)
 
 void Score_NicePrint_Spectator(entity to, entity p)
 {
-       print_to(to, strcat("  ", p.netname));
+       print_to(to, strcat("  ", playername(p, false)));
 }
 
 .float score_dummyfield;
index d16bb781b821998383b8be8460745309cb7b4783..7023768219e15fe6fc108ec8e702084e51e8a62d 100644 (file)
@@ -209,7 +209,7 @@ void SetPlayerTeam(entity pl, float t, float s, float noprint)
                LogTeamchange(pl.playerid, pl.team, 3);  // log manual team join
 
                if(!noprint)
-               bprint(pl.netname, "^7 has changed from ", Team_NumberToColoredFullName(s), "^7 to ", Team_NumberToColoredFullName(t), "\n");
+                       bprint(playername(pl, false), "^7 has changed from ", Team_NumberToColoredFullName(s), "^7 to ", Team_NumberToColoredFullName(t), "\n");
        }
 
 }
index 2a4ca8dc3799503498d84f46e5ff13d91adf379c..2a0fad7dee0c832e086d8feb2ff85ea347d7f3d3 100644 (file)
@@ -85,7 +85,7 @@ void W_HitPlotOpen(entity player)
        if(autocvar_g_hitplots || strhasword(autocvar_g_hitplots_individuals, player.netaddress))
        {
                player.hitplotfh = fopen(strcat("hits-", matchid, "-", player.netaddress, "-", ftos(player.playerid), ".plot"), FILE_WRITE);
-               fputs(player.hitplotfh, strcat("#name ", player.netname, "\n"));
+               fputs(player.hitplotfh, strcat("#name ", playername(player, false), "\n"));
        }
        else { player.hitplotfh = -1; }
 }