-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving & loading game state on bot restart #13
Comments
There is a RPGram/src/main/java/rpgram/RPGram.java Lines 128 to 134 in d439c7a
Edit: OK. In #12 there is that line: I think, when bot is restarted, |
We should save game state somewhere (e.g. to a database) periodically or keep the actual state here altogether. A more fast solution could be that we should notify the player that the bot was restarted and ask his/her to re-start game by issuing |
Saving a game state using a manually written logic is a hell of a job. After each addition to the game (e.g. new player property, new thing, etc) manual serialization logic should be updated too. Recently I looked at https://github.com/EsotericSoftware/kryo, but was not able to integrate it to my branch yet. Seems like The https://github.com/kostaskougios/cloning library is powerful enough to clone the entire game state automagically, but it is not purposed for serialization, only for cloning. I will continue the investigation, but later. If no serialization library will be found, manual serializing may be considered as a last resort... |
When bot is restarted and a user tries to interact with it, the bot produces the following error:
If the user issues
/start
command after restart, the error does not occur.The text was updated successfully, but these errors were encountered: