X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qc;h=ac3f52c72f446fb29ec0074d9eb43dfe6d2bbe9f;hp=821c378a84388d3dc941b708a02064f715a4386a;hb=765eed8d356d25d15047202838dc58db8cb80b89;hpb=fc2121c7b6bb647429c05ea185f37d3417f5ae2f diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 821c378a84..ac3f52c72f 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -130,7 +130,7 @@ float TeamScore_AddToTeam(int t, float scorefield, float score) } if(score) if(teamscores_label(scorefield) != "") - s.SendFlags |= (2 ** scorefield); + s.SendFlags |= BIT(scorefield); return (s.(teamscores(scorefield)) += score); } @@ -194,6 +194,7 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags) } } +int Welcomemessage_too = 1; bool ScoreInfo_SendEntity(entity this, entity to, int sf) { float i; @@ -208,6 +209,15 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf) WriteString(MSG_ENTITY, teamscores_label(i)); WriteByte(MSG_ENTITY, teamscores_flags(i)); } + WriteByte(MSG_ENTITY, Welcomemessage_too); + // for some reason ScoreInfo_SendEntity is called twice on client connection + // send the welcome message only once + if (Welcomemessage_too) + { + // welcome message is sent here because it needs to know the gametype + SendWelcomemessage_msg_type(this, false, MSG_ENTITY); + Welcomemessage_too = 0; + } return true; } @@ -277,7 +287,7 @@ float PlayerScore_Clear(entity player) FOREACH(Scores, true, { if(sk.(scores(it)) != 0) if(scores_label(it) != "") - sk.SendFlags |= (2 ** (i % 16)); + sk.SendFlags |= BIT(i % 16); if(i != SP_ELO.m_id) sk.(scores(it)) = 0; }); @@ -295,7 +305,7 @@ void Score_ClearAll() FOREACH(Scores, true, { if(sk.(scores(it)) != 0) if(scores_label(it) != "") - sk.SendFlags |= (2 ** (i % 16)); + sk.SendFlags |= BIT(i % 16); if(i != SP_ELO.m_id) sk.(scores(it)) = 0; }); @@ -309,7 +319,7 @@ void Score_ClearAll() { if(sk.(teamscores(j)) != 0) if(teamscores_label(j) != "") - sk.SendFlags |= (2 ** j); + sk.SendFlags |= BIT(j); sk.(teamscores(j)) = 0; } } @@ -357,7 +367,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score) return s.(scores(scorefield)); } if(scores_label(scorefield) != "") - s.SendFlags |= (2 ** (scorefield.m_id % 16)); + s.SendFlags |= BIT(scorefield.m_id % 16); if(!warmup_stage) PlayerStats_GameReport_Event_Player(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score); s.(scores(scorefield)) += score; @@ -382,7 +392,7 @@ float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score) return oldscore; if(scores_label(scorefield) != "") - s.SendFlags |= (2 ** (scorefield.m_id % 16)); + s.SendFlags |= BIT(scorefield.m_id % 16); s.(scores(scorefield)) = score; return s.(scores(scorefield)); } @@ -434,6 +444,7 @@ void WinningConditionHelper(entity this) s = strcat(s, ":P", ftos(cvar_purechanges_count)); s = strcat(s, ":S", ftos(nJoinAllowed(this, NULL))); s = strcat(s, ":F", ftos(serverflags)); + s = strcat(s, ":T", sv_termsofservice_url_escaped); s = strcat(s, ":M", modname); s = strcat(s, "::", GetPlayerScoreString(NULL, (fullstatus ? 1 : 2))); @@ -556,12 +567,12 @@ void WinningConditionHelper(entity this) { s = GetPlayerScoreString(it, 1); s = strcat(s, IS_REAL_CLIENT(it) ? ":human" : ":bot"); - if(!IS_PLAYER(it) && !MUTATOR_CALLHOOK(GetPlayerStatus, it)) + if(!(IS_PLAYER(it) || INGAME_JOINED(it))) s = strcat(s, ":spectator"); } else { - if (IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it)) + if (IS_PLAYER(it) || INGAME_JOINED(it)) s = GetPlayerScoreString(it, 2); else s = "-666";