This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).
Revision | db61057d8c7976cd979f7b4e5d41aff8288bba75 (tree) |
---|---|
Time | 2008-02-25 00:35:44 |
Author | Benjamin Berkels <torr.samaho@quan...> |
Commiter | Benjamin Berkels |
Fixed: Every LAN broadcast called gethostname() to get the local IP. This could lead to serious lag on servers.
SVN r1214 (trunk)
@@ -281,6 +281,7 @@ | ||
281 | 281 | - - Fixed: When trying to refresh the server list in the internal server browser more than once within 10 seconds, you got a "Unknown command from master server: 4" message instead of a proper warning. [Torr Samaho] |
282 | 282 | - - Fixed: When selecting a powered weapon with "weapnext" or "weapprev" the name of the non-powered version of the weapon was displayed (in case cl_showweapnameoncycle is set to true). [Torr Samaho] |
283 | 283 | - - Fixed: Using addbot on a map with no appropriate player starts for the selected game mode leads to a crash. [Torr Samaho] |
284 | +- - Fixed: Every LAN broadcast called gethostname() to get the local IP. This could lead to serious lag on servers. [Torr Samaho] | |
284 | 285 | ! - Survival co-op is now disabled in hubs. [Carnevil] |
285 | 286 | ! - Skulltag's invasion spawners are now defined in skulltag.pk3. [Carnevil] |
286 | 287 | ! - Skulltag.wad is now loaded before doom2.wad. This should fix certain texture errors. [Carnevil] |
@@ -143,6 +143,9 @@ | ||
143 | 143 | // Buffer for the Huffman encoding. |
144 | 144 | static UCHAR g_ucHuffmanBuffer[131072]; |
145 | 145 | |
146 | +// Our local address; | |
147 | +NETADDRESS_s g_LocalAddress; | |
148 | + | |
146 | 149 | //***************************************************************************** |
147 | 150 | // PROTOTYPES |
148 | 151 |
@@ -158,7 +161,6 @@ | ||
158 | 161 | char szString[128]; |
159 | 162 | ULONG ulArg; |
160 | 163 | USHORT usNewPort; |
161 | - NETADDRESS_s LocalAddress; | |
162 | 164 | bool bSuccess; |
163 | 165 | |
164 | 166 | // Initialize the Huffman buffer. |
@@ -226,12 +228,12 @@ | ||
226 | 228 | NETWORK_ClearBuffer( &g_NetworkMessage ); |
227 | 229 | |
228 | 230 | // Print out our local IP address. |
229 | - LocalAddress = NETWORK_GetLocalAddress( ); | |
230 | - Printf( "IP address %s\n", NETWORK_AddressToString( LocalAddress )); | |
231 | + g_LocalAddress = NETWORK_GetLocalAddress( ); | |
232 | + Printf( "IP address %s\n", NETWORK_AddressToString( g_LocalAddress )); | |
231 | 233 | |
232 | 234 | // If hosting, update the server GUI. |
233 | 235 | if( NETWORK_GetState() == NETSTATE_SERVER ) |
234 | - SERVERCONSOLE_UpdateIP( LocalAddress ); | |
236 | + SERVERCONSOLE_UpdateIP( g_LocalAddress ); | |
235 | 237 | |
236 | 238 | // Call NETWORK_Destruct() when Skulltag closes. |
237 | 239 | atterm( NETWORK_Destruct ); |
@@ -84,6 +84,8 @@ | ||
84 | 84 | static LONG g_lStoredQueryIPHead; |
85 | 85 | static LONG g_lStoredQueryIPTail; |
86 | 86 | |
87 | +extern NETADDRESS_s g_LocalAddress; | |
88 | + | |
87 | 89 | //***************************************************************************** |
88 | 90 | // FUNCTIONS |
89 | 91 |
@@ -206,11 +208,9 @@ | ||
206 | 208 | // Class B contains networks 128.0.0.0 through 191.255.0.0; the network number is in the first two octets. |
207 | 209 | // Class C networks range from 192.0.0.0 through 223.255.255.0, with the network number contained in the first three octets. |
208 | 210 | |
209 | - | |
210 | - NETADDRESS_s LocalAddress = NETWORK_GetLocalAddress( ); | |
211 | 211 | int classIndex = 0; |
212 | 212 | |
213 | - const int locIP0 = LocalAddress.abIP[0]; | |
213 | + const int locIP0 = g_LocalAddress.abIP[0]; | |
214 | 214 | if ( (locIP0 >= 1) && (locIP0 <= 127) ) |
215 | 215 | classIndex = 1; |
216 | 216 | else if ( (locIP0 >= 128 ) && (locIP0 <= 191) ) |
@@ -219,7 +219,7 @@ | ||
219 | 219 | classIndex = 3; |
220 | 220 | |
221 | 221 | for( int i = 0; i < classIndex; i++ ) |
222 | - AddressBroadcast.abIP[i] = LocalAddress.abIP[i]; | |
222 | + AddressBroadcast.abIP[i] = g_LocalAddress.abIP[i]; | |
223 | 223 | |
224 | 224 | // Broadcast our packet. |
225 | 225 | SERVER_MASTER_SendServerInfo( AddressBroadcast, SQF_ALL, 0, true ); |