]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Rename SendWelcomemessage_msg_type to SendWelcomeMessage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index fd2c2cc55439e8dd09d8c2d3cf61f68e23d79f7d..512f61ad231ae5d4255ec197a7b4d0667416220a 100644 (file)
@@ -208,6 +208,13 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
                WriteString(MSG_ENTITY, teamscores_label(i));
                WriteByte(MSG_ENTITY, teamscores_flags(i));
        }
+       // prevent sending the welcome message again when score types are sent again because the scoring system has changed
+       // it can happen in some game modes like Race when the qualyfing session ends and the race starts
+       bool welcome_msg_too = (!CS(to) || time < CS(to).jointime + 5);
+       WriteByte(MSG_ENTITY, welcome_msg_too);
+       // welcome message is sent here because it needs to know the gametype
+       if (welcome_msg_too)
+               SendWelcomeMessage(to, MSG_ENTITY);
        return true;
 }
 
@@ -434,6 +441,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 +564,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";