X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Frace.qc;h=f66ca7c8df8e7280ccd7c47955f48fa8649fd6cd;hb=f64d037f9d2f38d874422e04d6147c1876a1c829;hp=9a12a04866c2c251fdd333725f0a22c4af757fff;hpb=cbb0a16ac5554caedc4af3d81ff857c40eb9bdb9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 9a12a0486..f66ca7c8d 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -1,26 +1,66 @@ #include "race.qh" -#include -#include -#include "client.qh" -#include "portals.qh" -#include "scores.qh" -#include "spawnpoints.qh" -#include "bot/api.qh" -#include "command/getreplies.qh" -#include "../common/deathtypes/all.qh" -#include "../common/notifications/all.qh" -#include "../common/mapinfo.qh" +#include +#include #include +#include +#include +#include #include +#include #include -#include -#include "../common/mapobjects/subs.qh" -#include -#include "../lib/warpzone/util_server.qh" -#include "../lib/warpzone/common.qh" +#include #include -#include "../common/mutators/mutator/waypoints/waypointsprites.qh" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +string uid2name(string myuid) +{ + string s = db_get(ServerProgsDB, strcat("/uid2name/", myuid)); + + // FIXME remove this later after 0.6 release + // convert old style broken records to correct style + if(s == "") + { + s = db_get(ServerProgsDB, strcat("uid2name", myuid)); + if(s != "") + { + db_put(ServerProgsDB, strcat("/uid2name/", myuid), s); + db_remove(ServerProgsDB, strcat("uid2name", myuid)); + } + } + + if(s == "") + s = "^1Unregistered Player"; + return s; +} + +void write_recordmarker(entity pl, float tstart, float dt) +{ + GameLogEcho(strcat(":recordset:", ftos(pl.playerid), ":", ftos(dt))); + + // also write a marker into demo files for demotc-race-record-extractor to find + stuffcmd(pl, + strcat( + strcat("//", strconv(2, 0, 0, GetGametype()), " RECORD SET ", TIME_ENCODED_TOSTRING(TIME_ENCODE(dt))), + " ", ftos(tstart), " ", ftos(dt), "\n")); +} IntrusiveList g_race_targets; IntrusiveList g_racecheckpoints; @@ -767,7 +807,7 @@ void trigger_race_checkpoint_verify(entity this) // race only (middle of the race) g_race_qualifying = false; pl_race_place = 0; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for respawning in race) - bailing out")); } @@ -775,7 +815,7 @@ void trigger_race_checkpoint_verify(entity this) // qualifying only g_race_qualifying = 1; pl_race_place = race_lowest_place_spawn; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out")); } @@ -783,7 +823,7 @@ void trigger_race_checkpoint_verify(entity this) g_race_qualifying = 0; for (int p = 1; p <= race_highest_place_spawn; ++p) { pl_race_place = p; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for initially spawning in race) - bailing out")); } } @@ -794,7 +834,7 @@ void trigger_race_checkpoint_verify(entity this) pl_race_checkpoint = race_NextCheckpoint(0); g_race_qualifying = 1; pl_race_place = race_lowest_place_spawn; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint 0 misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out")); } } else {