minstagib_stop_countdown(self);
Portal_ClearAll(self);
-
+
if(self.alivetime)
{
- PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+ if(!inWarmupStage)
+ PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
self.alivetime = 0;
}
{
if(self.version_mismatch)
{
+ self.frags = FRAGS_SPECTATOR;
Spawnqueue_Unmark(self);
Spawnqueue_Remove(self);
}
else
{
+ self.frags = FRAGS_LMS_LOSER;
Spawnqueue_Insert(self);
}
}
else
self.frags = FRAGS_SPECTATOR;
}
+ else if((g_race && g_race_qualifying) || g_cts)
+ {
+ if(PlayerScore_Add(self, SP_RACE_FASTEST, 0))
+ self.frags = FRAGS_LMS_LOSER;
+ else
+ self.frags = FRAGS_SPECTATOR;
+ }
else
self.frags = FRAGS_SPECTATOR;
}
if(teamplay)
{
string s;
- s = Team_ColorNameLowerCase(self.team);
+ s = Team_ColorName_Lower(self.team);
if(s != "neutral")
{
defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s));
self.weaponname = "";
self.switchingweapon = 0;
- if(!self.alivetime)
- self.alivetime = time;
+ if(!inWarmupStage)
+ if(!self.alivetime)
+ self.alivetime = time;
antilag_clear(self);
}
else
{
- self.killindicator.colormod = TeamColor(targetteam);
+ self.killindicator.colormod = Team_ColorRGB(targetteam);
if(clienttype(self) == CLIENTTYPE_REAL)
if(self.killindicator.cnt > 0)
- Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, strcat("Changing to ", ColoredTeamName(targetteam), " in %d seconds"), 1, self.killindicator.cnt);
+ Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, strcat("^7Changing to ", Team_ColoredFullName(targetteam), "^7 in %d seconds"), 1, self.killindicator.cnt);
}
}
stuffcmd(e, "cl_cmd settemp cl_movecliptokeyboard 2\n");
if(autocvar_g_antilag == 3) // client side hitscan
stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
- if(sv_gentle)
+ if(autocvar_sv_gentle)
stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
/*
* we no longer need to stuff this. Remove this comment block if you feel
Called when a client connects to the server
=============
*/
-string ColoredTeamName(float t);
void DecodeLevelParms (void);
//void dom_player_join_team(entity pl);
void set_dom_state(entity e);
self.flags = FL_CLIENT;
self.version_nagtime = time + 10 + random() * 10;
+ if(self.netaddress == "local")
+ {
+ print("^3server is local!\n");
+
+ if(server_is_local)
+ print("Multiple local clients???");
+ else
+ server_is_local = TRUE;
+ }
+
if(player_count<0)
{
dprint("BUG player count is lower than zero, this cannot happen!\n");
{
switch(autocvar_g_campaign_forceteam)
{
- case 1: self.team_forced = COLOR_TEAM1; break;
- case 2: self.team_forced = COLOR_TEAM2; break;
- case 3: self.team_forced = COLOR_TEAM3; break;
- case 4: self.team_forced = COLOR_TEAM4; break;
+ case 1: self.team_forced = FL_TEAM_1; break;
+ case 2: self.team_forced = FL_TEAM_2; break;
+ case 3: self.team_forced = FL_TEAM_3; break;
+ case 4: self.team_forced = FL_TEAM_4; break;
default: self.team_forced = 0;
}
}
}
else if(PlayerInIDList(self, autocvar_g_forced_team_red))
- self.team_forced = COLOR_TEAM1;
+ self.team_forced = FL_TEAM_1;
else if(PlayerInIDList(self, autocvar_g_forced_team_blue))
- self.team_forced = COLOR_TEAM2;
+ self.team_forced = FL_TEAM_2;
else if(PlayerInIDList(self, autocvar_g_forced_team_yellow))
- self.team_forced = COLOR_TEAM3;
+ self.team_forced = FL_TEAM_3;
else if(PlayerInIDList(self, autocvar_g_forced_team_pink))
- self.team_forced = COLOR_TEAM4;
+ self.team_forced = FL_TEAM_4;
else if(autocvar_g_forced_team_otherwise == "red")
- self.team_forced = COLOR_TEAM1;
+ self.team_forced = FL_TEAM_1;
else if(autocvar_g_forced_team_otherwise == "blue")
- self.team_forced = COLOR_TEAM2;
+ self.team_forced = FL_TEAM_2;
else if(autocvar_g_forced_team_otherwise == "yellow")
- self.team_forced = COLOR_TEAM3;
+ self.team_forced = FL_TEAM_3;
else if(autocvar_g_forced_team_otherwise == "pink")
- self.team_forced = COLOR_TEAM4;
+ self.team_forced = FL_TEAM_4;
else if(autocvar_g_forced_team_otherwise == "spectate")
self.team_forced = -1;
else if(autocvar_g_forced_team_otherwise == "spectator")
bprint("^4", self.netname, "^4 connected");
if(self.classname != "observer" && (g_domination || g_ctf))
- bprint(" and joined the ", ColoredTeamName(self.team));
+ bprint(" and joined the ", Team_ColoredFullName(self.team));
bprint("\n");
recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - oldrec), "]");
bprint(mynetname, "^7 couldn't break their ", race_placeName(player_prevpos), " place record of ", TIME_ENCODED_TOSTRING(oldrec), recorddifference, "\n");
race_SendStatus(0, e); // "fail"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
return;
} else if (!newpos) { // no ranking, time worse than the worst ranked
recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - race_readTime(GetMapname(), RANKINGS_CNT)), "]");
bprint(mynetname, "^7 couldn't break the ", race_placeName(RANKINGS_CNT), " place record of ", TIME_ENCODED_TOSTRING(race_readTime(GetMapname(), RANKINGS_CNT)), recorddifference, "\n");
race_SendStatus(0, e); // "fail"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
return;
}
bprint(mynetname, "^1 broke ", oldrec_holder, "^1's 1st place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n"));
}
race_SendStatus(3, e); // "new server record"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_SERVER_RECORD, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RECORD, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
} else {
if(newpos == player_prevpos) {
recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]");
bprint(mynetname, "^5 improved their ", race_placeName(newpos), " ^5place record with ", TIME_ENCODED_TOSTRING(t), recorddifference, "\n");
race_SendStatus(1, e); // "new time"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_TIME, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
} else if (oldrec == 0) {
bprint(mynetname, "^2 set the ", race_placeName(newpos), " ^2place record with ", TIME_ENCODED_TOSTRING(t), "\n");
race_SendStatus(2, e); // "new rank"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_RANK, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
} else {
recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]");
bprint(mynetname, "^2 broke ", oldrec_holder, "^2's ", race_placeName(newpos), " ^2place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n"));
race_SendStatus(2, e); // "new rank"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
}
}
}
else
{
+ s = PlayerScore_Add(e, SP_RACE_FASTEST, 0);
+ if(!s || t < s)
+ PlayerScore_Add(e, SP_RACE_FASTEST, t - s);
+
s = PlayerScore_Add(e, SP_RACE_TIME, 0);
snew = TIME_ENCODE(time - game_starttime);
PlayerScore_Add(e, SP_RACE_TIME, snew - s);
Score_NicePrint(world);
race_ClearRecords();
- PlayerScore_Sort(race_place, 1);
+ PlayerScore_Sort(race_place, 0, 1, 0);
entity e;
FOR_EACH_CLIENT(e)
Net_LinkEntity(scores_initialized, FALSE, 0, ScoreInfo_SendEntity);
}
if(teams >= 1)
- TeamScore_Spawn(COLOR_TEAM1, "Red");
+ TeamScore_Spawn(FL_TEAM_1, "Red");
if(teams >= 2)
- TeamScore_Spawn(COLOR_TEAM2, "Blue");
+ TeamScore_Spawn(FL_TEAM_2, "Blue");
if(teams >= 3)
- TeamScore_Spawn(COLOR_TEAM3, "Yellow");
+ TeamScore_Spawn(FL_TEAM_3, "Yellow");
if(teams >= 4)
- TeamScore_Spawn(COLOR_TEAM4, "Pink");
+ TeamScore_Spawn(FL_TEAM_4, "Pink");
}
/*
return TRUE;
}
- void PlayerScore_Clear(entity player)
+ float PlayerScore_Clear(entity player)
{
entity sk;
float i;
if(teamscores_entities_count)
- return;
+ return 0;
- if(g_lms) return;
- if(g_arena || g_ca) return;
- if(g_cts) return; // in CTS, you don't lose score by observing
- if(g_race && g_race_qualifying) return; // in qualifying, you don't lose score by observing
+ if(g_lms) return 0;
+ if(g_arena || g_ca) return 0;
+ if(g_cts) return 0; // in CTS, you don't lose score by observing
+ if(g_race && g_race_qualifying) return 0; // in qualifying, you don't lose score by observing
sk = player.scorekeeper;
for(i = 0; i < MAX_SCORE; ++i)
sk.SendFlags |= pow(2, i);
sk.(scores[i]) = 0;
}
+
+ return 1;
}
void Score_ClearAll()
return out;
}
- float PlayerTeamScore_Compare(entity p1, entity p2, float strict)
+ float PlayerTeamScore_Compare(entity p1, entity p2, float teams, float strict)
{
- if(teamscores_entities_count)
+ if(teams && teamscores_entities_count)
+ {
if(p1.team != p2.team)
{
entity t1, t2;
float r;
t1 = teamscorekeepers[p1.team - 1];
t2 = teamscorekeepers[p2.team - 1];
- r = TeamScore_Compare(t1, t2, strict);
+ r = TeamScore_Compare(t1, t2, ((teams >= 0) ? 1 : strict));
return r;
}
+ if(teams < 0)
+ return 0;
+ }
return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper, strict);
}
- entity PlayerScore_Sort(.float field, float strict)
+ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectators)
{
entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
float i, j;
FOR_EACH_CLIENT(p)
p.field = 0;
- FOR_EACH_PLAYER(p) if(p.scorekeeper)
+ FOR_EACH_CLIENT(p) if(p.scorekeeper)
{
+ if(nospectators)
+ if(p.frags == FRAGS_SPECTATOR)
+ continue;
+
p.chain = plist;
plist = p;
}
pbest = plist;
for(p = plist; (pprev = p), (p = p.chain); )
{
- if(PlayerTeamScore_Compare(p, pbest, strict) > 0)
+ if(PlayerTeamScore_Compare(p, pbest, teams, strict) > 0)
{
pbest = p;
pbestprev = pprev;
pbest.chain = world;
++i;
- if(!plast || PlayerTeamScore_Compare(plast, pbest, 0))
+ if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
j = i;
pbest.field = j;
sk = teamscorekeepers[t - 1];
if(sk)
{
- s = strcat(s, ColoredTeamName(t));
+ s = strcat(s, Team_ColoredFullName(t));
for(i = 0; i < MAX_TEAMSCORE; ++i)
if(teamscores_label[i] != "")
{
++t;
w = bound(6, floor(SCORESWIDTH / t - 1), 9);
- p = PlayerScore_Sort(score_dummyfield, 1);
+ p = PlayerScore_Sort(score_dummyfield, 1, 1, 0);
t = -1;
if(!teamscores_entities_count)