OpenTTD

Tasklist

FS#3062 - Not all servers added manually are saved in configuration

Attached to Project: OpenTTD
Opened by Grzegorz DuczyƄski (adf88) - Wednesday, 29 July 2009, 08:25 GMT
Last edited by Remko Bijker (Rubidium) - Wednesday, 29 July 2009, 16:45 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Severs added manually are stored in _network_host_list table which is saved in configuration file when closing ottd. But lastly added server do not land in this table until we delete some sever or add new manual server. It's because _network_host_list is rebuilt before manual server appears in master server list:

NetworkGameWindow::OnQueryTextFinished //we entered new manual server
NetworkAddServer
NetworkUDPQueryServer
start new thread(NetworkUDPQueryServerThread) //create new thread for socket communication
NetworkRebuildHostList //rebuild _network_host_list table, but new server is not yet added
...
(in new thread)
NetworkUDPQueryServerThread
NetworkGameListAddItemDelayed //add new server to delayed insert list
...
(in next tick)
NetworkGameListHandleDelayedInsert //handle delayed inserts
NetworkGameListAddItem //add new server to master list

Possible solution:
Call NetworkRebuildHostList inside NetworkGameListHandleDelayedInsert when handling manual server insertion

This task depends upon

Closed by  Remko Bijker (Rubidium)
Wednesday, 29 July 2009, 16:45 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r16981

Loading...