From: Samual Date: Tue, 10 Jan 2012 22:15:35 +0000 (-0500) Subject: Some extra comments to chat code X-Git-Tag: xonotic-v0.6.0~187^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6129d1aeada6d8c31ad16a0f6a90f7cf3d2fa0ea;p=xonotic%2Fxonotic-data.pk3dir.git Some extra comments to chat code --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 0287fc153..15173b9ad 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1013,22 +1013,23 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f if(sourcemsgstr != "" && ret != 0) { - if(ret < 0) // fake + if(ret < 0) // faked message, because the player is muted { sprint(source, sourcemsgstr); if(sourcecmsgstr != "" && !privatesay) centerprint(source, sourcecmsgstr); } - else if(privatesay) + else if(privatesay) // private message, between 2 people only, not sent to server console { sprint(source, sourcemsgstr); sprint(privatesay, msgstr); if(cmsgstr != "") centerprint(privatesay, cmsgstr); } - else if(teamsay > 0) + else if(teamsay > 0) // team message, only sent to team mates { sprint(source, sourcemsgstr); + //print(msgstr); // send to server console too if(sourcecmsgstr != "") centerprint(source, sourcecmsgstr); FOR_EACH_REALPLAYER(head) if(head.team == source.team) @@ -1039,22 +1040,24 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f centerprint(head, cmsgstr); } } - else if(teamsay < 0) + else if(teamsay < 0) // spectator message, only sent to spectators { sprint(source, sourcemsgstr); + //print(msgstr); // send to server console too FOR_EACH_REALCLIENT(head) if(head.classname != "player") if(head != source) sprint(head, msgstr); } - else if(sourcemsgstr != msgstr) + else if(sourcemsgstr != msgstr) // trimmed/server fixed message, sent to all players { sprint(source, sourcemsgstr); + //print(msgstr); // send to server console too FOR_EACH_REALCLIENT(head) if(head != source) sprint(head, msgstr); } else - bprint(msgstr); + bprint(msgstr); // entirely normal message, sent to all players -- bprint sends to server console too. } return ret;