From: z411 Date: Tue, 6 Jun 2023 07:23:33 +0000 (-0400) Subject: Merge branch 'z411/team_queue' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9138fcd172d7369fa7f0d88c66b2969f578b54b3;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'z411/team_queue' into z411/bai-server --- 9138fcd172d7369fa7f0d88c66b2969f578b54b3 diff --cc notifications.cfg index f18ab979d,ece7b54a0..c5e9b02c1 --- a/notifications.cfg +++ b/notifications.cfg @@@ -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" diff --cc qcsrc/client/hud/panel/infomessages.qc index 5dd075aa2,2b8072245..5342c77c1 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@@ -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)) diff --cc qcsrc/client/hud/panel/scoreboard.qc index 329601a0c,fd822d419..6982da59e --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -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) { diff --cc qcsrc/common/ent_cs.qc index 420b25462,30f613af7..3d3f4ebd9 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@@ -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); }, diff --cc qcsrc/common/notifications/all.inc index e21d1ac36,10008a200..de640539d --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@@ -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"), "") @@@ -886,9 -801,9 +890,10 @@@ 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"), "") diff --cc qcsrc/server/client.qc index a619d9a07,2cb7e5cc0..6cffde7d3 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@@ -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()