]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a way for the server to know whether or not it is a "local" server
authorSamual Lenks <samual@xonotic.org>
Mon, 24 Sep 2012 22:17:25 +0000 (18:17 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 24 Sep 2012 22:17:25 +0000 (18:17 -0400)
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh

index 9d6bcf798d8b3026e6fb542731491923ba99b715..b623bd28d54cae53bd0ef3a3fa2d1f0259af994c 100644 (file)
@@ -1363,6 +1363,16 @@ void ClientConnect (void)
        self.flags = FL_CLIENT;
        self.version_nagtime = time + 10 + random() * 10;
 
+       if(self.netaddress == "local")
+       {
+               print("^3server is local!\n");
+
+               if(server_is_local)
+                       error("Multiple local clients???");
+               else
+                       server_is_local = TRUE;
+       }
+
        if(player_count<0)
        {
                dprint("BUG player count is lower than zero, this cannot happen!\n");
index 9068fa75bf53e95400df5e635e8551faa3ae3a2c..26d55068e21bcdd24da30136eee9621b24aa6fbf 100644 (file)
@@ -58,6 +58,8 @@ float team1_score, team2_score, team3_score, team4_score;
 
 float maxclients;
 
+float server_is_local; // innocent until proven guilty by ClientConnect() in cl_client.qc
+
 // Fields
 
 .void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;