From: z411 Date: Mon, 9 Nov 2020 01:59:18 +0000 (-0300) Subject: Merge branch 'master' into z411/bai-server X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf0167d3369dbaf748044dcb5f03380cd8b0c11e;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into z411/bai-server --- cf0167d3369dbaf748044dcb5f03380cd8b0c11e diff --cc qcsrc/client/hud/panel/centerprint.qh index 2594b6025,f9e23b726..0d8bc95f4 --- a/qcsrc/client/hud/panel/centerprint.qh +++ b/qcsrc/client/hud/panel/centerprint.qh @@@ -1,9 -1,23 +1,27 @@@ #pragma once #include "../panel.qh" + 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_in = 0.2; + float autocvar_hud_panel_centerprint_fade_out = 0.5; + 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; + float autocvar_hud_panel_centerprint_fade_subsequent_passtwo = 10; + float autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha = 0.5; -float autocvar_hud_panel_centerprint_fade_subsequent_minfontsize = 0.75; -float autocvar_hud_panel_centerprint_fade_minfontsize = 0; ++//float autocvar_hud_panel_centerprint_fade_subsequent_minfontsize = 0.75; ++//float autocvar_hud_panel_centerprint_fade_minfontsize = 0; + bool autocvar_hud_panel_centerprint_flip; + float autocvar_hud_panel_centerprint_fontscale; + float autocvar_hud_panel_centerprint_fontscale_bold = 1.4; + bool autocvar_hud_panel_centerprint_dynamichud = true; + float autocvar_hud_panel_centerprint_time; + +void centerprint_ClearTitle(); +void centerprint_SetTitle(string title); +void centerprint_Medal(string icon, int times); ++ void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num); void centerprint_AddStandard(string strMessage); void centerprint_Kill(int id); diff --cc qcsrc/client/hud/panel/chat.qc index cb7729d49,954a3676a..33f8b6a13 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@@ -1,8 -1,6 +1,7 @@@ #include "chat.qh" - #include #include +#include // Chat (#12) diff --cc qcsrc/client/hud/panel/spect.qc index d70847fe1,000000000..8f1e3cd41 mode 100644,000000..100644 --- a/qcsrc/client/hud/panel/spect.qc +++ b/qcsrc/client/hud/panel/spect.qc @@@ -1,199 -1,0 +1,198 @@@ +#include "spect.qh" + - #include +#include +#include + +vector teamscore_size; +vector teamscore_fontsize; +vector teamname_fontsize; + +void HUD_SpectHUD_Export(int fh) +{ + // allow saving cvars that aesthetically change the panel into hud skin files +} + +void HUD_SpectHUD_drawCurrentName(vector pos) +{ + string s = entcs_GetName(current_player); + pos.x -= stringwidth_colors(s, hud_fontsize * 2) / 2; + drawcolorcodedstring(pos, s, hud_fontsize * 2, panel_fg_alpha, DRAWFLAG_NORMAL); +} + +void HUD_SpectHUD_drawTeamPlayers(vector pos, entity tm, vector rgb, bool invert) +{ + vector tmp_over; + vector line_sz = vec2((vid_conwidth - 1) / 7, hud_fontsize.y * 1.5); + vector line_sz_sub = vec2((vid_conwidth - 1) / 7, hud_fontsize.y); + + string playername; + float a = panel_fg_alpha * 0.8; + entity pl; + + if(invert) + pos.x -= line_sz.x + hud_fontsize.x; + else + pos.x += hud_fontsize.x; + + for(pl = players.sort_next; pl; pl = pl.sort_next) + { + if(pl.team != tm.team) + continue; + + float health = 0; + float armor = 0; + string icon = ""; + vector icon_size = '0 0 0'; + vector icon_rgb = '1 1 1'; + + // Position and size calculation vectors + tmp_over = pos; + vector total_sz = vec2(line_sz.x, line_sz.y + line_sz_sub.y); + + if(pl.eliminated) { + // z411 TODO : Unhardcode luma + icon = "gfx/hud/luma/notify_death.tga"; + icon_rgb = rgb; + } else { + entity entcs = entcs_receiver(pl.sv_entnum); + if(entcs.m_entcs_private) { + health = (entcs.healthvalue / autocvar_hud_panel_healtharmor_maxhealth) * line_sz.x; + armor = (GetResource(entcs, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor) * line_sz_sub.x; + + Weapon wep = REGISTRY_GET(Weapons, entcs.activewepid); + icon = strcat("gfx/hud/luma/", wep.model2); + } else { + if(tm.team == NUM_TEAM_1) + icon = "gfx/hud/luma/player_red"; + else if(tm.team == NUM_TEAM_2) + icon = "gfx/hud/luma/player_blue"; + else + icon = "gfx/hud/luma/player_neutral"; + } + } + + // Draw weapon + if(icon != "") { + vector tmp_sz = draw_getimagesize(icon); + icon_size = vec2(total_sz.y*(tmp_sz.x/tmp_sz.y), total_sz.y); + total_sz.x += icon_size.x; + + if(invert) { + pos.x -= icon_size.x; + tmp_over.x -= icon_size.x; + } + drawpic(pos, icon, icon_size, icon_rgb, panel_fg_alpha, DRAWFLAG_NORMAL); + pos.x += icon_size.x; + } + + // Get player's name + playername = textShortenToWidth(entcs_GetName(pl.sv_entnum), line_sz.x * 0.8, hud_fontsize, stringwidth_colors); + + // Draw health and name + drawfill(pos, line_sz, rgb * 0.7, a * 0.3, DRAWFLAG_NORMAL); + if(health) + drawfill(pos, vec2(health, line_sz.y), rgb * 0.7, a, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + eY * ((line_sz.y - hud_fontsize.y) / 2) + eX * (hud_fontsize.x * 0.5), playername, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + pos.y += line_sz.y; + + // Draw armor + if(armor) + drawfill(pos, vec2(armor, line_sz_sub.y), rgb, a, DRAWFLAG_NORMAL); + + // Highlight current player + if(pl.sv_entnum == current_player && spectatee_status != -1) + drawfill(tmp_over, total_sz, '1 1 1', 0.3, DRAWFLAG_NORMAL); + if(pl.eliminated) + drawfill(tmp_over, total_sz, '0 0 0', 0.4, DRAWFLAG_NORMAL); + + if(!invert) + pos.x -= icon_size.x; + pos.y += line_sz_sub.y * 2; + } +} + + +void HUD_SpectHUD_drawTeamScore(vector pos, entity tm, vector rgb, bool invert) +{ + if(!tm) return; + + vector tmp; + string tmp_str; + + // Team score + tmp_str = ftos(tm.(teamscores(ts_primary))); + + if(invert) + pos.x -= teamscore_size.x; + + drawfill(pos, teamscore_size, rgb * 0.8, 0.3, DRAWFLAG_NORMAL); + + tmp = pos; + tmp.x += (teamscore_size.x - stringwidth(tmp_str, true, teamscore_fontsize)) / 2; + tmp.y += (teamscore_size.y - teamscore_fontsize.y) / 2; + + draw_beginBoldFont(); + drawstring(tmp, tmp_str, teamscore_fontsize, rgb, panel_fg_alpha, DRAWFLAG_NORMAL); + draw_endBoldFont(); + + // Team name + tmp_str = Team_CustomName(tm.team); + + tmp = pos; + if(invert) + tmp.x -= stringwidth_colors(tmp_str, teamname_fontsize) + teamname_fontsize.x * 0.5; + else + tmp.x += teamscore_size.x + teamname_fontsize.x * 0.5; + tmp.y += (teamscore_size.y - teamname_fontsize.y) / 2; + + drawcolorcodedstring(tmp, tmp_str, teamname_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); +} + +void HUD_SpectHUD() +{ + if(!spectatee_status) return; + + vector pos, rgb; + float ammo_y, timer_width; + entity tm; + + // Set main vars + HUD_Panel_LoadCvars(); + HUD_Scale_Enable(); + hud_fontsize = HUD_GetFontsize("hud_fontsize"); + + // Spectator name + if(spectatee_status != -1) { + ammo_y = stov(cvar_string("hud_panel_ammo_pos")).y * vid_conheight; + pos = panel_pos + vec2((vid_conwidth - 1) / 2, (ammo_y - (hud_fontsize.y * 2))); + HUD_SpectHUD_drawCurrentName(pos); + } + + if(!teamplay) return; + + // Set vars + teamscore_fontsize = hud_fontsize * 3; + teamname_fontsize = hud_fontsize * 2; + teamscore_size = vec2(teamscore_fontsize.x * 1.5, teamscore_fontsize.y * 1.25); + timer_width = stov(cvar_string("hud_panel_timer_size")).x * vid_conwidth; + + // Team 1 + pos = panel_pos + vec2((vid_conwidth - 1) / 2, 0); + tm = GetTeam(NUM_TEAM_1, false); + rgb = Team_ColorRGB(tm.team); + pos.x -= (timer_width * 1.3) / 2; + HUD_SpectHUD_drawTeamScore(pos, tm, rgb, true); + + pos = panel_pos + vec2(0, (vid_conheight - 1) / 4 + hud_fontsize.y); + HUD_SpectHUD_drawTeamPlayers(pos, tm, rgb, false); + + // Team 2 + pos = panel_pos + vec2((vid_conwidth - 1) / 2, 0); + tm = GetTeam(NUM_TEAM_2, false); + rgb = Team_ColorRGB(tm.team); + pos.x += (timer_width * 1.3) / 2; + HUD_SpectHUD_drawTeamScore(pos, tm, rgb, false); + + pos = panel_pos + vec2(vid_conwidth - 1, (vid_conheight - 1) / 4 + hud_fontsize.y); + HUD_SpectHUD_drawTeamPlayers(pos, tm, rgb, true); +} diff --cc qcsrc/client/main.qh index 7fae5ff9b,83417c08d..90fc6b636 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@@ -2,11 -2,24 +2,28 @@@ #include #include +#include + +// z411 +string hostname_full; + bool autocvar_cl_db_saveasdump; + bool autocvar_cl_spawn_event_particles; + bool autocvar_cl_spawn_event_sound = 1; + // float autocvar_cl_spawn_point_model; + bool autocvar_cl_spawn_point_particles; + float autocvar_cl_spawn_point_dist_max = 1200; + bool autocvar_cl_unpress_zoom_on_spawn = true; + bool autocvar_cl_unpress_zoom_on_death = true; + bool autocvar_cl_unpress_zoom_on_weapon_switch = true; + bool autocvar_cl_unpress_attack_on_weapon_switch = false; + bool autocvar_hud_showbinds; + bool autocvar_hud_showbinds_limit; + bool autocvar__hud_showbinds_reload; + bool autocvar_developer_csqcentities; + bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode + bool autocvar_cl_race_cptimes_showself = false; + // Map coordinate base calculations need these vector mi_center; vector mi_scale; diff --cc qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qh index 6e7027de7,586d7eb17..f55c3585f --- a/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qh +++ b/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qh @@@ -1,6 -1,7 +1,3 @@@ #pragma once - //void HUD_Mod_CA(vector myPos, vector mySize); - //void HUD_Mod_CA_Draw(vector myPos, vector mySize, int layout); - //void HUD_Mod_CA_Export(int fh); -int autocvar_hud_panel_modicons_ca_layout; - -void HUD_Mod_CA(vector myPos, vector mySize); -void HUD_Mod_CA_Draw(vector myPos, vector mySize, int layout); -void HUD_Mod_CA_Export(int fh); +int HUD_Scores_CA(int team); diff --cc qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qh index b464e5057,75bfeefd4..3f59c932d --- a/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qh @@@ -1,3 -1,5 +1,2 @@@ #pragma once - //void HUD_Mod_FreezeTag_Export(int fh); -int autocvar_hud_panel_modicons_freezetag_layout; - -void HUD_Mod_FreezeTag_Export(int fh); diff --cc qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index e7cbc662f,ea00927ab..fee45755d --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@@ -127,14 -112,12 +127,15 @@@ bool freezetag_CheckWinner( { Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER); Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_OVER); + FOREACH_CLIENT(IS_PLAYER(it), { it.freezetag_frozen_timeout = 0; + it.freezetag_revive_time = 0; nades_Clear(it); }); - game_stopped = true; + if(autocvar_g_freezetag_round_stop) + game_stopped = true; round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit); return true; } diff --cc qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh index 91e783c78,4c88b20de..00082fd61 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh @@@ -36,8 -34,12 +37,13 @@@ const float ICE_MAX_ALPHA = 1 const float ICE_MIN_ALPHA = 0.1; float freezetag_teams; + bool autocvar_g_freezetag_revive_auto = 1; + int autocvar_g_freezetag_revive_auto_progress = 1; + int autocvar_g_freezetag_revive_auto_reducible; + float autocvar_g_freezetag_revive_auto_reducible_forcefactor; float autocvar_g_freezetag_revive_extra_size; 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; diff --cc qcsrc/common/stats.qh index 49be5178c,67f7fd60c..d0f7f2bae --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@@ -66,15 -73,13 +73,20 @@@ 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") + #define autocvar_fraglimit_override cvar("fraglimit_override") + #define autocvar_timelimit cvar("timelimit") + #define autocvar_timelimit_override cvar("timelimit_override") #endif REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) REGISTER_STAT(GAME_STOPPED, int, game_stopped) diff --cc qcsrc/server/chat.qh index 1c45d3db7,500d757c0..92e4fd208 --- a/qcsrc/server/chat.qh +++ b/qcsrc/server/chat.qh @@@ -1,5 -1,19 +1,23 @@@ #pragma once + float autocvar_g_chat_flood_burst; + float autocvar_g_chat_flood_burst_team; + float autocvar_g_chat_flood_burst_tell; + float autocvar_g_chat_flood_lmax; + float autocvar_g_chat_flood_lmax_team; + float autocvar_g_chat_flood_lmax_tell; + bool autocvar_g_chat_flood_notify_flooder; + float autocvar_g_chat_flood_spl; + float autocvar_g_chat_flood_spl_team; + float autocvar_g_chat_flood_spl_tell; + int autocvar_g_chat_nospectators; + bool autocvar_g_chat_teamcolors; + bool autocvar_g_chat_tellprivacy; + ++bool autocvar_sv_chat_sounds; ++float autocvar_sv_chat_sounds_flood; ++string autocvar_sv_chat_sounds_list; ++ const float NUM_NEAREST_ENTITIES = 4; entity nearest_entity[NUM_NEAREST_ENTITIES]; float nearest_length[NUM_NEAREST_ENTITIES]; diff --cc qcsrc/server/client.qh index 2a447b635,563fdba1b..9d6575d53 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@@ -5,6 -5,54 +5,61 @@@ #include #include + bool autocvar__notarget; + int autocvar_g_balance_armor_start; + float autocvar_g_balance_pause_armor_rot_spawn; + float autocvar_g_balance_pause_fuel_rot_spawn; + float autocvar_g_balance_pause_health_regen_spawn; + float autocvar_g_balance_pause_health_rot_spawn; + bool autocvar_g_botclip_collisions; + bool autocvar_g_fullbrightplayers; + bool autocvar_g_playerclip_collisions; + float autocvar_g_player_alpha; + float autocvar_g_player_brightness; + float autocvar_g_player_damageforcescale = 2; + float autocvar_g_respawn_delay_small; + int autocvar_g_respawn_delay_small_count; + float autocvar_g_respawn_delay_large; + int autocvar_g_respawn_delay_large_count; + float autocvar_g_respawn_delay_max; + bool autocvar_g_respawn_delay_forced; + bool autocvar_g_respawn_ghosts; + float autocvar_g_respawn_ghosts_alpha = 1; + float autocvar_g_respawn_ghosts_fadetime = 1.5; + float autocvar_g_respawn_ghosts_time = 4.5; + float autocvar_g_respawn_ghosts_speed; + int autocvar_g_respawn_waves; + bool autocvar_g_nodepthtestplayers; + string autocvar_g_mutatormsg; + float autocvar_sv_foginterval; + float autocvar_sv_maxidle; + bool autocvar_sv_maxidle_spectatorsareidle; + int autocvar_sv_maxidle_slots; + bool autocvar_sv_maxidle_slots_countbots; + bool autocvar_g_forced_respawn; + int autocvar_g_maxplayers; + float autocvar_g_maxplayers_spectator_blocktime; + string autocvar_g_xonoticversion; + float autocvar_gameversion; + float autocvar_gameversion_min; + float autocvar_gameversion_max; + string autocvar_hostname; + int autocvar_spawn_debug; + string autocvar_sv_motd; + int autocvar_sv_name_maxlength = 64; + bool autocvar_sv_servermodelsonly; + int autocvar_sv_spectate; + bool autocvar_sv_teamnagger; + float autocvar_sv_player_scale; + bool autocvar_sv_showspectators; + ++// z411 ++string autocvar_hostname_full; ++string autocvar_g_teamnames_red; ++string autocvar_g_teamnames_blue; ++string autocvar_g_teamnames_yellow; ++string autocvar_g_teamnames_pink; ++ // WEAPONTODO .string weaponorder_byimpulse; diff --cc qcsrc/server/world.qh index 20d456990,4141c99e2..a43c8dac1 --- a/qcsrc/server/world.qh +++ b/qcsrc/server/world.qh @@@ -2,6 -2,31 +2,36 @@@ #include + bool autocvar__sv_init; + bool autocvar_g_use_ammunition; + bool autocvar_g_jetpack; + bool autocvar_g_warmup_allguns; + bool autocvar_g_warmup_allow_timeout; + #define autocvar_g_weaponarena cvar_string("g_weaponarena") + string autocvar_quit_and_redirect; + float autocvar_quit_and_redirect_timer; + bool autocvar_quit_when_empty; + string autocvar_sessionid; + bool autocvar_sv_curl_serverpackages_auto; + bool autocvar_sv_db_saveasdump; + bool autocvar_sv_logscores_bots; + bool autocvar_sv_logscores_console; + bool autocvar_sv_logscores_file; + string autocvar_sv_logscores_filename; + float autocvar_sv_mapchange_delay; + float autocvar_timelimit_increment; + float autocvar_timelimit_decrement; + float autocvar_timelimit_min; + float autocvar_timelimit_max; + float autocvar_timelimit_overtime; + int autocvar_timelimit_overtimes; + float autocvar_timelimit_suddendeath; + ++// z411 ++bool autocvar_sv_jingle_end; ++string autocvar_sv_jingle_end_list; ++float autocvar_sv_jingle_end_volume; ++ float checkrules_equality; float checkrules_suddendeathwarning; float checkrules_suddendeathend;