]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into TimePath/scoreboard_elo
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 13 Jun 2016 05:39:36 +0000 (15:39 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 13 Jun 2016 07:03:04 +0000 (17:03 +1000)
# Conflicts:
# qcsrc/client/hud/panel/score.qc
# qcsrc/server/mutators/events.qh
# qcsrc/server/scores.qc
# qcsrc/server/scores.qh

29 files changed:
1  2 
.gitlab-ci.yml
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/scoreboard.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/playerstats.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_damage.qh
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qh
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/race.qh
qcsrc/server/scores.qc
qcsrc/server/scores.qh
qcsrc/server/scores_rules.qc

diff --cc .gitlab-ci.yml
index 2e13641a06b69d0bd6e52a5c70d5510def66516c,3cdd43f30510917818e9a8ab0b4365574d83d84d..df7e8e28ad3fa9fc2b9e8aaca9f7ff02d9ce417a
@@@ -24,7 -24,7 +24,7 @@@ test_sv_game
      - wget -O data/maps/g-23.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.cache
      - wget -O data/maps/g-23.waypoints.hardwired https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.hardwired
      - make
-     - EXPECT=814b0e609bcf01dc2a44f2b17fa366b4
 -    - EXPECT=4bd5b0276cdd100c831c73f0400eca71
++    - EXPECT=f05b0d5a3aa761c72406d4d2b47dba86
      - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
        | tee /dev/stderr
        | grep '^:'
Simple merge
Simple merge
index 094182fa13fd0f5f3dceed3912768338527af828,b07b84ed33f8001c34779cea4a7bddd9d4db5813..c2fc694d64b2f99b740f6ad4e4258bcb57c0c656
@@@ -164,11 -168,11 +168,11 @@@ void HUD_Score(
                pl = players.sort_next;
                if(pl == me)
                        pl = pl.sort_next;
 -              if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
 -                      if(pl.scores[ps_primary] == 0)
 +              if(scores_flags(ps_primary) & SFL_ZERO_IS_WORST)
 +                      if(pl.scores(ps_primary) == 0)
-                               pl = world;
+                               pl = NULL;
  
 -              score = me.(scores[ps_primary]);
 +              score = me.(scores(ps_primary));
                timer = TIME_ENCODED_TOSTRING(score);
  
                draw_beginBoldFont();
Simple merge
Simple merge
index 78846d69c78acf0f04dc2f6045a861b45055356b,2fb239ba10e21932239c8463d1d48c7dd6fd00c6..518d1653ef2adf83f2be0d2fb79952dced64809e
@@@ -251,11 -254,11 +251,13 @@@ void Cmd_HUD_Help(
        LOG_INFO(_("^2scoreboard_columns_set default\n"));
        LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
        LOG_INFO(_("The following field names are recognized (case insensitive):\n"));
--      LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields.\n\n"));
++      LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields.\n"));
++      LOG_INFO("\n");
  
        LOG_INFO(_("^3name^7 or ^3nick^7             Name of a player\n"));
        LOG_INFO(_("^3ping^7                     Ping time\n"));
        LOG_INFO(_("^3pl^7                       Packet loss\n"));
++      LOG_INFO(_("^3elo^7                      Player ELO\n"));
        LOG_INFO(_("^3kills^7                    Number of kills\n"));
        LOG_INFO(_("^3deaths^7                   Number of deaths\n"));
        LOG_INFO(_("^3suicides^7                 Number of suicides\n"));
        LOG_INFO(_("^3takes^7                    Number of domination points taken (DOM)\n"));
        LOG_INFO(_("^3bckills^7                  Number of ball carrier kills\n"));
        LOG_INFO(_("^3bctime^7                   Total amount of time holding the ball in Keepaway\n"));
--      LOG_INFO(_("^3score^7                    Total score\n\n"));
++      LOG_INFO(_("^3score^7                    Total score\n"));
++      LOG_INFO("\n");
  
        LOG_INFO(_("Before a field you can put a + or - sign, then a comma separated list\n"
                "of game types, then a slash, to make the field show up only in these\n"
index 18241145a16b4cdea113e90140ec703693357c4e,2c529827098ca7d6f28e2f20ff1d8cbc51285e23..b35d8488319d805b34e6e3ca8c4b0fff4e955134
@@@ -2243,10 -2250,10 +2248,10 @@@ spawnfunc(onslaught_generator
  // scoreboard setup
  void ons_ScoreRules()
  {
-       CheckAllowedTeams(world);
+       CheckAllowedTeams(NULL);
        ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, 0, true);
        ScoreInfo_SetLabel_TeamScore  (ST_ONS_CAPS,     "destroyed", SFL_SORT_PRIO_PRIMARY);
 -      ScoreInfo_SetLabel_PlayerScore(SP_ONS_CAPS,     "caps",      SFL_SORT_PRIO_SECONDARY);
 +      ScoreInfo_SetLabel_PlayerScore(SP_ONS_CAPS,    "caps",      SFL_SORT_PRIO_SECONDARY);
        ScoreInfo_SetLabel_PlayerScore(SP_ONS_TAKES,    "takes",     0);
        ScoreRules_basics_end();
  }
Simple merge
Simple merge
Simple merge
Simple merge
index 2bb634ddabceb4c709ed6ff65ca301dae38a5273,6fbce15b95a8658b80749138d3dfcc6e2dd8079b..6c3c8c1b7b31d4457aa7e4c1d047c88f90ce016e
@@@ -759,11 -748,11 +748,11 @@@ MUTATOR_HOOKABLE(CheckRules_World, EV_C
  MUTATOR_HOOKABLE(WantWeapon, EV_WantWeapon);
  
  #define EV_AddPlayerScore(i, o) \
-     /**/ i(entity, score_field) \
-     /**/ i(float, ret_float) \
-     /**/ o(float, ret_float) \
 -    /** score field */  i(int, MUTATOR_ARGV_0_int) \
++    /** score field */  i(PlayerScoreField, MUTATOR_ARGV_0_entity) \
+     /** score */        i(float, MUTATOR_ARGV_1_float) \
+     /**/                o(float, MUTATOR_ARGV_1_float) \
+     /** player */       i(entity, MUTATOR_ARGV_2_entity) \
      /**/
- PlayerScoreField score_field;
  MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore);
  
  #define EV_GetPlayerStatus(i, o) \
index c697e46b276864895385391c367aa0bcd511910f,938cdd748bd60be5aebc661e36bd64fa868d7184..8fd215b097d08fa7af513a569199b176f93a3a59
@@@ -59,9 -59,10 +59,9 @@@ void(entity this, float ratingscale, ve
  
  // scoreboard stuff
  const float ST_ASSAULT_OBJECTIVES = 1;
 -const float SP_ASSAULT_OBJECTIVES = 4;
  
  // predefined spawnfuncs
- void target_objective_decrease_activate();
+ void target_objective_decrease_activate(entity this);
  #endif
  
  #ifdef IMPLEMENTATION
index 199f5bc586f72d415344756fd27d12970ef99cb8,70a2c040bf80ca91c4889ae8a6b27eac6b907d85..86ce54bc8e18d979d1cfb0b861b9c8d632f9745d
@@@ -2532,15 -2544,15 +2544,15 @@@ spawnfunc(team_neutralobelisk)       { spawnf
  // scoreboard setup
  void ctf_ScoreRules(int teams)
  {
-       CheckAllowedTeams(world);
+       CheckAllowedTeams(NULL);
        ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
        ScoreInfo_SetLabel_TeamScore  (ST_CTF_CAPS,     "caps",      SFL_SORT_PRIO_PRIMARY);
 -      ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS,     "caps",      SFL_SORT_PRIO_SECONDARY);
 -      ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME,  "captime",   SFL_LOWER_IS_BETTER | SFL_TIME);
 -      ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS,  "pickups",   0);
 -      ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS,  "fckills",   0);
 -      ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS,  "returns",   0);
 -      ScoreInfo_SetLabel_PlayerScore(SP_CTF_DROPS,    "drops",     SFL_LOWER_IS_BETTER);
 +      ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS,    "caps",      SFL_SORT_PRIO_SECONDARY);
 +      ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME, "captime",   SFL_LOWER_IS_BETTER | SFL_TIME);
 +      ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS, "pickups",   0);
 +      ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS, "fckills",   0);
 +      ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS, "returns",   0);
 +      ScoreInfo_SetLabel_PlayerScore(SP_CTF_DROPS,   "drops",     SFL_LOWER_IS_BETTER);
        ScoreRules_basics_end();
  }
  
index aa4ab5f9682b57936ac641146dfd2c772230eef2,adfd6eb6a76648b90ddb9f0b33413ec3dae01038..a869827937573d7d852e9b92680ad33f4e1b5831
@@@ -379,9 -392,8 +388,8 @@@ MUTATOR_HOOKFUNCTION(lms, GetPlayerStat
  MUTATOR_HOOKFUNCTION(lms, AddPlayerScore)
  {
        if(gameover)
-       if(score_field == SP_LMS_RANK)
 -      if(M_ARGV(0, int) == SP_LMS_RANK) // score field
++      if(M_ARGV(0, entity) == SP_LMS_RANK) // score field
                return true; // allow writing to this field in intermission as it is needed for newly joining players
-       return false;
  }
  
  // scoreboard stuff
Simple merge
index 59c76513d524c3be9cb991aa2f346fb439d2ef5e,aa108dd985d9622e167a3db2649d08fec0dfc0d4..c66d23ca7c887d10a43dda357177f70ec2b0453c
@@@ -61,7 -65,7 +61,7 @@@ bool TeamScore_SendEntity(entity this, 
  
        longflags = 0;
        for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
-               if(self.(teamscores(i)) > 127 || self.(teamscores(i)) <= -128)
 -              if(this.(teamscores[i]) > 127 || this.(teamscores[i]) <= -128)
++              if(this.(teamscores(i)) > 127 || this.(teamscores(i)) <= -128)
                        longflags |= p;
  
  #if MAX_TEAMSCORE <= 8
@@@ -75,9 -79,9 +75,9 @@@
                if(sendflags & p)
                {
                        if(longflags & p)
-                               WriteInt24_t(MSG_ENTITY, self.(teamscores(i)));
 -                              WriteInt24_t(MSG_ENTITY, this.(teamscores[i]));
++                              WriteInt24_t(MSG_ENTITY, this.(teamscores(i)));
                        else
-                               WriteChar(MSG_ENTITY, self.(teamscores(i)));
 -                              WriteChar(MSG_ENTITY, this.(teamscores[i]));
++                              WriteChar(MSG_ENTITY, this.(teamscores(i)));
                }
  
        return true;
@@@ -225,28 -230,31 +225,28 @@@ void ScoreInfo_Init(float teams
  
  bool PlayerScore_SendEntity(entity this, entity to, float sendflags)
  {
 -      float i, p, longflags;
 -
        WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES);
-       WriteByte(MSG_ENTITY, etof(self.owner));
+       WriteByte(MSG_ENTITY, etof(this.owner));
  
 -      longflags = 0;
 -      for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
 -              if(this.(scores[i]) > 127 || this.(scores[i]) <= -128)
 +      int longflags = 0;
 +      FOREACH(Scores, true, {
 +          int p = 1 << (i % 16);
-               if (self.(scores(it)) > 127 || self.(scores(it)) <= -128)
++              if (this.(scores(it)) > 127 || this.(scores(it)) <= -128)
                        longflags |= p;
 +    });
  
 -#if MAX_SCORE <= 8
 -      WriteByte(MSG_ENTITY, sendflags);
 -      WriteByte(MSG_ENTITY, longflags);
 -#else
        WriteShort(MSG_ENTITY, sendflags);
        WriteShort(MSG_ENTITY, longflags);
 -#endif
 -      for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
 -              if(sendflags & p)
 +      FOREACH(Scores, true, {
 +          int p = 1 << (i % 16);
 +              if (sendflags & p)
                {
                        if(longflags & p)
-                               WriteInt24_t(MSG_ENTITY, self.(scores(it)));
 -                              WriteInt24_t(MSG_ENTITY, this.(scores[i]));
++                              WriteInt24_t(MSG_ENTITY, this.(scores(it)));
                        else
-                               WriteChar(MSG_ENTITY, self.(scores(it)));
 -                              WriteChar(MSG_ENTITY, this.(scores[i]));
++                              WriteChar(MSG_ENTITY, this.(scores(it)));
                }
 +    });
  
        return true;
  }
@@@ -315,13 -328,13 +315,13 @@@ void PlayerScore_Detach(entity player
        if(!player.scorekeeper)
                error("player has no scorekeeper");
        remove(player.scorekeeper);
-       player.scorekeeper = world;
+       player.scorekeeper = NULL;
  }
  
 -float PlayerScore_Add(entity player, float scorefield, float score)
 +float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
  {
-       bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score);
-       score = ret_float;
+       bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score, player);
+       score = M_ARGV(1, float);
  
        if(gameover)
        if(!mutator_returnvalue)
index 3e553f4d813b5b6396a133eef6e32c790dfc4e11,a462bde92c4bed31f706262a2314b43a5c3ff8f0..cf767659056d5f9cef2a39ae063d18a5923c8c5e
@@@ -2,7 -2,9 +2,7 @@@
  
  #include <common/constants.qh>
  
- entity scores_initialized; // non-world when scores labels/rules have been set
+ entity scores_initialized; // non-NULL when scores labels/rules have been set
 -.float scores[MAX_SCORE];
 -.float teamscores[MAX_TEAMSCORE];
  .float scoreboard_pos;
  
  /**
Simple merge