From: z411 Date: Thu, 1 Jun 2023 03:13:06 +0000 (-0400) Subject: Merge branch 'master' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dae2c5bf0bc7bcbd2d980dd7ba048a09b237c008;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into z411/bai-server --- dae2c5bf0bc7bcbd2d980dd7ba048a09b237c008 diff --cc gamemodes-server.cfg index dd57d5b31,01d297e08..113d8c285 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@@ -613,25 -616,22 +622,44 @@@ set g_duel_not_dm_maps 0 "when this is // ============================== // free for all and team mayhem // ============================== ++<<<<<<< HEAD +set g_mayhem 0 "Mayhem: Compete for the most damage dealt and frags in this chaotic mayhem!" +set g_tmayhem 0 "Team Mayhem: Compete with your team for the most damage dealt and frags in this chaotic mayhem!" + +set g_mayhem_scoringmethod 1 "1: By default 25% of the score is based on kills and 75% of it is based on damage. 2: 100% frags. 3: 100% damage." +set g_tmayhem_scoringmethod 1 "1: By default 25% of the score is based on kills and 75% of it is based on damage. 2: 100% frags. 3: 100% damage." +set g_mayhem_scoringmethod_1_damage_weight 0.75 "for the first scoring method how much is damage equal to player's spawning health worth in score" +set g_tmayhem_scoringmethod_1_damage_weight 0.75 "for the first scoring method how much is damage equal to player's spawning health worth in score" +set g_mayhem_scoringmethod_1_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding" +set g_tmayhem_scoringmethod_1_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding" +set g_mayhem_scoringmethod_1_frag_weight 0.25 "for the first scoring method how much is a frag worth in score" +set g_tmayhem_scoringmethod_1_frag_weight 0.25 "for the first scoring method how much is a frag worth in score" + +set g_mayhem_fraglimit 30 "Team Mayhem basis for how many frags until the match ends, edit this over point_limit preferably" +set g_tmayhem_fraglimit 50 "Team Mayhem basis for how many frags until the match ends, edit this over point_limit preferably" + +set g_mayhem_visual_score_limit 1000 "Mayhem visual score limit overriding the mapinfo specified one" +set g_tmayhem_visual_score_limit 1000 "Team Mayhem visual score limit overriding the mapinfo specified one" + +set g_tmayhem_score_leadlimit -1 "Team Mayhem score lead limit(based on tmayhem_visual_score_limit, not tmayhem_fraglimit) overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" ++======= + set g_mayhem 0 "Mayhem: Compete for the most damage dealt and kills in this chaotic mayhem!" + set g_tmayhem 0 "Team Mayhem: Compete with your team for the most damage dealt and kills in this chaotic mayhem!" + + set g_mayhem_scoring_upscaler 20 "upscale one frag's worth to be this amount of in score" + set g_tmayhem_scoring_upscaler 20 "upscale one frag's worth to be this amount of in score" + set g_mayhem_scoring_kill_weight 0.25 "how much is a kill worth in frags" + set g_tmayhem_scoring_kill_weight 0.25 "how much is a kill worth in frags" + set g_mayhem_scoring_damage_weight 0.75 "how much is damage equal to player's spawning health+armor worth in frags" + set g_tmayhem_scoring_damage_weight 0.75 "how much is damage equal to player's spawning health+armor worth in frags" + set g_mayhem_scoring_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding" + set g_tmayhem_scoring_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding" + + set g_mayhem_point_limit -1 "Mayhem score limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" + set g_mayhem_point_leadlimit -1 "Mayhem score lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" + set g_tmayhem_point_limit -1 "Team Mayhem score limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" + set g_tmayhem_point_leadlimit -1 "Team Mayhem score lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)" ++>>>>>>> master set g_mayhem_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" set g_tmayhem_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" diff --cc qcsrc/client/hud/hud.qh index 9534b8601,312aaea99..be15ac3ae --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@@ -278,7 -277,7 +280,8 @@@ REGISTER_HUD_PANEL(ITEMSTIME, HUD REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // QUICKMENU REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD REGISTER_HUD_PANEL(STRAFEHUD, HUD_StrafeHUD, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // STRAFEHUD + REGISTER_HUD_PANEL(PICKUP, HUD_Pickup, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PICKUP +REGISTER_HUD_PANEL(SPECTHUD, HUD_SpectHUD, PANEL_CONFIG_NO | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // SPECTHUD // always add new panels to the end of list // Because calling lots of functions in QC apparently cuts fps in half on many machines: diff --cc qcsrc/client/hud/panel/quickmenu.qc index 8147467bd,0f3425203..435ebc537 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@@ -88,15 -102,21 +102,24 @@@ bool QuickMenu_Open(string mode, strin if(mode == "") { - if(file == "" || file == "0") - mode = "default"; - else + if(autocvar__hud_panel_quickmenu_file_from_server) + { mode = "file"; + file = autocvar__hud_panel_quickmenu_file_from_server; + } + else + mode = "default"; } + if(mode == "default") + { + if (autocvar_hud_panel_quickmenu_server_is_default && autocvar__hud_panel_quickmenu_file_from_server != "") + { + mode = "file"; + file = autocvar__hud_panel_quickmenu_file_from_server; + } + } + if(mode == "file") { if(file == "" || file == "0") diff --cc qcsrc/client/hud/panel/scoreboard.qc index 99e1b901a,f8b302b98..bca88712d --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -117,11 -106,16 +117,19 @@@ float autocvar_hud_panel_scoreboard_min bool autocvar_hud_panel_scoreboard_playerid = false; string autocvar_hud_panel_scoreboard_playerid_prefix = "#"; string autocvar_hud_panel_scoreboard_playerid_suffix = " "; + bool autocvar_hud_panel_scoreboard_scores_per_round; + +int average_ping[NUM_TEAMS]; +int total_weapons; + float scoreboard_time; + SHUTDOWN(scoreboard) + { + if(autocvar_hud_panel_scoreboard_scores_per_round) + cvar_set("hud_panel_scoreboard_scores_per_round", "0"); + } + // mode 0: returns translated label // mode 1: prints name and description of all the labels string Label_getInfo(string label, int mode) @@@ -731,13 -734,13 +749,13 @@@ void Cmd_Scoreboard_Help( // otherwise the previous exclusive rule warns anyway // e.g. -teams,rc,cts,lms/kills ?+rc/kills #define SCOREBOARD_DEFAULT_COLUMNS \ -"ping pl fps name |" \ +"ping pl fps cn name |" \ - " -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \ - " -teams,lms/deaths +ft,tdm/deaths" \ + " -teams,rc,cts,inv,lms/kills +ft,tdm,tmayhem/kills ?+rc,inv/kills" \ + " -teams,lms/deaths +ft,tdm,tmayhem/deaths" \ " +tdm/sum" \ - " -teams,lms,rc,cts,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \ - " -cts,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \ - " +tdm,ft,dom,ons,as/teamkills"\ + " -teams,lms,rc,cts,inv,ka/suicides +ft,tdm,tmayhem/suicides ?+rc,inv/suicides" \ + " -cts,dm,tdm,ka,ft,mayhem,tmayhem/frags" /* tdm already has this in "score" */ \ + " +tdm,ft,dom,ons,as,tmayhem/teamkills"\ " -rc,cts,nb/dmg -rc,cts,nb/dmgtaken" \ " +ctf/pickups +ctf/fckills +ctf/returns +ctf/caps +ons/takes +ons/caps" \ " +lms/lives +lms/rank" \ @@@ -989,36 -981,26 +1007,41 @@@ string Scoreboard_GetName(entity pl sbt_field_icon2_rgb = colormapPaletteColor(f % 16, 1); } } - return entcs_GetName(pl.sv_entnum); + if(entcs_GetRank(pl.sv_entnum) != "") + return strcat(entcs_GetRank(pl.sv_entnum), "^7 ", entcs_GetName(pl.sv_entnum)); + else + return entcs_GetName(pl.sv_entnum); +} + +//LegendGuard adds GetCountrycode function 05-04-2021 +string Scoreboard_GetCountrycode(entity pl) +{ + int ccode = entcs_GetCountryCode(pl.sv_entnum); + if(ccode) + sbt_field_icon3 = strcat("gfx/flags/", ftos(ccode)); + else + sbt_field_icon3 = strcat("gfx/flags/", ftos(0)); //if user hasn't assigned country flag + + return ""; - //return ftos(entcs_GetCountryCode(pl.sv_entnum)); //returns a number } - vector getPingColor(float f) - { - if(f < 80) { - // 20-80 range is green - return '0 1 0' + '1 0 1' * max(0, min(60, f-20)) / 60; - } else { - // 80-300 range is red - return '1 1 1' - '0 1 1' * max(0, min(220, f-80)) / 220; - } - } - string Scoreboard_GetField(entity pl, PlayerScoreField field) + int autocvar_hud_panel_scoreboard_ping_best = 0; + int autocvar_hud_panel_scoreboard_ping_medium = 70; + int autocvar_hud_panel_scoreboard_ping_high = 100; + int autocvar_hud_panel_scoreboard_ping_worst = 150; + vector autocvar_hud_panel_scoreboard_ping_best_color = '0 1 0'; + vector autocvar_hud_panel_scoreboard_ping_medium_color = '1 1 0'; + vector autocvar_hud_panel_scoreboard_ping_high_color = '1 0.5 0'; + vector autocvar_hud_panel_scoreboard_ping_worst_color = '1 0 0'; + #define PING_BEST autocvar_hud_panel_scoreboard_ping_best + #define PING_MED autocvar_hud_panel_scoreboard_ping_medium + #define PING_HIGH autocvar_hud_panel_scoreboard_ping_high + #define PING_WORST autocvar_hud_panel_scoreboard_ping_worst + #define COLOR_BEST autocvar_hud_panel_scoreboard_ping_best_color + #define COLOR_MED autocvar_hud_panel_scoreboard_ping_medium_color + #define COLOR_HIGH autocvar_hud_panel_scoreboard_ping_high_color + #define COLOR_WORST autocvar_hud_panel_scoreboard_ping_worst_color + string Scoreboard_GetField(entity pl, PlayerScoreField field, bool per_round) { float tmp, num, denom; int f; @@@ -1461,16 -1422,12 +1514,16 @@@ vector Scoreboard_DrawOthers(vector ite if(this_team == NUM_SPECTATOR) { if(autocvar_hud_panel_scoreboard_spectators_showping) - field = Scoreboard_GetField(pl, SP_PING); + field = Scoreboard_GetField(pl, SP_PING, autocvar_hud_panel_scoreboard_scores_per_round); } else if(autocvar_hud_panel_scoreboard_others_showscore) - field = Scoreboard_GetField(pl, SP_SCORE); + field = Scoreboard_GetField(pl, SP_SCORE, autocvar_hud_panel_scoreboard_scores_per_round); - string str = entcs_GetName(pl.sv_entnum); + string str; + if(entcs_GetRank(pl.sv_entnum) != "") + str = strcat(entcs_GetRank(pl.sv_entnum), "^7 ", entcs_GetName(pl.sv_entnum)); + else + str = entcs_GetName(pl.sv_entnum); if (autocvar_hud_panel_scoreboard_playerid) str = Scoreboard_AddPlayerId(str, pl); str = textShortenToWidth(str, namesize, hud_fontsize, stringwidth_colors); @@@ -2826,10 -2363,12 +2879,13 @@@ void Scoreboard_Draw( str = strcat(str, Scoreboard_Fraglimit_Draw(ll, true)); } } + drawcolorcodedstring(pos + '1 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align right // map name and player count - str = sprintf(_("^5%d^7/^5%d ^7players"), numplayers, srv_maxplayers ? srv_maxplayers : maxclients); + if (campaign) + str = ""; + else + str = sprintf(_("^5%d^7/^5%d ^7players"), numplayers, srv_maxplayers ? srv_maxplayers : maxclients); str = strcat("^7", _("Map:"), " ^2", mi_shortname, " ", str); // reusing "Map:" translatable string drawcolorcodedstring(pos, str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align left } diff --cc qcsrc/client/hud/panel/timer.qc index ac4cb4c4c,269d12b5e..c5ba1f526 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@@ -71,20 -70,10 +72,11 @@@ void HUD_Timer( vector timer_color = '1 1 1'; vector subtimer_color = '1 1 1'; bool swap = (autocvar_hud_panel_timer_secondary == 2 && STAT(ROUNDSTARTTIME)); + float timeout_last = STAT(TIMEOUT_LAST); // Use real or frozen time and get the time limit - if(intermission_time) - curtime = intermission_time; - else if(timeout_last) - curtime = timeout_last; - else - curtime = time; - - if(warmup_stage) - timelimit = STAT(WARMUP_TIMELIMIT); - else - timelimit = STAT(TIMELIMIT) * 60; + curtime = (intermission_time ? intermission_time : time); + timelimit = (warmup_stage ? STAT(WARMUP_TIMELIMIT) : STAT(TIMELIMIT) * 60); // Calculate time left timeleft = HUD_Timer_TimeLeft(curtime, STAT(GAMESTARTTIME), timelimit); @@@ -93,60 -82,26 +85,50 @@@ if(!intermission_time && !warmup_stage && timelimit > 0) timer_color = HUD_Timer_Color(timeleft); ++<<<<<<< HEAD + // countdown sound + // if 3 use server dictated option, otherwise the client's + int countdown_type; + if(autocvar_cl_timer_countdown == 3) + countdown_type = sv_timer_countdown; + else + countdown_type = autocvar_cl_timer_countdown; + + if(countdown_type && !warmup_stage && timeleft > 0 && timeleft != last_timeleft && timeleft <= 10 && !intermission_time) + { + if(countdown_type == 1 || (countdown_type == 2 && spectatee_status)) + sound(NULL, CH_INFO, SND_ENDCOUNT, VOL_BASE, ATTN_NONE); + + last_timeleft = timeleft; + } + // Timer text - if (warmup_stage && timelimit == -1) - { - // Lock timer in infinite warmup - if (autocvar_hud_panel_timer_increment) - timer = 0; - else - timer = STAT(TIMELIMIT) * 60; - } + if (autocvar_hud_panel_timer_increment || timelimit <= 0) + timer = HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME)); else - { - if (autocvar_hud_panel_timer_increment || timelimit <= 0) - timer = HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME)); - else - timer = timeleft; - } + timer = timeleft; // Secondary timer for round-based game modes if(STAT(ROUNDSTARTTIME) && autocvar_hud_panel_timer_secondary) { if(STAT(ROUNDSTARTTIME) == -1) { // Round can't start - subtimer = "--:--"; + subtimer_str = "--:--"; subtimer_color = '1 0 0'; } else { - float round_curtime, round_timelimit, round_timeleft; + float round_curtime, round_endtime, round_timelimit, round_timeleft; // Use real or frozen time and get the time limit - round_curtime = (game_stopped_time ? game_stopped_time : time); + round_endtime = STAT(ROUNDENDTIME); round_timelimit = STAT(ROUND_TIMELIMIT); + if(round_endtime) + round_curtime = round_endtime; + else if(timeout_last) + round_curtime = timeout_last; + else + round_curtime = time; + // Calculate time left round_timeleft = HUD_Timer_TimeLeft(round_curtime, STAT(ROUNDSTARTTIME), round_timelimit); diff --cc qcsrc/common/ent_cs.qh index bd76c6b6b,aa689e59d..a1db8340b --- a/qcsrc/common/ent_cs.qh +++ b/qcsrc/common/ent_cs.qh @@@ -131,20 -130,8 +131,20 @@@ REGISTER_NET_TEMP(CLIENT_ENTCS string entcs_GetName(int i) { entity e = entcs_receiver(i); - return ColorTranslateRGB(e ? e.netname : getplayerkeyvalue(i, "name")); + return e ? ColorTranslateRGB(e.netname) : ""; } + + int entcs_GetCountryCode(int i) + { + entity e = entcs_receiver(i); + return e.countrycode; + } + + string entcs_GetRank(int i) + { + entity e = entcs_receiver(i); + return e.rank; + } /** * @param i zero indexed player diff --cc qcsrc/common/items/inventory.qh index 5ebaea9be,118b7079d..c17f9391a --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@@ -38,13 -37,9 +38,10 @@@ STATIC_INIT(Inventory #endif #ifdef CSQC - #include + #include -Inventory g_inventory; +//Inventory g_inventory; +Inventory inventoryslots[255]; - float last_pickup_timer; - entity last_pickup_item; - int last_pickup_times; void Inventory_remove(entity this) { @@@ -197,23 -149,23 +183,32 @@@ bool Inventory_customize(entity this, e void Inventory_new(PlayerState this) { Inventory inv = NEW(Inventory); - setcefc(inv, Inventory_customize); + inv.owner = this; this.inventory = inv; - inv.owner = this; - Net_LinkEntity(inv, false, 0, Inventory_Send); + + if(!g_duel) { + setcefc(inv, Inventory_customize); + Net_LinkEntity(inv, false, 0, Inventory_Send); + } } + void Inventory_delete(entity e) { delete(e.inventory); } -void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; } +void Inventory_update(entity e) +{ + if(g_duel) + Inventory_Broadcast(e.inventory); + else + e.inventory.SendFlags = 0xFFFFFF; +} + void Inventory_pickupitem(Pickup this, entity player) + { + //LOG_DEBUGF("entity %i picked up %s", player, this.m_name); + entity store = IS_PLAYER(player) ? PS(player) : player; + ++store.inventory.inv_items[this.m_id]; + Inventory_update(store); + } + void Inventory_clear(entity store) { // NOTE: you will need to perform Inventory_update after this to update the storage entity diff --cc qcsrc/common/monsters/sv_monsters.qc index a0f201950,7d644fa36..0fa01b815 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@@ -32,13 -32,14 +32,14 @@@ void monsters_setstatus(entity this) { - STAT(MONSTERS_TOTAL, this) = monsters_total; - STAT(MONSTERS_KILLED, this) = monsters_killed; + //STAT(MONSTERS_TOTAL, this) = monsters_total; + //STAT(MONSTERS_KILLED, this) = monsters_killed; } + bool autocvar_g_monsters_drop = true; void monster_dropitem(entity this, entity attacker) { - if(!this.candrop || !this.monster_loot) + if(!this.candrop || !this.monster_loot || !autocvar_g_monsters_drop) return; vector org = CENTER_OR_VIEWOFS(this); diff --cc qcsrc/common/net_linked.qh index a3429bf32,f9e40965b..79cd6c4fe --- a/qcsrc/common/net_linked.qh +++ b/qcsrc/common/net_linked.qh @@@ -7,12 -7,8 +7,13 @@@ REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN) REGISTER_NET_TEMP(TE_CSQC_SERVERWELCOME) REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP) + REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP) +REGISTER_NET_TEMP(TE_CSQC_TEAMNAMES) +REGISTER_NET_TEMP(TE_CSQC_CHATSOUND) +REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP) +REGISTER_NET_TEMP(TE_CSQC_TOTALSHARDS) // for RJZ + const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder const int RACE_NET_CHECKPOINT_CLEAR = 1; const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder diff --cc qcsrc/common/notifications/all.inc index d2a37fa69,effed26d9..e21d1ac36 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@@ -501,11 -422,11 +504,12 @@@ 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_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(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_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_INFO_NOTIF(QUIT_SPECTATE, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 is now^BG spectating"), "") MSG_INFO_NOTIF(RACE_ABANDONED, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^BG has abandoned the race"), "") diff --cc qcsrc/server/.world.qh.kate-swp index 000000000,000000000..f6ef71ebd new file mode 100644 Binary files differ diff --cc qcsrc/server/chat.qc index 33a2e406f,5a72b5977..62307cc15 --- a/qcsrc/server/chat.qc +++ b/qcsrc/server/chat.qc @@@ -3,7 -3,7 +3,8 @@@ #include #include #include +#include + #include #include #include #include @@@ -324,11 -351,12 +359,14 @@@ int Say(entity source, int teamsay, ent sprint(source, sourcemsgstr); dedicated_print(msgstr); // send to server console too FOREACH_CLIENT(!(IS_PLAYER(it) || INGAME(it)) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { + if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command) + continue; // no sending to this player, thank you very much + sprint(it, msgstr); }); - event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin)); + + if(!play_chatsound(source, msgin)) + event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin)); } else { @@@ -338,11 -366,12 +376,14 @@@ MX_Say(strcat(playername(source.netname, source.team, IS_PLAYER(source)), "^7: ", msgin)); } FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { + if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command) + continue; // no sending to this player, thank you very much + sprint(it, msgstr); }); - event_log_msg = sprintf(":chat:%d:%s", source.playerid, strreplace("\n", " ", msgin)); + + if(!play_chatsound(source, msgin)) + event_log_msg = sprintf(":chat:%d:%s", source.playerid, strreplace("\n", " ", msgin)); } } diff --cc qcsrc/server/command/banning.qc index b38b13510,933eb3c83..8547ccc7b --- a/qcsrc/server/command/banning.qc +++ b/qcsrc/server/command/banning.qc @@@ -308,13 -462,16 +505,17 @@@ void BanCommand_(int request // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;) #define BAN_COMMANDS(request, arguments, command) \ - BAN_COMMAND("ban", BanCommand_ban(request, arguments, command), "Ban an IP address or a range of addresses (like 1.2.3)") \ - BAN_COMMAND("banlist", BanCommand_banlist(request), "List all existing bans") \ - BAN_COMMAND("kickkick", BanCommand_kickkick(request, arguments, command), "Disconnect a client") \ - BAN_COMMAND("kickban", BanCommand_kickban(request, arguments, command), "Disconnect a client and ban it at the same time") \ - BAN_COMMAND("mute", BanCommand_mute(request, arguments, command), "Disallow a client from talking by muting them") \ - BAN_COMMAND("unban", BanCommand_unban(request, arguments), "Remove an existing ban") \ - BAN_COMMAND("unmute", BanCommand_unmute(request, arguments), "Unmute a client") \ + BAN_COMMAND("ban", BanCommand_ban(request, arguments, command), "Ban an IP address or a range of addresses (like 1.2.3)") \ + BAN_COMMAND("banlist", BanCommand_banlist(request), "List all existing bans") \ ++ BAN_COMMAND("kickkick", BanCommand_kickkick(request, arguments, command), "Disconnect a client") \ + BAN_COMMAND("kickban", BanCommand_kickban(request, arguments, command), "Disconnect a client and ban it at the same time") \ + BAN_COMMAND("mute", BanCommand_mute(request, arguments, command), "Disallow a client from talking by muting them") \ + BAN_COMMAND("playban", BanCommand_playban(request, arguments, command), "Force to spectate a client permanently") \ + BAN_COMMAND("unban", BanCommand_unban(request, arguments), "Remove an existing ban") \ + BAN_COMMAND("unmute", BanCommand_unmute(request, arguments), "Unmute a client") \ + BAN_COMMAND("unvoteban", BanCommand_unvoteban(request, arguments), "Remove an existing voting ban") \ + BAN_COMMAND("unplayban", BanCommand_unplayban(request, arguments), "Remove an existing forced to spectate ban") \ + BAN_COMMAND("voteban", BanCommand_voteban(request, arguments, command), "Disallow a client from voting") \ /* nothing */ void BanCommand_macro_help() diff --cc qcsrc/server/command/cmd.qc index d75299dfe,f93880a68..6bb6f6157 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@@ -373,28 -454,20 +454,20 @@@ void ClientCommand_ready(entity caller { case CMD_REQUEST_COMMAND: { - if (IS_CLIENT(caller) && caller.last_ready < time - 3) + if (warmup_stage || g_race_qualifying == 2) + if (IS_PLAYER(caller) || INGAME_JOINED(caller)) { - if (warmup_stage || g_race_qualifying == 2) + if (caller.ready) // toggle { - if (time < game_starttime) // game is already restarting - return; - if (caller.ready) // toggle - { - caller.ready = false; - if (IS_PLAYER(caller) || INGAME_JOINED(caller)) - bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n"); - } - else - { - caller.ready = true; - if (IS_PLAYER(caller) || INGAME_JOINED(caller)) - bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ready\n"); - } - - caller.last_ready = time; - ReadyCount(); + caller.ready = false; + bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n"); + } + else + { + caller.ready = true; - bprint(playername(caller.netname, caller.team, false), "^2 is ready\n"); ++ bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ready\n"); } + ReadyCount(); } return; // never fall through to usage } diff --cc qcsrc/server/command/vote.qc index 88cfa743f,02cb8e1ce..f1ff50931 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@@ -219,13 -226,9 +226,13 @@@ void VoteCount(float first_count Nagger_VoteCountChanged(); // add up all the votes from each connected client - FOREACH_CLIENT(IS_REAL_CLIENT(it) || autocvar_sv_vote_debug, { + FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_CLIENT(it), { + // z411 + if(vote_target_type == VOTE_TARGET_TEAM && it.team != vote_caller.team) continue; + if(vote_target_type == VOTE_TARGET_SINGLE && it != vote_target) continue; + ++vote_player_count; - if (IS_PLAYER(it)) ++vote_real_player_count; + if (IS_PLAYER(it) || INGAME(it)) ++vote_real_player_count; switch (it.vote_selection) { case VOTE_SELECT_REJECT: @@@ -491,9 -483,8 +496,9 @@@ void ReadyRestart_force(bool is_fake_ro FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; }); } + round_handler_Activate(!warmup_stage); if (!sv_ready_restart_after_countdown || warmup_stage) - reset_map(true, is_fake_round_start); + reset_map(is_fake_round_start); if (autocvar_sv_eventlog) GameLogEcho(":restart"); } diff --cc qcsrc/server/command/vote.qh index 58baa24b0,509d4d233..63f624870 --- a/qcsrc/server/command/vote.qh +++ b/qcsrc/server/command/vote.qh @@@ -45,17 -41,15 +46,17 @@@ const float VOTE_TARGET_SINGLE = 2 // global vote information declarations entity vote_caller; // original caller of the current vote string vote_caller_name; // name of the vote caller - float vote_called; // stores status of current vote (See VOTE_*) + int vote_called; // stores status of current vote (See VOTE_*) float vote_endtime; // time when the vote is finished - float vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function) - float vote_reject_count; // same as above, but rejected - float vote_abstain_count; // same as above, but abstained - float vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor) + int vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function) + int vote_reject_count; // same as above, but rejected + int vote_abstain_count; // same as above, but abstained + int vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor) +float vote_target_type; // z411 +entity vote_target; // z411 - .float vote_master; // flag for if the player has vote master privelages + .bool vote_master; // flag for if the player has vote master privileges .float vote_waittime; // flag for how long the player must wait before they can vote again - .float vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*) + .int vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*) string vote_called_command; // command sent by client string vote_called_display; // visual string of command sent by client string vote_parsed_command; // command which is fixed after being parsed diff --cc qcsrc/server/items/items.qc index ab5dc4825,57720ef9a..0ae811024 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@@ -545,15 -530,10 +548,22 @@@ bool Item_GiveTo(entity item, entity pl { pickedup = true; FOREACH(Weapons, it != WEP_Null, { ++<<<<<<< HEAD + Weapon wep = it; + + if(w & (wep.m_wepset)) { + // z411 Seriously find a better way to do this + Item_NotifyWeapon(player, wep.m_id); + FOREACH_CLIENT(IS_SPEC(it) && it.enemy == player, { Item_NotifyWeapon(it, wep.m_id); }); + } + + if(wp & (wep.m_wepset)) ++======= + if(w & (it.m_wepset)) + Item_NotifyWeapon(player, it.m_id); + + if(wp & (it.m_wepset)) ++>>>>>>> master { for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { diff --cc qcsrc/server/world.qc index d0595fa18,a4b69e247..527c34e2e --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@@ -406,21 -388,15 +415,21 @@@ void cvar_changes_init( BADCVAR("g_spawn_alloweffects"); BADCVAR("g_tdm_point_leadlimit"); BADCVAR("g_tdm_point_limit"); - BADCVAR("g_mayhem_fraglimit"); - BADCVAR("g_tmayhem_fraglimit"); - BADCVAR("g_mayhem_visual_score_limit"); - BADCVAR("g_tmayhem_visual_score_limit"); - BADCVAR("g_tmayhem_score_leadlimit"); + BADCVAR("g_mayhem_point_limit"); + BADCVAR("g_mayhem_point_leadlimit"); + BADCVAR("g_tmayhem_point_limit"); + BADCVAR("g_tmayhem_point_leadlimit"); BADCVAR("leadlimit_and_fraglimit"); BADCVAR("leadlimit_override"); + BADCVAR("g_mayhem_scoringmethod"); + BADCVAR("g_mayhem_scoringmethod_damage_weight"); + BADCVAR("g_mayhem_scoringmethod_frag_weight"); + BADCVAR("g_tmayhem_scoringmethod"); + BADCVAR("g_tmayhem_scoringmethod_damage_weight"); + BADCVAR("g_tmayhem_scoringmethod_frag_weight"); BADCVAR("pausable"); BADCVAR("sv_announcer"); + BADCVAR("sv_autopause"); BADCVAR("sv_checkforpacketsduringsleep"); BADCVAR("sv_damagetext"); BADCVAR("sv_db_saveasdump"); @@@ -1093,14 -1056,10 +1100,18 @@@ spawnfunc(worldspawn WinningConditionHelper(this); // set worldstatus + round_handler_Activate(!warmup_stage); + + // for RJZ + if (autocvar_rjz_count_shards && warmup_stage) { + total_shards = -2; + send_TotalShardsAll(); + } + + if (autocvar_sv_autopause && server_is_dedicated && !wantrestart) + // INITPRIO_LAST is to soon: bots either didn't join yet or didn't leave yet, see: bot_fixcount() + defer(this, 5, Pause_TryPause_Dedicated); + world_initialized = 1; __spawnfunc_spawn_all(); } @@@ -1380,10 -1339,8 +1391,10 @@@ void NextLevel( */ //pos = FindIntermission (); + + sound(NULL, CH_INFO, SND_ENDMATCH, VOL_BASE, ATTN_NONE); - VoteReset(); + VoteReset(true); DumpStats(true); @@@ -2254,13 -2121,12 +2265,14 @@@ void readlevelcvars( serverflags &= ~SERVERFLAG_ALLOW_FULLBRIGHT; if(cvar("sv_allow_fullbright")) serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT; + if(cvar("sv_forbid_pickuptimer")) + serverflags |= SERVERFLAG_FORBID_PICKUPTIMER; - sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown"); + serverflags &= ~SERVERFLAG_FORBID_PICKUPTIMER; + if(cvar("sv_forbid_pickuptimer")) + serverflags |= SERVERFLAG_FORBID_PICKUPTIMER; - warmup_stage = cvar("g_warmup"); - warmup_limit = cvar("g_warmup_limit"); + sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown"); if(cvar("g_campaign")) warmup_stage = 0; // no warmup during campaign diff --cc qcsrc/server/world.qh index 06e454bc9,ff799e64c..1631d18b7 --- a/qcsrc/server/world.qh +++ b/qcsrc/server/world.qh @@@ -30,13 -31,8 +31,18 @@@ float autocvar_timelimit_suddendeath bool autocvar_sv_gameplayfix_droptofloorstartsolid; bool autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect; ++<<<<<<< HEAD +// z411 +bool autocvar_sv_jingle_end; +string autocvar_sv_jingle_end_list; +float autocvar_sv_jingle_end_volume; + +float fragsleft; +int fragsleft_last; ++======= + bool autocvar_sv_mapformat_is_quake3; + bool autocvar_sv_mapformat_is_quake2; ++>>>>>>> master float checkrules_equality; float checkrules_suddendeathwarning;