entity player = M_ARGV(0, entity);
- if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
- {
- if (!player.stored_netname)
- player.stored_netname = strzone(uid2name(player.crypto_idfp));
- if(player.stored_netname != player.netname)
- {
- db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
- strcpy(player.stored_netname, player.netname);
- }
- }
+ race_checkAndWriteName(player);
}
MUTATOR_HOOKFUNCTION(ctf, PortalTeleport)
{
entity player = M_ARGV(0, entity);
- if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
- {
- if (!player.stored_netname)
- player.stored_netname = strzone(uid2name(player.crypto_idfp));
- if(player.stored_netname != player.netname)
- {
- db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
- strcpy(player.stored_netname, player.netname);
- }
- }
+ race_checkAndWriteName(player);
if (!IS_OBSERVER(player))
{
{
entity player = M_ARGV(0, entity);
- if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
- {
- if (!player.stored_netname)
- player.stored_netname = strzone(uid2name(player.crypto_idfp));
- if(player.stored_netname != player.netname)
- {
- db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
- strcpy(player.stored_netname, player.netname);
- }
- }
+ race_checkAndWriteName(player);
if (!IS_OBSERVER(player))
{
#include <server/weapons/common.qh>
#include <server/world.qh>
+.string stored_netname; // TODO: store this information independently of race-based gamemodes
+
string uid2name(string myuid)
{
string s = db_get(ServerProgsDB, strcat("/uid2name/", myuid));
return uid2name(db_get(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(pos))));
}
+void race_checkAndWriteName(entity player)
+{
+ if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
+ {
+ if (!player.stored_netname)
+ player.stored_netname = strzone(uid2name(player.crypto_idfp));
+ if(player.stored_netname != player.netname)
+ {
+ db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
+ strcpy(player.stored_netname, player.netname);
+ }
+ }
+}
+
const float MAX_CHECKPOINTS = 255;
bool autocvar_g_allow_checkpoints;
-.string stored_netname; // TODO: store this information independently of race-based gamemodes
-
float race_teams;
// scores
float race_readTime(string map, float pos);
string race_readUID(string map, float pos);
string race_readName(string map, float pos);
+void race_checkAndWriteName(entity player);
void race_ClearRecords();
void race_SendNextCheckpoint(entity e, float spec);
void race_PreparePlayer(entity this);