]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'z411/hide_invalid_ranks' into 'master'
authorterencehill <piuntn@gmail.com>
Wed, 23 Feb 2022 17:31:48 +0000 (17:31 +0000)
committerterencehill <piuntn@gmail.com>
Wed, 23 Feb 2022 17:31:48 +0000 (17:31 +0000)
Show invalid ranks as N/A

Closes #2604

See merge request xonotic/xonotic-data.pk3dir!982

qcsrc/common/minigames/sv_minigames.qc
qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.qc
qcsrc/menu/xonotic/dialog_termsofservice.qc
qcsrc/menu/xonotic/mainwindow.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/clientkill.qc
qcsrc/server/command/sv_cmd.qc
xonotic-server.cfg

index a1fb3631dd8b4c634787b8a93c855b5934ab8de3..57f6f46b6153570fe0b4c276875d07664191b539 100644 (file)
@@ -148,7 +148,7 @@ int minigame_addplayer(entity minigame_session, entity player)
                Net_LinkEntity(player_pointer, false, 0, minigame_SendEntity);
 
                if ( !IS_OBSERVER(player) && autocvar_sv_minigames_observer )
-                       PutObserverInServer(player, true);
+                       PutObserverInServer(player, true, true);
                if ( autocvar_sv_minigames_observer == 2 )
                        Player_SetForcedTeamIndex(player, TEAM_FORCE_SPECTATOR);
 
index f9ea1ef33e8ff2cc5fb139190dbd48eb80ec493d..7ff09655a39fdbdc6ca2ba03b8b4e98f12c48f04 100644 (file)
@@ -88,7 +88,6 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
                {
                        ToSSpecified = true;
                        string downloadurl = v;
-                       LOG_INFOF("SERVERTOS DOWNLOADURL: %s", downloadurl);
                        if (downloadurl == "INVALID")
                        {
                                me.ToSTab.textBox.setText(me.ToSTab.textBox, _("No Terms of Service specified"));
index 39ffaa43c37eccb0832247d6fc121a41bb757bb0..0fec38a892fd3f5b2eef54802320c642c753e677 100644 (file)
@@ -86,7 +86,6 @@ void XonoticToSDialog_fill(entity me)
        me.TR(me);
        me.TR(me);
                me.TD(me, me.rows - 4, me.columns, me.textBox = makeXonoticTextBox());
-               me.loadXonoticToS(me);
 
        me.TR(me);
        me.gotoRC(me, me.rows - 1, 0);
index 4aa974835a58da15959f2d79e5b7be34d9324e0d..f5d2aca98e8c622028ff506228b05af6b0a8305c 100644 (file)
@@ -61,7 +61,10 @@ void MainWindow_draw(entity me)
 
        if (me.firstDraw) {
                if (me.ToSDialog.shouldShow())
+               {
+                       me.ToSDialog.loadXonoticToS(me.ToSDialog);
                        DialogOpenButton_Click_withCoords(NULL, me.ToSDialog, '0 0 0', eX * conwidth + eY * conheight);
+               }
                else if(me.firstRunDialog.shouldShow())
                        DialogOpenButton_Click_withCoords(NULL, me.firstRunDialog, '0 0 0', eX * conwidth + eY * conheight);
                
index 06139566d85ad6a50c30af6d3f09d19a3eca418d..f7c5b3f41d732e634ee7eb02974ed32408e1a48d 100644 (file)
@@ -437,11 +437,10 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                        }
                }
        }
-       
+
        if(un_tosversion != "")
        {
                _Nex_ExtResponseSystem_NewToS = stof(un_tosversion);
-               LOG_INFOF("Latest ToS version is %d", _Nex_ExtResponseSystem_NewToS);
        }
 
        if(un_bannedservers != "")
index daabb84c9cc9e9ee10bb6a4371cd73d4d39185f6..3af147c21374c52f3cec6aa3cc2e3c1d09b432f0 100644 (file)
@@ -235,7 +235,7 @@ void setplayermodel(entity e, string modelname)
 }
 
 /** putting a client as observer in the server */
-void PutObserverInServer(entity this, bool is_forced)
+void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint)
 {
        bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this, is_forced);
        PlayerState_detach(this);
@@ -257,12 +257,18 @@ void PutObserverInServer(entity this, bool is_forced)
                entcs_update_players(this);
        }
 
-       entity spot = SelectSpawnPoint(this, true);
-       if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
-       this.angles = vec2(spot.angles);
+       if (use_spawnpoint)
+       {
+               entity spot = SelectSpawnPoint(this, true);
+               if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
+               this.angles = vec2(spot.angles);
+               // offset it so that the spectator spawns higher off the ground, looks better this way
+               setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
+       }
+       else // change origin to restore previous view origin
+               setorigin(this, this.origin + STAT(PL_VIEW_OFS, this) - STAT(PL_CROUCH_VIEW_OFS, this));
        this.fixangle = true;
-       // offset it so that the spectator spawns higher off the ground, looks better this way
-       setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
+
        if (IS_REAL_CLIENT(this))
        {
                msg_entity = this;
@@ -809,6 +815,7 @@ void PutClientInServer(entity this)
        if (game_stopped)
                TRANSMUTE(Observer, this);
 
+       bool use_spawnpoint = (!this.enemy); // check this.enemy here since SetSpectatee will clear it
        SetSpectatee(this, NULL);
 
        // reset player keys
@@ -818,7 +825,7 @@ void PutClientInServer(entity this)
        MUTATOR_CALLHOOK(PutClientInServer, this);
 
        if (IS_OBSERVER(this)) {
-               PutObserverInServer(this, false);
+               PutObserverInServer(this, false, use_spawnpoint);
        } else if (IS_PLAYER(this)) {
                PutPlayerInServer(this);
        }
@@ -1797,7 +1804,7 @@ bool SpectateSet(entity this)
        accuracy_resend(this);
 
        if(!SpectateUpdate(this))
-               PutObserverInServer(this, false);
+               PutObserverInServer(this, false, true);
 
        return true;
 }
@@ -2300,7 +2307,7 @@ void ObserverOrSpectatorThink(entity this)
                                TRANSMUTE(Observer, this);
                                PutClientInServer(this);
                        } else if(!SpectateUpdate(this) && !SpectateNext(this)) {
-                               PutObserverInServer(this, false);
+                               PutObserverInServer(this, false, true);
                                this.would_spectate = true;
                        }
                }
@@ -2326,7 +2333,7 @@ void ObserverOrSpectatorThink(entity this)
                        }
                }
                if(is_spec && !SpectateUpdate(this))
-                       PutObserverInServer(this, false);
+                       PutObserverInServer(this, false, true);
        }
        if (is_spec)
                this.flags |= FL_CLIENT | FL_NOTARGET;
@@ -2697,7 +2704,7 @@ void PlayerPostThink (entity this)
                                if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
                                {
                                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname, maxidle_time);
-                                       PutObserverInServer(this, true);
+                                       PutObserverInServer(this, true, true);
                                }
                                else
                                {
index 8f7b9c4f3224be1655e2b73cdaa5553e62f7957f..cca687aeb6d2447293171adebd68dc49ca180353 100644 (file)
@@ -385,7 +385,7 @@ bool Spectate(entity this, entity pl);
 
 void ClientInit_Spawn();
 
-void PutObserverInServer(entity this, bool is_forced);
+void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint);
 
 void SetSpectatee(entity this, entity spectatee);
 void SetSpectatee_status(entity this, int spectatee_num);
index 474f15af1e5f4ca7da6ee0c70c942c430cdbcf34..296a95bfe5f384c9d8428626f0a1cbd0282fff2f 100644 (file)
@@ -25,7 +25,7 @@ void ClientKill_Now_TeamChange(entity this)
        {
                if (blockSpectators)
                        Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
-               PutObserverInServer(this, false);
+               PutObserverInServer(this, false, true);
        }
        else
        {
index ca6b268e23708a51b5fdb000e295fa4226512657..e09458f79a1ab1590a7186a14cadf1fbc1c343fe 100644 (file)
@@ -191,7 +191,7 @@ void GameCommand_allspec(int request, int argc)
                        string reason = argv(1);
                        int n = 0;
                        FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
-                               PutObserverInServer(it, true);
+                               PutObserverInServer(it, true, true);
                                ++n;
                        });
                        if (n)   bprint(strcat("Successfully forced all (", ftos(n), ") players to spectate", (reason ? strcat(" for reason: '", reason, "'") : ""), ".\n"));
@@ -1016,7 +1016,7 @@ void GameCommand_moveplayer(int request, int argc)
                                                string pl_name = playername(client.netname, client.team, false);
                                                if (!IS_SPEC(client) && !IS_OBSERVER(client))
                                                {
-                                                       PutObserverInServer(client, true);
+                                                       PutObserverInServer(client, true, true);
 
                                                        successful = strcat(successful, (successful ? ", " : ""), pl_name);
                                                }
index 0f374902a0b86be3fceab9e67128f7e2afd18479..0be38b30360e850b6eea517b65ea13520558e978 100644 (file)
@@ -344,6 +344,7 @@ sv_curl_defaulturl "http://www.xonotic.org/contentdownload/getmap.php?file="
 set sv_curl_serverpackages_auto 1 "automatically add packs with *.serverpackage files to sv_curl_serverpackages"
 
 set sv_motd "" "additional information to show on the welcome screen that greets joining players"
+set sv_termsofservice_url "" "URL from which Server specific Terms of Service should be downloaded"
 
 set g_waypoints_for_items 0 "make waypoints out of items, values: 0 = never, 1 = unless the mapper prevents it by worldspawn.spawnflags & 1, 2 = always"