• R/O
  • SSH

zandronum-zdoom-sync: Commit


Commit MetaInfo

Revisiondb61057d8c7976cd979f7b4e5d41aff8288bba75 (tree)
Time2008-02-25 00:35:44
AuthorBenjamin Berkels <torr.samaho@quan...>
CommiterBenjamin Berkels

Log Message

Fixed: Every LAN broadcast called gethostname() to get the local IP. This could lead to serious lag on servers.

SVN r1214 (trunk)

Change Summary

Incremental Difference

diff -r 7e48a662b8ea -r db61057d8c79 docs/Skulltag Version History.txt
--- a/docs/Skulltag Version History.txt Sun Feb 24 10:20:24 2008 +0000
+++ b/docs/Skulltag Version History.txt Sun Feb 24 15:35:44 2008 +0000
@@ -281,6 +281,7 @@
281281 - - 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]
282282 - - 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]
283283 - - 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]
284285 ! - Survival co-op is now disabled in hubs. [Carnevil]
285286 ! - Skulltag's invasion spawners are now defined in skulltag.pk3. [Carnevil]
286287 ! - Skulltag.wad is now loaded before doom2.wad. This should fix certain texture errors. [Carnevil]
diff -r 7e48a662b8ea -r db61057d8c79 src/network.cpp
--- a/src/network.cpp Sun Feb 24 10:20:24 2008 +0000
+++ b/src/network.cpp Sun Feb 24 15:35:44 2008 +0000
@@ -143,6 +143,9 @@
143143 // Buffer for the Huffman encoding.
144144 static UCHAR g_ucHuffmanBuffer[131072];
145145
146+// Our local address;
147+NETADDRESS_s g_LocalAddress;
148+
146149 //*****************************************************************************
147150 // PROTOTYPES
148151
@@ -158,7 +161,6 @@
158161 char szString[128];
159162 ULONG ulArg;
160163 USHORT usNewPort;
161- NETADDRESS_s LocalAddress;
162164 bool bSuccess;
163165
164166 // Initialize the Huffman buffer.
@@ -226,12 +228,12 @@
226228 NETWORK_ClearBuffer( &g_NetworkMessage );
227229
228230 // 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 ));
231233
232234 // If hosting, update the server GUI.
233235 if( NETWORK_GetState() == NETSTATE_SERVER )
234- SERVERCONSOLE_UpdateIP( LocalAddress );
236+ SERVERCONSOLE_UpdateIP( g_LocalAddress );
235237
236238 // Call NETWORK_Destruct() when Skulltag closes.
237239 atterm( NETWORK_Destruct );
diff -r 7e48a662b8ea -r db61057d8c79 src/sv_master.cpp
--- a/src/sv_master.cpp Sun Feb 24 10:20:24 2008 +0000
+++ b/src/sv_master.cpp Sun Feb 24 15:35:44 2008 +0000
@@ -84,6 +84,8 @@
8484 static LONG g_lStoredQueryIPHead;
8585 static LONG g_lStoredQueryIPTail;
8686
87+extern NETADDRESS_s g_LocalAddress;
88+
8789 //*****************************************************************************
8890 // FUNCTIONS
8991
@@ -206,11 +208,9 @@
206208 // Class B contains networks 128.0.0.0 through 191.255.0.0; the network number is in the first two octets.
207209 // Class C networks range from 192.0.0.0 through 223.255.255.0, with the network number contained in the first three octets.
208210
209-
210- NETADDRESS_s LocalAddress = NETWORK_GetLocalAddress( );
211211 int classIndex = 0;
212212
213- const int locIP0 = LocalAddress.abIP[0];
213+ const int locIP0 = g_LocalAddress.abIP[0];
214214 if ( (locIP0 >= 1) && (locIP0 <= 127) )
215215 classIndex = 1;
216216 else if ( (locIP0 >= 128 ) && (locIP0 <= 191) )
@@ -219,7 +219,7 @@
219219 classIndex = 3;
220220
221221 for( int i = 0; i < classIndex; i++ )
222- AddressBroadcast.abIP[i] = LocalAddress.abIP[i];
222+ AddressBroadcast.abIP[i] = g_LocalAddress.abIP[i];
223223
224224 // Broadcast our packet.
225225 SERVER_MASTER_SendServerInfo( AddressBroadcast, SQF_ALL, 0, true );
Show on old repository browser