]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'z411/team_queue' into z411/bai-server
authorz411 <z411@omaera.org>
Tue, 6 Jun 2023 07:23:33 +0000 (03:23 -0400)
committerz411 <z411@omaera.org>
Tue, 6 Jun 2023 07:23:33 +0000 (03:23 -0400)
14 files changed:
1  2 
notifications.cfg
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/ent_cs.qc
qcsrc/common/ent_cs.qh
qcsrc/common/notifications/all.inc
qcsrc/common/notifications/all.qh
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/cmd.qc
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh
qcsrc/server/world.qc
xonotic-server.cfg

index f18ab979d9a404e79dacc68e9bc16de265ee6acc,ece7b54a081463b7ce0b65b17507579ab78f9557..c5e9b02c1b159f031f341c2cfb7b55a658cf6d8e
@@@ -544,9 -501,9 +548,10 @@@ seta notification_CENTER_LMS_NOLIVES "1
  seta notification_CENTER_LMS_VISIBLE_LEADER "1" "0 = off, 1 = centerprint"
  seta notification_CENTER_LMS_VISIBLE_OTHER "1" "0 = off, 1 = centerprint"
  seta notification_CENTER_MISSING_PLAYERS "1" "0 = off, 1 = centerprint"
 +seta notification_CENTER_MISSING_READY "1" "0 = off, 1 = centerprint"
  seta notification_CENTER_MISSING_TEAMS "1" "0 = off, 1 = centerprint"
  seta notification_CENTER_MOVETOSPEC_IDLING "1" "0 = off, 1 = centerprint"
+ seta notification_CENTER_MOVETOSPEC_REMOVE "1" "0 = off, 1 = centerprint"
  seta notification_CENTER_NADE_BONUS "1" "0 = off, 1 = centerprint"
  seta notification_CENTER_NADE_THROW "1" "0 = off, 1 = centerprint"
  seta notification_CENTER_NIX_COUNTDOWN "1" "0 = off, 1 = centerprint"
index 5dd075aa248e5398cb0763f988a89b0431ff028b,2b8072245ce9959b0776d58668fb98c5e9416bdc..5342c77c1339b2c4f83d7261fc597f217ee87921
@@@ -122,14 -119,23 +122,20 @@@ void HUD_InfoMessages(
                                                break;
                                }
                                InfoMessage(s);
 -                      }
 +                      }*/
  
 -                      bool mutator_returnvalue = MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize, img_curr_group);
 -                      pos = M_ARGV(0, vector);
 -                      img_curr_group = M_ARGV(2, int);
 +                      //bool mutator_returnvalue = MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize, img_curr_group);
 +                      //pos = M_ARGV(0, vector);
 +                      //img_curr_group = M_ARGV(2, int);
  
-                       s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump"));
 -                      if(!mutator_returnvalue)
++                      if(entcs_GetWantsJoin(current_player))
+                       {
 -                              if(entcs_GetWantsJoin(current_player))
 -                              {
 -                                      int tm = Team_IndexToTeam(entcs_GetWantsJoin(current_player));
 -                                      s = sprintf(_("^2You're queued to join the %s%s^2 team"), Team_ColorCode(tm), Team_ColorName(tm));
 -                              }
 -                              else
 -                                      s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump"));
 -                              InfoMessage(s);
++                              int tm = Team_IndexToTeam(entcs_GetWantsJoin(current_player));
++                              s = sprintf(_("^2You're queued to join the %s%s^2 team"), Team_ColorCode(tm), Team_ColorName(tm));
+                       }
++                      else
++                              s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump"));
 +                      InfoMessage(s);
                }
  
                if (time < STAT(GAMESTARTTIME))
index 329601a0c0d424f17d45709fdfa8eb526cdabce4,fd822d419d62f704f4730f798f8ddd76c6f13745..6982da59e9e2b596ef7f194fd8c977381a50a159
@@@ -1505,17 -1417,16 +1505,26 @@@ vector Scoreboard_DrawOthers(vector ite
                        continue;
                if(pl == ignored_pl)
                        continue;
 -
 +              
 +              string flag_name = "";
 +              vector flag_size = '0 0 0';
 +              Scoreboard_GetField(pl, SP_COUNTRY, autocvar_hud_panel_scoreboard_scores_per_round);
 +              
 +              if(sbt_field_icon3 != "") {
 +                      sz = draw_getimagesize(sbt_field_icon3);
 +                      flag_name = sbt_field_icon3;
 +                      flag_size = vec2(hud_fontsize.x * (sz.x / sz.y), hud_fontsize.y);
 +              }
 +              
+               if(entcs_GetWantsJoin(pl.sv_entnum))
+               {
+                       vector tmcolor = Team_ColorRGB(Team_IndexToTeam(entcs_GetWantsJoin(pl.sv_entnum)));
+                       tmcolor -= tmcolor * sin(2*M_PI*time);
+                       drawstring(pos, "(Q)", hud_fontsize, tmcolor, sbt_fg_alpha, DRAWFLAG_NORMAL);
+                       pos.x += stringwidth("(Q) ", true, hud_fontsize);
+               }
                field = "";
                if(this_team == NUM_SPECTATOR)
                {
index 420b25462e4252dd103451abfe2bbd5026c247e3,30f613af72e1ba4194c9385f8704b58dbf0412e3..3d3f4ebd97f7d52c36bc179f10f96667be4af02c
@@@ -151,15 -151,11 +151,19 @@@ ENTCS_PROP(CLIENTCOLORS, true, clientco
  ENTCS_PROP(FRAGS, true, frags, frags, ENTCS_SET_NORMAL,
        { WriteShort(chan, ent.frags); },
        { ent.frags = ReadShort(); })
 +      
 +ENTCS_PROP(COUNTRYCODE, true, countrycode, countrycode, ENTCS_SET_NORMAL,
 +      { WriteByte(chan, ent.countrycode); },
 +      { ent.countrycode = ReadByte(); })
 +
 +ENTCS_PROP(RANK, true, rank, rank, ENTCS_SET_NORMAL,
 +      { WriteString(chan, ent.rank); },
 +      { strcpy(ent.rank, ReadString()); })
  
+ ENTCS_PROP(WANTSJOIN, true, wants_join, wants_join, ENTCS_SET_NORMAL,
+       { WriteByte(chan, ent.wants_join); },
+       { ent.wants_join = ReadByte(); })
  // use sv_solid to avoid changing solidity state of entcs entities
  ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL,
        { WriteByte(chan, ent.sv_solid); },
Simple merge
index e21d1ac362524934fedf7c31205aeb727ac6f96f,10008a20047761fe1d3670bf4a314a904c5d354c..de640539de3e3c98791002bd3ca9581d2d57a0f9
@@@ -504,9 -423,9 +505,10 @@@ string multiteam_info_sprintf(string in
      MSG_INFO_NOTIF(POWERUP_STRENGTH,                        N_CONSOLE,  1, 0, "s1", "s1",       "strength",       _("^BG%s^K1 picked up Strength"), "")
  
      MSG_INFO_NOTIF(QUIT_DISCONNECT,                         N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 disconnected"), "")
-       MSG_INFO_NOTIF(QUIT_KICK,                               N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked"), "")
-     MSG_INFO_NOTIF(QUIT_KICK_IDLING,                        N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked for idling"), "")
-     MSG_INFO_NOTIF(MOVETOSPEC_IDLING,                       N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was moved to spectator for idling"), "")
++    MSG_INFO_NOTIF(QUIT_KICK,                               N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked"), "")
+     MSG_INFO_NOTIF(QUIT_KICK_IDLING,                        N_CHATCON,  1, 1, "s1 f1", "",      "",             _("^BG%s^F3 was kicked after idling for %s seconds"), "")
+     MSG_INFO_NOTIF(MOVETOSPEC_IDLING,                       N_CHATCON,  1, 1, "s1 f1", "",      "",             _("^BG%s^F3 was moved to^BG spectators^F3 after idling for %s seconds"), "")
+     MSG_INFO_NOTIF(MOVETOSPEC_REMOVE,                       N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was moved to^BG spectators^F3 for balance reasons"), "")
      MSG_INFO_NOTIF(QUIT_KICK_SPECTATING,                    N_CONSOLE,  0, 0, "", "",           "",             _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "")
      MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL,                      N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked for excessive teamkilling"), "")
      MSG_INFO_NOTIF(QUIT_PLAYBAN_TEAMKILL,                   N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was forced to spectate for excessive teamkilling"), "")
  
      MSG_CENTER_NOTIF(TIMEOUT_BEGINNING,                 N_ENABLE,    0, 1, "",               CPID_TIMEOUT,           "1 f1", _("^F4Timeout begins in ^COUNT"), "")
      MSG_CENTER_NOTIF(TIMEOUT_ENDING,                    N_ENABLE,    0, 1, "",               CPID_TIMEIN,            "1 f1", _("^F4Timeout ends in ^COUNT"), "")
 +      MSG_CENTER_NOTIF(TIMEOUT_ONGOING,                   N_ENABLE,    0, 0, "",               CPID_TIMEIN,            "1 f1", _("^F4Match paused"), "")
  
      MSG_CENTER_NOTIF(JOIN_PREVENT_MINIGAME,             N_ENABLE,    0, 0, "",               CPID_Null,              "0 0",  _("^K1Cannot join given minigame session!"), "" )
+     MSG_CENTER_NOTIF(JOIN_PREVENT_QUEUE,                N_ENABLE,    0, 0, "",               CPID_Null,              "0 0",  _("^BGYou are now queued to join the game."), "")
  
      MSG_CENTER_NOTIF(VEHICLE_ENTER,                     N_ENABLE,    0, 0, "pass_key",       CPID_VEHICLES,          "0 0",  _("^BGPress ^F2%s^BG to enter/exit the vehicle"), "")
      MSG_CENTER_NOTIF(VEHICLE_ENTER_GUNNER,              N_ENABLE,    0, 0, "pass_key",       CPID_VEHICLES,          "0 0",  _("^BGPress ^F2%s^BG to enter the vehicle gunner"), "")
Simple merge
index a619d9a077bf2d87bd48617e0effbe2ea2a61cff,2cb7e5cc04ab37517265c4e1861c62bb0c2fc507..6cffde7d3dbbc0b591909280cf30e2f233499cbd
@@@ -424,10 -413,8 +424,12 @@@ void PutObserverInServer(entity this, b
  
        if (CS(this).just_joined)
                CS(this).just_joined = false;
-       
+       if (this.wants_join)
+               this.wants_join = 0;
++
 +      // for RJZ
 +      if (autocvar_rjz_count_shards)
 +              send_TotalShards(this);
  }
  
  int player_getspecies(entity this)
@@@ -1138,14 -1116,11 +1140,15 @@@ void ClientConnect(entity this
        else
                CS(this).allowed_timeouts = autocvar_sv_timeout_number;
  
 -      if (autocvar_sv_eventlog)
 +      if (autocvar_sv_eventlog) {
                GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? GameLog_ProcessIP(this.netaddress) : "bot"), ":", playername(this.netname, this.team, false)));
 +              
 +              /* z411 for RJZ */
 +              if(autocvar_rjz_ranks) GameLogEcho(strcat(":idfp:", ftos(etof(this)), ":", this.crypto_idfp));
 +      }
  
        CS(this).just_joined = true;  // stop spamming the eventlog with additional lines when the client connects
+       this.wants_join = 0;
  
        stuffcmd(this, clientstuff, "\n");
        stuffcmd(this, "cl_particles_reloadeffects\n"); // TODO do we still need this?
@@@ -2042,11 -2028,10 +2056,16 @@@ void Join(entity this
        else
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_JOIN_PLAY, this.netname);
        this.team_selected = false;
 +      
 +      // z411
 +      // send constant ready notification
 +      if(warmup_stage)
 +              Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MISSING_READY);
++
+       this.wants_join = 0;
+       if(queued_join)
+               Join(queued_join);
  }
  
  int GetPlayerLimit()
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge