[crossfire] Handling massive loot

Nicolas Weeger nicolas.weeger at laposte.net
Mon Mar 22 13:58:30 CDT 2021


Hello.

One issue that happens is server delays when dealing with big loot.

For instance a player selling some thousands rods can stuck the server for 
some seconds... Or even dropping many items on a big pile can be quite slow.


So to handle that correctly, I was thinking of changing the server code like 
that:

- split data/commands reception and processing - have one loop that reads from 
the socket, put commands in a waiting queue, then another function later 
processes those commands

- for commands like pick/drop/examine, enable them to work on multiple 
processing loops instead of a single. So for instance the command would drop 
100 items, then store its status, put itself back on top of the command 
waiting queue, and exit - this way the server can process something else.



For the player, it means picking/dropping a big pile of items may take some 
time, but the server will go on for other players during that time.


Does that sound ok?


Best regards

Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20210322/8c30c5d1/attachment.sig>


More information about the crossfire mailing list