r3674 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Jun 1 14:20:42 EDT 2008
Author: div0
Date: 2008-06-01 14:20:42 -0400 (Sun, 01 Jun 2008)
New Revision: 3674
Modified:
trunk/data/qcsrc/server/cl_client.qc
trunk/data/qcsrc/server/g_world.qc
trunk/data/qcsrc/server/vote.qc
Log:
fix typo; report name changes; don't ignore sv_eventlog at soem places
Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc 2008-06-01 18:10:12 UTC (rev 3673)
+++ trunk/data/qcsrc/server/cl_client.qc 2008-06-01 18:20:42 UTC (rev 3674)
@@ -1,4 +1,5 @@
.float wantswelcomemessage;
+.string netname_previous;
void spawnfunc_info_player_survivor (void)
{
@@ -887,6 +888,7 @@
s = strcat(s, ftos(self.team));
GameLogEcho(s, FALSE);
}
+ self.netname_previous = strzone(self.netname);
//stuffcmd(self, "set tmpviewsize $viewsize \n");
@@ -1044,6 +1046,8 @@
Spawnqueue_Remove(self);
}
+ strunzone(self.netname_previous);
+
// free cvars
GetCvars(-1);
}
@@ -1612,6 +1616,14 @@
if(blockSpectators)
checkSpectatorBlock();
+ if(self.netname_previous != self.netname)
+ {
+ if(cvar("sv_eventlog"))
+ GameLogEcho(strcat(":name:", ftos(self.playerid), ":", self.netname), TRUE);
+ strunzone(self.netname_previous);
+ self.netname_previous = strzone(self.netname);
+ }
+
// version nagging
if(self.version_nagtime)
if(self.cvar_g_nexuizversion)
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2008-06-01 18:10:12 UTC (rev 3673)
+++ trunk/data/qcsrc/server/g_world.qc 2008-06-01 18:20:42 UTC (rev 3674)
@@ -1920,7 +1920,8 @@
if(mapvote_suggestions[i] != "")
strunzone(mapvote_suggestions[i]);
mapvote_suggestions[i] = strzone(m);
- GameLogEcho(strcat(":vote:suggested:", m, ":", ftos(self.playerid)), TRUE);
+ if(cvar("sv_eventlog"))
+ GameLogEcho(strcat(":vote:suggested:", m, ":", ftos(self.playerid)), TRUE);
return strcat("Suggestion of ", m, " accepted.");
}
@@ -1993,24 +1994,27 @@
float i;
float didntvote;
- result = strcat(":vote:finished:", mapvote_maps[mappos]);
- result = strcat(result, ":", ftos(mapvote_votes[mappos]), "::");
- didntvote = mapvote_voters;
- for(i = 0; i < mapvote_count; ++i)
- if(mapvote_maps[i] != "")
- {
- didntvote -= mapvote_votes[i];
- if(i != mappos)
+ if(cvar("sv_eventlog"))
+ {
+ result = strcat(":vote:finished:", mapvote_maps[mappos]);
+ result = strcat(result, ":", ftos(mapvote_votes[mappos]), "::");
+ didntvote = mapvote_voters;
+ for(i = 0; i < mapvote_count; ++i)
+ if(mapvote_maps[i] != "")
{
- result = strcat(result, ":", mapvote_maps[i]);
- result = strcat(result, ":", ftos(mapvote_votes[i]));
+ didntvote -= mapvote_votes[i];
+ if(i != mappos)
+ {
+ result = strcat(result, ":", mapvote_maps[i]);
+ result = strcat(result, ":", ftos(mapvote_votes[i]));
+ }
}
- }
- result = strcat(result, ":didn't vote:", ftos(didntvote));
+ result = strcat(result, ":didn't vote:", ftos(didntvote));
- GameLogEcho(result, FALSE);
- if(mapvote_maps_suggested[mappos])
- GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos]), FALSE);
+ GameLogEcho(result, FALSE);
+ if(mapvote_maps_suggested[mappos])
+ GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos]), FALSE);
+ }
FOR_EACH_REALCLIENT(other)
FixClientCvars(other);
@@ -2106,7 +2110,8 @@
}
}
result = strcat(result, ":didn't vote:", ftos(didntvote));
- GameLogEcho(result, FALSE);
+ if(cvar("sv_eventlog"))
+ GameLogEcho(result, FALSE);
}
return FALSE;
Modified: trunk/data/qcsrc/server/vote.qc
===================================================================
--- trunk/data/qcsrc/server/vote.qc 2008-06-01 18:10:12 UTC (rev 3673)
+++ trunk/data/qcsrc/server/vote.qc 2008-06-01 18:20:42 UTC (rev 3674)
@@ -130,7 +130,8 @@
e.vote_next = time + cvar("sv_vote_wait");
}
bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2 calls a vote for ", votecalledvote_display, "\n");
- GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display), TRUE);
+ if(cvar("sv_eventlog"))
+ GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display), TRUE);
VoteCount(); // needed if you are the only one
} else {
print_to(e, "^1This vote is not ok. See help for more info.");
@@ -167,7 +168,8 @@
e.vote_next = time + cvar("sv_vote_wait");
}
bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2 calls a vote to become ^3master^2.\n");
- GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display), FALSE);
+ if(cvar("sv_eventlog"))
+ GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display), FALSE);
VoteCount(); // needed if you are the only one
}
} else {
@@ -202,7 +204,8 @@
dovote_display = strcat("^1", dovote, " (^7", VoteNetname(e), "^1): ", GetKickVoteVictim_reason);
}
bprint("\{1}^2* ^3", VoteNetname(e), "^2 used his ^3master^2 status to do \"^2", dovote_display, "^2\".\n");
- GameLogEcho(strcat(":vote:vdo:", ftos(e.playerid), ":", dovote_display), FALSE);
+ if(cvar("sv_eventlog"))
+ GameLogEcho(strcat(":vote:vdo:", ftos(e.playerid), ":", dovote_display), FALSE);
localcmd(strcat(dovote, "\n"));
} else {
print_to(e, "^1This command is not ok. See help for more info.");
@@ -221,7 +224,8 @@
if(granted) {
ServerConsoleEcho(strcat("Accepted master login from ", VoteNetname(e)), TRUE);
bprint("\{1}^2* ^3", VoteNetname(e), "^2 logged in as ^3master^2\n");
- GameLogEcho(strcat(":vote:vlogin:", ftos(e.playerid)), FALSE);
+ if(cvar("sv_eventlog"))
+ GameLogEcho(strcat(":vote:vlogin:", ftos(e.playerid)), FALSE);
}
else
ServerConsoleEcho(strcat("REJECTED master login from ", VoteNetname(e)), TRUE);
@@ -469,7 +473,8 @@
void VoteStop(entity stopper) {
bprint("\{1}^2* ^3", VoteNetname(stopper), "^2 stopped ^3", VoteNetname(votecaller), "^2's vote\n");
- GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid)), FALSE);
+ if(cvar("sv_eventlog"))
+ GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid)), FALSE);
if(stopper == votecaller) {
// no wait for next vote so you can correct your vote
if(votecaller) {
@@ -499,17 +504,20 @@
else
{
s = strcat("\{1}^2* vote results: ^1", ftos(yescount), "^2:^1");
- s = strcat(s, ftos(nocount), "^2 (^1");
+ s = strcat(s, ftos(nocount), "^2, ^1");
s = strcat(s, ftos(abstaincount), "^2 didn't care, ^1");
s = strcat(s, ftos(notvoters), "^2 didn't have to vote\n");
}
bprint(s);
- s = strcat(":vote:v", result, ":", ftos(yescount));
- s = strcat(s, ":", ftos(nocount));
- s = strcat(s, ":", ftos(abstaincount));
- s = strcat(s, ":", ftos(notvoters));
- s = strcat(s, ":", ftos(mincount));
- GameLogEcho(s, FALSE);
+ if(cvar("sv_eventlog"))
+ {
+ s = strcat(":vote:v", result, ":", ftos(yescount));
+ s = strcat(s, ":", ftos(nocount));
+ s = strcat(s, ":", ftos(abstaincount));
+ s = strcat(s, ":", ftos(notvoters));
+ s = strcat(s, ":", ftos(mincount));
+ GameLogEcho(s, FALSE);
+ }
}
void VoteCount() {
More information about the nexuiz-commits
mailing list