X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=c9e24123a826645aae94f96ab07629df5af42d01;hb=9a66589d6acbd35df28b897d603709b435b78710;hp=85bab3c55685cf5202c36bc9659b758a5d5f243a;hpb=b0c28b8ffa783fef2f935f4d1fef38b27b55581b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 85bab3c55..c9e24123a 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -546,6 +546,7 @@ void spawnfunc___init_dedicated_server(void) // needs to be done so early because of the constants they create CALL_ACCUMULATED_FUNCTION(RegisterWeapons); + CALL_ACCUMULATED_FUNCTION(RegisterMonsters); CALL_ACCUMULATED_FUNCTION(RegisterGametypes); CALL_ACCUMULATED_FUNCTION(RegisterNotifications); CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); @@ -563,7 +564,7 @@ void WeaponStats_Shutdown(); void spawnfunc_worldspawn (void) { float fd, l, i, j, n; - string s, col; + string s; cvar = cvar_normal; cvar_string = cvar_string_normal; @@ -594,6 +595,7 @@ void spawnfunc_worldspawn (void) // needs to be done so early because of the constants they create CALL_ACCUMULATED_FUNCTION(RegisterWeapons); + CALL_ACCUMULATED_FUNCTION(RegisterMonsters); CALL_ACCUMULATED_FUNCTION(RegisterGametypes); CALL_ACCUMULATED_FUNCTION(RegisterNotifications); CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); @@ -702,6 +704,10 @@ void spawnfunc_worldspawn (void) if(autocvar_g_weaponarena != "0") s = strcat(s, ":", autocvar_g_weaponarena, " arena"); + // TODO to mutator system + if(autocvar_g_norecoil) + s = strcat(s, ":norecoil"); + // TODO to mutator system if(autocvar_g_powerups == 0) s = strcat(s, ":no_powerups"); @@ -791,6 +797,10 @@ void spawnfunc_worldspawn (void) addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo); addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load); + + // freeze attacks + addstat(STAT_FROZEN, AS_INT, frozen); + addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, revive_progress); // g_movementspeed hack addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw); @@ -801,6 +811,10 @@ void spawnfunc_worldspawn (void) // secrets addstat(STAT_SECRETS_TOTAL, AS_FLOAT, stat_secrets_total); addstat(STAT_SECRETS_FOUND, AS_FLOAT, stat_secrets_found); + + // monsters + addstat(STAT_MONSTERS_TOTAL, AS_FLOAT, stat_monsters_total); + addstat(STAT_MONSTERS_KILLED, AS_FLOAT, stat_monsters_killed); // misc addstat(STAT_RESPAWN_TIME, AS_FLOAT, stat_respawn_time); @@ -810,58 +824,15 @@ void spawnfunc_worldspawn (void) detect_maptype(); // set up information replies for clients and server to use - lsmaps_reply = "^7Maps available: "; - lsnewmaps_reply = "^7Maps without a record set: "; - for(i = 0, j = 0; i < MapInfo_count; ++i) - { - if(MapInfo_Get_ByID(i)) - if not(MapInfo_Map_flags & MapInfo_ForbiddenFlags()) - { - if(mod(i, 2)) - col = "^2"; - else - col = "^3"; - - ++j; - - lsmaps_reply = strcat(lsmaps_reply, col, MapInfo_Map_bspname, " "); - - if(g_race && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, RACE_RECORD, "time")))) - lsnewmaps_reply = strcat(lsnewmaps_reply, col, MapInfo_Map_bspname, " "); - else if(g_cts && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, CTS_RECORD, "time")))) - lsnewmaps_reply = strcat(lsnewmaps_reply, col, MapInfo_Map_bspname, " "); - } - } - - lsmaps_reply = strzone(strcat(lsmaps_reply, "\n")); - lsnewmaps_reply = strzone(strcat(((!g_race && !g_cts) ? "Need to be playing race or CTS for lsnewmaps to work." : lsnewmaps_reply), "\n")); - - maplist_reply = "^7Maps in list: "; - n = tokenize_console(autocvar_g_maplist); - for(i = 0, j = 0; i < n; ++i) - { - if(MapInfo_CheckMap(argv(i))) - { - if(mod(j, 2)) - col = "^2"; - else - col = "^3"; - maplist_reply = strcat(maplist_reply, col, argv(i), " "); - ++j; - } - } - maplist_reply = strzone(strcat(maplist_reply, "\n")); - MapInfo_ClearTemps(); - + maplist_reply = strzone(getmaplist()); + lsmaps_reply = strzone(getlsmaps()); for(i = 0; i < 10; ++i) { s = getrecords(i); if (s) records_reply[i] = strzone(s); } - ladder_reply = strzone(getladder()); - rankings_reply = strzone(getrankings()); // begin other init @@ -879,7 +850,7 @@ void spawnfunc_worldspawn (void) s = ""; n = tokenize_console(cvar_string("sv_curl_serverpackages")); for(i = 0; i < n; ++i) - if(substring(argv(i), -14, -1) != "-serverpackage.txt") + if(substring(argv(i), -18, -1) != "-serverpackage.txt") if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy s = strcat(s, " ", argv(i)); fd = search_begin("*-serverpackage.txt", TRUE, FALSE);