1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-26 13:44:16 +01:00

(svn r16060) [0.7] -Backport from trunk:

- Fix: Storing/loading some currencies failed due to inconsistent settings "tables" [FS#2826] (r16028)
- Fix: Usage of uninitialised memory when trying to build a random new industry, but there are no industrytypes to choose from (i.e. all appearance probabilities are zero) (r16027)
- Fix: "Build separate station" in the station picker would reuse deleted stations [FS#2818] (r16025)
- Fix: 32 bpp sprites in tars would also be shown in the list of heightmaps [FS#2817] (r16023)
- Fix: Sometimes the unregister "query" thread could be delayed so much that the network stuff was already closed and the packet would never reach the master server causing the server to appear online longer than necessary (r16022)
- Fix: Chance16() did not work for b = 1. Also transform the formula to not use divisions (r16006)
This commit is contained in:
rubidium
2009-04-14 21:13:07 +00:00
parent 9f5e690118
commit 60901368cc
11 changed files with 91 additions and 35 deletions

View File

@@ -53,7 +53,7 @@ DEF_UDP_RECEIVE_COMMAND(Master, PACKET_UDP_MASTER_ACK_REGISTER)
DEBUG(net, 2, "[udp] advertising on master server successful");
/* We are advertised, but we don't want to! */
if (!_settings_client.network.server_advertise) NetworkUDPRemoveAdvertise();
if (!_settings_client.network.server_advertise) NetworkUDPRemoveAdvertise(false);
}
///*** Communication with clients (we are server) ***/
@@ -497,8 +497,11 @@ void NetworkUDPRemoveAdvertiseThread(void *pntr)
_network_udp_mutex->EndCritical();
}
/* Remove our advertise from the master-server */
void NetworkUDPRemoveAdvertise()
/**
* Remove our advertise from the master-server.
* @param blocking whether to wait until the removal has finished.
*/
void NetworkUDPRemoveAdvertise(bool blocking)
{
/* Check if we are advertising */
if (!_networking || !_network_server || !_network_udp_server) return;
@@ -508,7 +511,7 @@ void NetworkUDPRemoveAdvertise()
if (!_udp_master_socket->Listen(_network_server_bind_ip, 0, false)) return;
}
if (!ThreadObject::New(NetworkUDPRemoveAdvertiseThread, NULL)) {
if (blocking || !ThreadObject::New(NetworkUDPRemoveAdvertiseThread, NULL)) {
NetworkUDPRemoveAdvertiseThread(NULL);
}
}