Each game loop OTTD receives only one UDP packet per socket. Is there any reason for that? Why not receive all available packets?
I'm finding it problematic. When we want to fill the multiplayer list of network games, a query is sent to the master server. Master server replies with a list of available servers. Then we send a query to each server and wait for replies. UDP packets may not reach the target so if a certain server is not responding a query is repeated every 60 game loops (maximally 10 times). During 60 game loops we may receive only 60 packets but there are more then 200 servers currently! What is happening after first 60 loops? Our client re-queries servers even though the answers already arrived. This generates more and more queries and answers. There flow about 5 times more packets then required and the list of game servers fills up about 5 times slower then it could.
This becomes more problematic in case of my multiplayer server list patch because I'm marking a certain server as "offline" if it does not reply for 180 (3*60) game loops.
I want to change the way OTTD receives UDP packets. But what should I do? Should I receive all available packets every game loop? Or maybe only a fixed amount of them? Should I change the behaviour for every UDP socket or maybe just for the client socket? What are the risks that can arise?
Receiving UDP packets - only one per game loop, but why?
Moderator: OpenTTD Developers
Receiving UDP packets - only one per game loop, but why?
don't worry, be happy and checkout my patches
Re: Receiving UDP packets - only one per game loop, but why?
The only risk I can think of is DoS via UDP packets. The rest should/could be answered by r24532.
Re: Receiving UDP packets - only one per game loop, but why?
Very nice!Rubidium wrote:The rest should/could be answered by r24532.
don't worry, be happy and checkout my patches
Re: Receiving UDP packets - only one per game loop, but why?
Impressive find, and what a silly bug / brainfart Hihi
The only thing necessary for the triumph of evil is for good men to do nothing.
Who is online
Users browsing this forum: No registered users and 45 guests