• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Saving gamestate on a seperate thread

klanton

New Member
Joined
Jul 6, 2023
Messages
6
Reaction score
0
GitHub
taco93
Hello, very new to the TFS community. Doing this as a side project/hobby after hours off work... What I'm considering now is how to maintain an up-to-date database if something would to happen with the server. I know I can catch signals and before closing the server I can save the current gamestate. But what if something unforseen, like poweroutage or similar to that happens. I don't know if this is a completely foolish but would it be possible to spin up a thread that saves the game every 1-3 minutes to minimize the rollback that could happen. By doing this we would open up to read/writes simultaniously from the database which is not going to be acceptable. What solutions are out there currently and what do you propose can be done?
 
Hello, very new to the TFS community. Doing this as a side project/hobby after hours off work... What I'm considering now is how to maintain an up-to-date database if something would to happen with the server. I know I can catch signals and before closing the server I can save the current gamestate. But what if something unforseen, like poweroutage or similar to that happens. I don't know if this is a completely foolish but would it be possible to spin up a thread that saves the game every 1-3 minutes to minimize the rollback that could happen. By doing this we would open up to read/writes simultaniously from the database which is not going to be acceptable. What solutions are out there currently and what do you propose can be done?
Solution is to automatically save the database in "x" time, if something happens, you don't lose the game process.
 
I have thought about it and I notice that TFS have really bad optimizations of the database. Dropping and inserting on relog no caching at all, so I think I'm going a different route.
 
Back
Top