Performance: fixed server's big memory usage in long games and in big stack sizes (related to #11285, fixes #9302)

This commit is contained in:
Oleg Agafonov 2023-10-14 15:54:10 +04:00
parent 36ccfb0a2a
commit d57a3c100d
7 changed files with 107 additions and 61 deletions

View file

@ -488,12 +488,29 @@ public interface Game extends MageItem, Serializable, Copyable<Game> {
//game transaction methods
void saveState(boolean bookmark);
/**
* Save current game state and return bookmark to it
*
* @return
*/
int bookmarkState();
GameState restoreState(int bookmark, String context);
/**
* Remove selected bookmark and all newer bookmarks and game states
* Part of restore/rollback lifecycle
*
* @param bookmark
*/
void removeBookmark(int bookmark);
/**
* TODO: remove logic changed, must research each usage of removeBookmark and replace it with new code
* @param bookmark
*/
void removeBookmark_v2(int bookmark);
int getSavedStateSize();
boolean isSaveGame();