X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Frace.qh;h=472827efa4a81d13a014ae84d998f1b88d62628f;hb=d865de7a9a17c5a1d9286aec40f68c3530697660;hp=b51c1a9c749ed0ae05d596b8d0ae988ea5ccdedc;hpb=451382be257bcb485a1ada1872bfdf2f18769051;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/race.qh b/qcsrc/server/race.qh index b51c1a9c7..472827efa 100644 --- a/qcsrc/server/race.qh +++ b/qcsrc/server/race.qh @@ -1,5 +1,14 @@ -#ifndef RACE_H -#define RACE_H +#pragma once + +float race_teams; + +// scores +const float ST_RACE_LAPS = 1; + +bool g_race_qualifying; + +float speedaward_lastsent; +float speedaward_lastupdate; float race_spawns; float race_highest_place_spawn; // number of places; a place higher gets spawned at 0 @@ -10,6 +19,7 @@ float race_timelimit; .float race_place; .float race_started; .float race_completed; +.float race_laptime; float race_completing; .float race_movetime; // for reading @@ -19,6 +29,9 @@ float race_completing; .float race_respawn_checkpoint; .entity race_respawn_spotref; // try THIS spawn in case you respawn +IntrusiveList g_racecheckpoints; +STATIC_INIT(g_racecheckpoints) { g_racecheckpoints = IL_NEW(); } + // definitions for functions used outside race.qc float race_PreviousCheckpoint(float f); float race_NextCheckpoint(float f); @@ -29,40 +42,27 @@ float race_GetFractionalLapCount(entity e); float race_readTime(string map, float pos); string race_readUID(string map, float pos); string race_readName(string map, float pos); +void race_ClearRecords(); +void race_SendNextCheckpoint(entity e, float spec); +void race_PreparePlayer(entity this); +void race_send_recordtime(float msg); +void race_send_speedaward(float msg); +void race_setTime(string map, float t, string myuid, string mynetname, entity e, bool showmessage); - -#ifdef SVQC float speedaward_speed; string speedaward_holder; string speedaward_uid; -#endif -void race_send_speedaward(float msg) -{ -#ifdef SVQC - // send the best speed of the round - WriteByte(msg, SVC_TEMPENTITY); - WriteByte(msg, TE_CSQC_RACE); - WriteByte(msg, RACE_NET_SPEED_AWARD); - WriteInt24_t(msg, floor(speedaward_speed+0.5)); - WriteString(msg, speedaward_holder); -#endif -} - -#ifdef SVQC + float speedaward_alltimebest; string speedaward_alltimebest_holder; string speedaward_alltimebest_uid; -#endif -void race_send_speedaward_alltimebest(float msg) -{ -#ifdef SVQC - // send the best speed - WriteByte(msg, SVC_TEMPENTITY); - WriteByte(msg, TE_CSQC_RACE); - WriteByte(msg, RACE_NET_SPEED_AWARD_BEST); - WriteInt24_t(msg, floor(speedaward_alltimebest+0.5)); - WriteString(msg, speedaward_alltimebest_holder); -#endif -} - -#endif + +void race_send_speedaward(float msg); + +void race_send_speedaward_alltimebest(float msg); + +void race_SendRankings(float pos, float prevpos, float del, float msg); + +void race_RetractPlayer(entity this); + +void race_InitSpectator();