X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=09daa245ac8c368016acb84ede41df05764c8f86;hb=979f3b4688685a32b22bc1efc9ecf2eeaeeca61e;hp=6ee4e117964d16ff1a3e01d624dd098caa2de62e;hpb=8ad8bf067e165c2953462c45aea4ff2127967ee2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 6ee4e1179..09daa245a 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -101,15 +101,13 @@ void fteqcc_testbugs() * players. Also plays reminder sounds. */ void timeoutHandler_Think() { - local string timeStr; local entity plr; if (timeoutStatus == 1) { if (remainingLeadTime > 0) { //centerprint the information to every player - timeStr = getTimeoutText(0); FOR_EACH_REALCLIENT(plr) { if(plr.classname == "player") { - centerprint_atprio(plr, CENTERPRIO_SPAM, timeStr); + Send_CSQC_Centerprint_Generic(plr, CPID_TIMEOUT_COUNTDOWN, "Timeout begins in %d seconds!", 1, remainingLeadTime); } } remainingLeadTime -= 1; @@ -133,10 +131,9 @@ void timeoutHandler_Think() { } else if (timeoutStatus == 2) { if (remainingTimeoutTime > 0) { - timeStr = getTimeoutText(0); FOR_EACH_REALCLIENT(plr) { if(plr.classname == "player") { - centerprint_atprio(plr, CENTERPRIO_SPAM, timeStr); + Send_CSQC_Centerprint_Generic(plr, CPID_TIMEOUT_COUNTDOWN, "Timeout ends in %d seconds!", 1, remainingTimeoutTime); } } if(remainingTimeoutTime == autocvar_sv_timeout_resumetime) { //play a warning sound when only seconds are left @@ -156,7 +153,7 @@ void timeoutHandler_Think() { //get rid of the countdown message FOR_EACH_REALCLIENT(plr) { if(plr.classname == "player") { - centerprint_atprio(plr, CENTERPRIO_SPAM, ""); + Send_CSQC_Centerprint_Generic_Expire(plr, CPID_TIMEOUT_COUNTDOWN); } } remove(self); @@ -167,7 +164,7 @@ void timeoutHandler_Think() { else if (timeoutStatus == 0) { //if a player called the resumegame command (which set timeoutStatus to 0 already) FOR_EACH_REALCLIENT(plr) { if(plr.classname == "player") { - centerprint_atprio(plr, CENTERPRIO_SPAM, ""); + Send_CSQC_Centerprint_Generic_Expire(plr, CPID_TIMEOUT_COUNTDOWN); } } remove(self); @@ -293,10 +290,12 @@ void cvar_changes_init() BADCVAR("sv_vote_master_password"); BADCVAR("sys_colortranslation"); BADCVAR("sys_specialcharactertranslation"); + BADCVAR("timeformat"); BADCVAR("timestamps"); BADPREFIX("developer_"); BADPREFIX("g_ban_"); BADPREFIX("g_chat_flood_"); + BADPREFIX("g_playerstats_"); BADPREFIX("g_voice_flood_"); BADPREFIX("rcon_"); BADPREFIX("settemp_"); @@ -309,10 +308,7 @@ void cvar_changes_init() BADPREFIX("sv_weaponstats_"); // these can contain player IDs, so better hide - BADCVAR("g_forced_team_red"); - BADCVAR("g_forced_team_blue"); - BADCVAR("g_forced_team_yellow"); - BADCVAR("g_forced_team_pink"); + BADPREFIX("g_forced_team_"); // mapinfo BADCVAR("fraglimit"); @@ -397,6 +393,8 @@ void cvar_changes_init() BADPREFIX("sv_maxidle_"); BADPREFIX("sv_vote_"); BADPREFIX("timelimit_"); + BADCVAR("gameversion"); + BADPREFIX("gameversion_"); // allowed changes to server admins (please sync this to server.cfg) // vi commands: @@ -408,6 +406,7 @@ void cvar_changes_init() BADCVAR("bot_number"); BADCVAR("bot_prefix"); BADCVAR("bot_suffix"); + BADCVAR("bot_config_file"); BADCVAR("capturelimit_override"); BADCVAR("fraglimit_override"); BADCVAR("gametype"); @@ -420,6 +419,7 @@ void cvar_changes_init() BADCVAR("g_ctf_ignore_frags"); BADCVAR("g_ctf_win_mode"); BADCVAR("g_domination_point_limit"); + BADCVAR("g_friendlyfire"); BADCVAR("g_fullbrightitems"); BADCVAR("g_fullbrightplayers"); BADCVAR("g_keyhunt_point_limit"); @@ -433,15 +433,17 @@ void cvar_changes_init() BADCVAR("g_maplist_votable_abstain"); BADCVAR("g_maplist_votable_nodetail"); BADCVAR("g_maplist_votable_suggestions"); + BADCVAR("g_maxplayers"); BADCVAR("g_minstagib"); + BADCVAR("g_mirrordamage"); BADCVAR("g_nexball_goallimit"); BADCVAR("g_runematch_point_limit"); BADCVAR("g_start_delay"); + BADCVAR("g_warmup"); BADCVAR("g_weapon_stay"); BADPRESUFFIX("g_", "_weapon_stay"); BADCVAR("hostname"); BADCVAR("log_file"); BADCVAR("maxplayers"); - BADCVAR("g_maxplayers"); BADCVAR("minplayers"); BADCVAR("net_address"); BADCVAR("port"); @@ -469,10 +471,10 @@ void cvar_changes_init() BADCVAR("sv_vote_master_commands"); BADCVAR("sv_vote_master_password"); BADCVAR("sv_vote_simple_majority_factor"); + BADCVAR("sys_ticrate"); + BADCVAR("teamplay_mode"); BADCVAR("timelimit_override"); - BADCVAR("g_warmup"); BADPREFIX("g_warmup_"); - BADCVAR("teamplay_mode"); if(autocvar_g_minstagib) { @@ -701,10 +703,6 @@ void spawnfunc_worldspawn (void) if(self.spawnflags & SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS) bot_waypoints_for_items = 0; - // for setting by mapinfo - q3acompat_machineshotgunswap = autocvar_sv_q3acompat_machineshotgunswap; - cvar_set("sv_q3acompat_machineshotgunswap", "0"); - precache(); WaypointSprite_Init(); @@ -715,8 +713,7 @@ void spawnfunc_worldspawn (void) GameLogInit(); // prepare everything if(autocvar_sv_eventlog) { - s = strcat(ftos(autocvar_sv_eventlog_files_counter), "."); - s = strcat(s, ftos(random())); + s = sprintf("%d.%s.%06d", ftos(autocvar_sv_eventlog_files_counter), strftime(FALSE, "%s"), floor(random() * 1000000)); matchid = strzone(s); GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s)); @@ -813,6 +810,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_WEAPONS, AS_INT, weapons); addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon); + addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon); addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime); addstat(STAT_ALLOW_OLDNEXBEAM, AS_INT, stat_allow_oldnexbeam); Nagger_Init(); @@ -1194,7 +1192,7 @@ void Maplist_Init() if(Map_Count == 0) { bprint( "Maplist is empty! Resetting it to default map list.\n" ); - cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); + cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); if(autocvar_g_maplist_shuffle) ShuffleMaplist(); localcmd("\nmenu_cmd sync\n"); @@ -1314,7 +1312,7 @@ void GotoNextMap() if(allowReset) { bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" ); - cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); + cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); if(autocvar_g_maplist_shuffle) ShuffleMaplist(); localcmd("\nmenu_cmd sync\n"); @@ -1490,7 +1488,7 @@ void DumpStats(float final) } } - if(teams_matter) + if(teamplay) { s = strcat(":labels:teamscores:", GetTeamScoreString(0, 0)); if(to_console) @@ -1529,8 +1527,6 @@ void FixIntermissionClient(entity e) string s; if(!e.autoscreenshot) // initial call { - e.angles = e.v_angle; - e.angles_x = -e.angles_x; e.autoscreenshot = time + 0.8; // used for autoscreenshot e.health = -2342; // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not) @@ -1553,11 +1549,6 @@ void FixIntermissionClient(entity e) WriteByte(MSG_ONE, SVC_INTERMISSION); } } - - //e.velocity = '0 0 0'; - //e.fixangle = TRUE; - - // TODO halt weapon animation } @@ -1596,6 +1587,7 @@ void NextLevel() FOR_EACH_CLIENT(e) PlayerStats_AddGlobalInfo(e); PlayerStats_Shutdown(); + WeaponStats_Shutdown(); if(autocvar_sv_eventlog) GameLogEcho(":gameover"); @@ -1936,7 +1928,7 @@ float WinningCondition_Scores(float limit, float leadlimit) // TODO make everything use THIS winning condition (except LMS) WinningConditionHelper(); - if(teams_matter) + if(teamplay) { team1_score = TeamScore_GetCompareValue(COLOR_TEAM1); team2_score = TeamScore_GetCompareValue(COLOR_TEAM2); @@ -2306,7 +2298,6 @@ string mapvote_maps_pakfile[MAPVOTE_COUNT]; float mapvote_maps_suggested[MAPVOTE_COUNT]; string mapvote_suggestions[MAPVOTE_COUNT]; float mapvote_suggestion_ptr; -float mapvote_maxlen; float mapvote_voters; float mapvote_votes[MAPVOTE_COUNT]; float mapvote_run; @@ -2368,8 +2359,10 @@ void MapVote_AddVotable(string nextMap, float isSuggestion) for(j = 0; j < mapvote_count; ++j) if(mapvote_maps[j] == nextMap) return; - if(strlen(nextMap) > mapvote_maxlen) - mapvote_maxlen = strlen(nextMap); + // suggestions might be no longer valid/allowed after gametype switch! + if(isSuggestion) + if(!MapInfo_CheckMap(nextMap)) + return; mapvote_maps[mapvote_count] = strzone(nextMap); mapvote_maps_suggested[mapvote_count] = isSuggestion; @@ -2431,7 +2424,7 @@ void MapVote_Init() if(mapvote_count == 0) { bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" ); - cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); + cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); if(autocvar_g_maplist_shuffle) ShuffleMaplist(); localcmd("\nmenu_cmd sync\n");