From: z411 Date: Tue, 12 Oct 2021 02:19:58 +0000 (-0300) Subject: Merge branch 'master' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=11ca2927d0211a1b845dff0ee00fe3f302d8adcd;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into z411/bai-server --- 11ca2927d0211a1b845dff0ee00fe3f302d8adcd diff --cc qcsrc/client/hud/panel/centerprint.qh index 903ba9619,a143fa0a2..1a1ce172d --- a/qcsrc/client/hud/panel/centerprint.qh +++ b/qcsrc/client/hud/panel/centerprint.qh @@@ -3,8 -3,8 +3,8 @@@ bool autocvar_hud_panel_centerprint; float autocvar_hud_panel_centerprint_align; - //float autocvar_hud_panel_centerprint_fade_in = 0.2; - float autocvar_hud_panel_centerprint_fade_out = 0.5; -float autocvar_hud_panel_centerprint_fade_in = 0.15; ++//float autocvar_hud_panel_centerprint_fade_in = 0.15; + float autocvar_hud_panel_centerprint_fade_out = 0.15; float autocvar_hud_panel_centerprint_fade_subsequent = 1; float autocvar_hud_panel_centerprint_fade_subsequent_passone = 3; float autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha = 0.5; diff --cc qcsrc/client/hud/panel/chat.qc index c87afc36c,07de3b7dd..863394825 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@@ -92,10 -90,11 +94,12 @@@ void HUD_Chat( if (autocvar_con_chat != floor(mySize.y / autocvar_con_chatsize - 0.5)) cvar_set("con_chat", ftos(floor(mySize.y / autocvar_con_chatsize - 0.5))); + vector chatsize = '1 1 0' * autocvar_con_chatsize; if(autocvar__hud_configure) { - cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such + vector chatsize = '1 1 0' * autocvar_con_chatsize; + if (cvar_string("con_chatrect_x") != "9001") + cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors); for(int i = 0; i < autocvar_con_chat; ++i) { diff --cc qcsrc/client/hud/panel/scoreboard.qc index a17855ac2,b3d24e59d..fe6ba1498 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -2026,8 -1558,10 +2040,11 @@@ vector Scoreboard_MapStats_Draw(vector panel_size.x += panel_bg_padding * 2; // restore initial width return end_pos; } +*/ + int rankings_rows = 0; + int rankings_columns = 0; + int rankings_cnt = 0; vector Scoreboard_Rankings_Draw(vector pos, string ranktitle, entity pl, vector rgb, vector bg_size) { int i; @@@ -2543,8 -2056,12 +2596,14 @@@ void Scoreboard_Draw( pos = Scoreboard_MakeTable(pos, tm, panel_bg_color, bg_size); } + pos = Scoreboard_MedalStats_Draw(pos); + + // draw scoreboard spectators before accuracy and item stats + if (autocvar_hud_panel_scoreboard_spectators_position == 0) { + pos = Scoreboard_Spectators_Draw(pos); + } + + // draw accuracy and item stats if (Scoreboard_AccuracyStats_WouldDraw(pos.y)) pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size); if (Scoreboard_ItemStats_WouldDraw(pos.y)) diff --cc qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index 26219ec92,abdfe030e..f2f6b39e2 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@@ -282,20 -227,6 +282,12 @@@ MUTATOR_HOOKFUNCTION(ca, reset_map_play return true; } +MUTATOR_HOOKFUNCTION(ca, Scores_CountFragsRemaining) +{ + // announce remaining frags + return true; +} + - MUTATOR_HOOKFUNCTION(ca, ClientConnect) - { - entity player = M_ARGV(0, entity); - - TRANSMUTE(Observer, player); - return true; - } - MUTATOR_HOOKFUNCTION(ca, reset_map_global) { allowed_to_spawn = true; diff --cc qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qh index 3f59c932d,75bfeefd4..6f70f09be --- a/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qh @@@ -1,2 -1,5 +1,1 @@@ #pragma once - -int autocvar_hud_panel_modicons_freezetag_layout; -- -void HUD_Mod_FreezeTag_Export(int fh); diff --cc qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh index 00082fd61,6fdd693cc..705553d90 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh @@@ -46,4 -46,4 +49,5 @@@ float autocvar_g_freezetag_revive_speed float autocvar_g_freezetag_revive_time_to_score = 1.5; bool autocvar_g_freezetag_revive_nade; float autocvar_g_freezetag_revive_nade_health; +bool autocvar_g_freezetag_revive_respawn; + float autocvar_g_freezetag_revive_spawnshield = 1; diff --cc qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 0eadfaef8,7b85e7384..c38f475d0 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@@ -256,10 -325,10 +325,10 @@@ void buff_Think(entity this WaypointSprite_UpdateBuildFinished(this.buff_waypoint, time + this.buff_activetime - frametime); } - this.oldbuffs = STAT(BUFFS, this); + this.oldbuffs = this.buffdef; } - if(!game_stopped) + if(!game_stopped && !game_timeout) if((round_handler_IsActive() && round_handler_IsRoundStarted()) || time >= game_starttime) if(!this.buff_activetime_updated) { @@@ -630,10 -810,10 +810,10 @@@ MUTATOR_HOOKFUNCTION(buffs, PlayerUseKe MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon) { - if(MUTATOR_RETURNVALUE || game_stopped) return; + if(MUTATOR_RETURNVALUE || game_stopped || game_timeout) return; entity player = M_ARGV(0, entity); - if(STAT(BUFFS, player) & BUFF_SWAPPER.m_itemid) + if(StatusEffects_active(BUFF_SWAPPER, player)) { float best_distance = autocvar_g_buffs_swapper_range; entity closest = NULL; @@@ -786,9 -939,10 +939,10 @@@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreTh { entity player = M_ARGV(0, entity); - if(game_stopped || IS_DEAD(player) || !IS_PLAYER(player)) return; + if(game_stopped || game_timeout || IS_DEAD(player) || frametime || !IS_PLAYER(player)) return; - if(STAT(BUFFS, player) & BUFF_FLIGHT.m_itemid) + // NOTE: this is kept here to ensure crouches are picked up each player movement frame + if(StatusEffects_active(BUFF_FLIGHT, player)) { if(!PHYS_INPUT_BUTTON_CROUCH(player)) player.buff_flight_crouchheld = false; diff --cc qcsrc/common/notifications/all.inc index 0c04e84e0,f1b2af8e6..bf776a8f1 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@@ -479,18 -402,17 +484,18 @@@ string multiteam_info_sprintf(string in MULTITEAM_INFO(ONSLAUGHT_GENDESTROYED, N_CONSOLE, 0, 0, "", "", "", _("^TC^TT^BG generator has been destroyed"), "", GENERATOR) MULTITEAM_INFO(ONSLAUGHT_GENDESTROYED_OVERTIME, N_CONSOLE, 0, 0, "", "", "", _("^TC^TT^BG generator spontaneously combusted due to overtime!"), "", GENERATOR) - MSG_INFO_NOTIF(POWERUP_INVISIBILITY, N_CONSOLE, 1, 0, "s1", "s1", "strength", _("^BG%s^K1 picked up Invisibility"), "") - MSG_INFO_NOTIF(POWERUP_SHIELD, N_CONSOLE, 1, 0, "s1", "s1", "shield", _("^BG%s^K1 picked up Shield"), "") - MSG_INFO_NOTIF(POWERUP_SPEED, N_CONSOLE, 1, 0, "s1", "s1", "shield", _("^BG%s^K1 picked up Speed"), "") - MSG_INFO_NOTIF(POWERUP_STRENGTH, N_CONSOLE, 1, 0, "s1", "s1", "strength", _("^BG%s^K1 picked up Strength"), "") + MSG_INFO_NOTIF(POWERUP_INVISIBILITY, N_CONSOLE, 1, 0, "s1", "s1", "buff_invisible", _("^BG%s^K1 picked up Invisibility"), "") + MSG_INFO_NOTIF(POWERUP_SHIELD, N_CONSOLE, 1, 0, "s1", "s1", "shield", _("^BG%s^K1 picked up Shield"), "") + MSG_INFO_NOTIF(POWERUP_SPEED, N_CONSOLE, 1, 0, "s1", "s1", "buff_speed", _("^BG%s^K1 picked up Speed"), "") + 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_SPECTATE, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 is now spectating"), "") + 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"), "") MSG_INFO_NOTIF(RACE_FAIL_RANKED, N_CONSOLE, 1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1 f3race_time", "race_newfail", _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s"), "") diff --cc qcsrc/common/stats.qh index 576279112,463d98c85..249d4c69a --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@@ -73,14 -78,6 +78,13 @@@ float W_WeaponRateFactor(entity this) float game_stopped; float game_starttime; //point in time when the countdown to game start is over float round_starttime; //point in time when the countdown to round start is over +float overtime_starttime; // z411 point in time where first overtime started + +float checkrules_overtimesadded; // z411 add +float timeout_last; +float timeout_total_time; +bool game_timeout; + - bool autocvar_g_allow_oldvortexbeam; int autocvar_leadlimit; // TODO: world.qh can't be included here due to circular includes! #define autocvar_fraglimit cvar("fraglimit") @@@ -90,16 -87,9 +94,12 @@@ #endif REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) REGISTER_STAT(GAME_STOPPED, int, game_stopped) + +REGISTER_STAT(TIMEOUT_LAST, float, timeout_last) + REGISTER_STAT(GAMESTARTTIME, float, game_starttime) - REGISTER_STAT(STRENGTH_FINISHED, float) - REGISTER_STAT(INVINCIBLE_FINISHED, float) /** arc heat in [0,1] */ REGISTER_STAT(PRESSED_KEYS, int) - /** this stat could later contain some other bits of info, like, more server-side particle config */ - REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool, autocvar_g_allow_oldvortexbeam) REGISTER_STAT(FUEL, int) REGISTER_STAT(NB_METERSTART, float) /** compressShotOrigin */ @@@ -123,15 -112,12 +122,20 @@@ REGISTER_STAT(VEHICLESTAT_AMMO2, int REGISTER_STAT(VEHICLESTAT_RELOAD2, int) REGISTER_STAT(VEHICLESTAT_W2MODE, int) REGISTER_STAT(NADE_TIMER, float) -REGISTER_STAT(SECRETS_TOTAL, int, secrets_total) -REGISTER_STAT(SECRETS_FOUND, int, secrets_found) +//REGISTER_STAT(SECRETS_TOTAL, int, secrets_total) +//REGISTER_STAT(SECRETS_FOUND, int, secrets_found) REGISTER_STAT(RESPAWN_TIME, float) REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime) ++<<<<<<< HEAD +REGISTER_STAT(OVERTIMESTARTTIME, float, overtime_starttime) +REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded) +//REGISTER_STAT(MONSTERS_TOTAL, int) +//REGISTER_STAT(MONSTERS_KILLED, int) +REGISTER_STAT(BUFFS, int) ++======= + REGISTER_STAT(MONSTERS_TOTAL, int) + REGISTER_STAT(MONSTERS_KILLED, int) ++>>>>>>> master REGISTER_STAT(NADE_BONUS, float) REGISTER_STAT(NADE_BONUS_TYPE, int) REGISTER_STAT(NADE_BONUS_SCORE, float) diff --cc qcsrc/server/client.qc index 4ac79f00e,2cf6f95f6..d9b893fda --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@@ -1081,20 -1042,15 +1067,16 @@@ string getwelcomemessage(entity this modifications = strcat(modifications, ", Weapons stay"); if(autocvar_g_jetpack) modifications = strcat(modifications, ", Jet pack"); - if(autocvar_g_powerups == 0) - modifications = strcat(modifications, ", No powerups"); - if(autocvar_g_powerups > 0) - modifications = strcat(modifications, ", Powerups"); modifications = substring(modifications, 2, strlen(modifications) - 2); - string versionmessage = GetClientVersionMessage(this); - string s = strcat(versionmessage, "^8\n^8\nserver is ^9", autocvar_hostname, "^8\n"); + //string versionmessage = GetClientVersionMessage(this); + //string s = strcat(versionmessage, "^8\n^9", (autocvar_hostname_full ? autocvar_hostname_full : autocvar_hostname)); + string s = (autocvar_hostname_full != "" ? autocvar_hostname_full : autocvar_hostname); - s = strcat(s, "^8\nmatch type is ^1", gamemode_name, "^8\n"); + s = strcat(s, "^8\n^7", gamemode_name); if(modifications != "") - s = strcat(s, "^8\nactive modifications: ^3", modifications, "^8\n"); + s = strcat(s, "^7 | ^3", modifications); if(cache_lastmutatormsg != autocvar_g_mutatormsg) { diff --cc qcsrc/server/command/cmd.qc index b433508a5,a8a8747e1..961059738 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@@ -836,9 -815,8 +836,9 @@@ void ClientCommand_(entity caller, int CLIENT_COMMAND("say_team", ClientCommand_say_team(ent, request, arguments, command), "Print a message to chat to all team mates") \ CLIENT_COMMAND("selectteam", ClientCommand_selectteam(ent, request, arguments), "Attempt to choose a team to join into") \ CLIENT_COMMAND("selfstuff", ClientCommand_selfstuff(ent, request, command), "Stuffcmd a command to your own client") \ - CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments, command), "New system for sending a client cvar to the server") \ + CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments), "New system for sending a client cvar to the server") \ CLIENT_COMMAND("spectate", ClientCommand_spectate(ent, request), "Become an observer") \ + CLIENT_COMMAND("sounds", ClientCommand_sounds(ent, request), "Get list of commsnds") \ CLIENT_COMMAND("suggestmap", ClientCommand_suggestmap(ent, request, arguments), "Suggest a map to the mapvote at match end") \ CLIENT_COMMAND("tell", ClientCommand_tell(ent, request, arguments, command), "Send a message directly to a player") \ CLIENT_COMMAND("voice", ClientCommand_voice(ent, request, arguments, command), "Send voice message via sound") \ diff --cc qcsrc/server/command/vote.qc index 602fe36ce,ffc81c468..a179438ce --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@@ -726,14 -712,14 +726,18 @@@ int VoteCommand_parse(entity caller, st if (first_command == "kickban") command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~"); - vote_parsed_command = strcat(first_command, " # ", ftos(etof(victim)), " ", command_arguments); + if (first_command == "kick") // z411 : Use our kick implementation - kind of hacky... + vote_parsed_command = strcat("defer 2 \"sv_cmd kickkick # ", ftos(etof(victim)), " ", command_arguments, "\""); + else + vote_parsed_command = strcat("defer 2 \"", first_command, " # ", ftos(etof(victim)), " ", command_arguments, "\""); + vote_parsed_display = sprintf("^1%s #%d ^7%s^1 %s", first_command, etof(victim), victim.netname, reason); } - else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return 0; } + else + { + print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); + return 0; + } break; } diff --cc qcsrc/server/damage.qc index 9fab1e792,d480c229b..4c02029ca --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@@ -445,10 -413,10 +443,10 @@@ void Obituary(entity attacker, entity i int f3 = 0; if(deathtype == DEATH_BUFF.m_id) - f3 = buff_FirstFromFlags(STAT(BUFFS, attacker)).m_id; + f3 = buff_FirstFromFlags(attacker).m_id; - if (!Obituary_WeaponDeath(targ, true, deathtype, targ.netname, attacker_name, deathlocation, CS(targ).killcount, kill_count_to_attacker)) - Obituary_SpecialDeath(targ, true, deathtype, targ.netname, attacker_name, deathlocation, CS(targ).killcount, kill_count_to_attacker, f3); + if (!Obituary_WeaponDeath(targ, attacker, true, deathtype, playername(targ.netname, targ.team, true), playername(attacker_name, attacker.team, true), deathlocation, CS(targ).killcount, kill_count_to_attacker)) + Obituary_SpecialDeath(targ, attacker, true, deathtype, playername(targ.netname, targ.team, true), playername(attacker_name, attacker.team, true), deathlocation, CS(targ).killcount, kill_count_to_attacker, f3); } }