X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=cbe65b6109e1f22c70de774afd07296ae713a996;hb=31a6820253244d6a4b374d377f1b5e5ea89a4db9;hp=6c74ec83954d03455c3e73f8b8dd9a690bb8bea4;hpb=a2aac26e6d660e5e70e65d7639a669bced3de9e2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 6c74ec839..cbe65b610 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -101,15 +101,15 @@ void fteqcc_testbugs() * players. Also plays reminder sounds. */ void timeoutHandler_Think() { - local string timeStr; local entity plr; + // NOTE: the below Send_CSQC_Centerprint_Generic send msgs with countdown_num + // parameter set as 0, even if the msgs are part of a countdown 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 +133,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 +155,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 +166,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); @@ -823,12 +822,18 @@ void spawnfunc_worldspawn (void) addstat(STAT_FUEL, AS_INT, ammo_fuel); addstat(STAT_SHOTORG, AS_INT, stat_shotorg); addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit); - addstat(STAT_BULLETS_LOADED, AS_INT, sniperrifle_bulletcounter); + addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load); + addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size); addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup); + addstat(STAT_HIT_TIME, AS_FLOAT, hit_time); + addstat(STAT_TYPEHIT_TIME, AS_FLOAT, typehit_time); + addstat(STAT_LAYED_MINES, AS_INT, minelayer_mines); addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge); addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo); + addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load); + if(g_ca || g_freezetag) { addstat(STAT_REDALIVE, AS_INT, redalive_stat); @@ -913,8 +918,12 @@ void spawnfunc_worldspawn (void) // fill sv_curl_serverpackages from .serverpackage files if(autocvar_sv_curl_serverpackages_auto) { - fd = search_begin("*.serverpackage", TRUE, FALSE); s = ""; + n = tokenize_console(cvar_string("sv_curl_serverpackages")); + for(i = 0; i < n; ++i) + if(substring(argv(i), -14, -1) != ".serverpackage") + s = strcat(s, " ", argv(i)); + fd = search_begin("*.serverpackage", TRUE, FALSE); if(fd >= 0) { j = search_getsize(fd); @@ -936,19 +945,6 @@ void spawnfunc_light (void) remove(self); } -float TryFile( string pFilename ) -{ - local float lHandle; - dprint("TryFile(\"", pFilename, "\")\n"); - lHandle = fopen( pFilename, FILE_READ ); - if( lHandle != -1 ) { - fclose( lHandle ); - return TRUE; - } else { - return FALSE; - } -}; - string GetGametype() { return GametypeNameFromType(game); @@ -992,14 +988,12 @@ float MapHasRightSize(string map) if(autocvar_g_maplist_check_waypoints) { dprint("checkwp "); dprint(map); - fh = fopen(strcat("maps/", map, ".waypoints"), FILE_READ); - if(fh < 0) + if(!fexists(strcat("maps/", map, ".waypoints"))) { dprint(": no waypoints\n"); return FALSE; } dprint(": has waypoints\n"); - fclose(fh); } // open map size restriction file @@ -1433,7 +1427,6 @@ void DumpStats(float final) float to_eventlog; float to_file; float i; - entity e; to_console = autocvar_sv_logscores_console; to_eventlog = autocvar_sv_eventlog; @@ -1496,7 +1489,7 @@ void DumpStats(float final) } } - if(teams_matter) + if(teamplay) { s = strcat(":labels:teamscores:", GetTeamScoreString(0, 0)); if(to_console) @@ -1535,8 +1528,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) @@ -1559,11 +1550,6 @@ void FixIntermissionClient(entity e) WriteByte(MSG_ONE, SVC_INTERMISSION); } } - - //e.velocity = '0 0 0'; - //e.fixangle = TRUE; - - // TODO halt weapon animation } @@ -1942,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); @@ -2840,16 +2826,16 @@ void EndFrame() if(self.classname == "spectator") { if(self.enemy.typehitsound) - play2(self, "misc/typehit.wav"); - else if(self.enemy.hitsound && self.cvar_cl_hitsound) - play2(self, "misc/hit.wav"); + self.typehit_time = time; + else if(self.enemy.hitsound) + self.hit_time = time; } else { if(self.typehitsound) - play2(self, "misc/typehit.wav"); - else if(self.hitsound && self.cvar_cl_hitsound) - play2(self, "misc/hit.wav"); + self.typehit_time = time; + else if(self.hitsound) + self.hit_time = time; } } altime = time + frametime * (1 + autocvar_g_antilag_nudge);