There is 4 years old Issue on github about it:
There are some conceptions, but zero code to fix this issue. Kondrah made code for it, but he sells it for 500$.
I'm bored of writing code for servers for money.
I decided to write fix for it and release it on GitHub.
My current conception (60% of code is ready and tested on 1.3)
Player items cache - load player items once per server restart, save them in asynchronous thread.
Player items binary format in database - save and load player items up to 10 times faster.
Items = all player items: 'on player', depots and inbox.
Looking for better ideas and comments after I release code (probably on 2019-09-06).
Anyone interested in sending me some donations for releasing high quality code on GitHub?
Lag from excessive items in containers [$10] · Issue #1150 · otland/forgottenserver
Sorry, the bug was caused by excessive items in the mail box ... if you can limit it would be great. The player was with some 70 thousand label in the mail box when the player entered the server wa...
github.com
There are some conceptions, but zero code to fix this issue. Kondrah made code for it, but he sells it for 500$.
I'm bored of writing code for servers for money.
I decided to write fix for it and release it on GitHub.
My current conception (60% of code is ready and tested on 1.3)
Player items cache - load player items once per server restart, save them in asynchronous thread.
Player items binary format in database - save and load player items up to 10 times faster.
Items = all player items: 'on player', depots and inbox.
- Keep items copies in RAM in objects PlayerCacheData*. [DONE]
- On player load, check, if there are items in cache for given GUID. If there are, copy them into Player*. If not, load from database and put copy in PlayerCacheData*. [DONE]
- On player save, copy Player* items into PlayerCacheData*. Add given PlayerCacheData* to 'items to save queue'. [DONE]
- New thread (added to TFS) will save items from PlayerCacheData* to database. Class similar to DatabaseTasks, running on own DB connection. [DONE]
- Add option to save items in database in binary format. [tested on Kasteria.pl, not implemented for TFS 1.3 yet]
- Add LUA functions to manipulate cache:
- possibility to load all players items in 'onStartup' event
- possibility to load all players items to cache, change config.lua to make it use 'binary save' and save all cache to database = change database from relational to binary on running server
Looking for better ideas and comments after I release code (probably on 2019-09-06).
Anyone interested in sending me some donations for releasing high quality code on GitHub?