-
Notifications
You must be signed in to change notification settings - Fork 55
Save logging + Fixes #473
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
Merged
Merged
Save logging + Fixes #473
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
658e5c7
Add save logging + cutup save code
PsyCommando 788c24a
Save error tolerance admin verb
PsyCommando 1a90460
Update misc.dm
PsyCommando f01b165
Reorganized and moved saving code
PsyCommando 11f0520
Update persistence.dm
PsyCommando 33618e2
Moved save statistics to own file
PsyCommando 3df9239
Moved limbo stuff to it's own file
PsyCommando a959439
Began moving save loading code to new file
PsyCommando 89285fd
Update persistence.dm
PsyCommando d482ed7
Fix mimic_edge saving
PsyCommando 6286524
fixed save text being hard to read in darkmode
PsyCommando 25d83b4
Moved and cut up world loading code
PsyCommando 8d63bcd
TEMPORARY fix for debugger not working
PsyCommando 946e78e
Formatting
PsyCommando 8019373
Fix map not loading at the right zlevel
PsyCommando e47b688
Make planetoid_data load properly
PsyCommando 6b5822b
Update check-paths.sh
PsyCommando 27ecd4d
Revert "TEMPORARY fix for debugger not working"
PsyCommando 1d476d8
Move last save display to persistent modpack
PsyCommando 687a720
Fix loading save not filling saved_levels
PsyCommando 1ee5c7a
Removed duplicate cleanup
PsyCommando 032664a
Throw the save/load exception if any
PsyCommando 4d9569c
Cleanup save debug objects a bit
PsyCommando 6b993b2
changed comments
PsyCommando ab593e6
Added configuration hooks for persistence configs
PsyCommando 4d56d08
Used a stub system for config
PsyCommando 46f802c
updated config example
PsyCommando a8510cb
Clarified comment on autosave config
PsyCommando File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| /proc/report_progress_serializer(var/progress_message) | ||
| admin_notice("<span class='boldannounce' style='color:\"purple\";'>[progress_message]</span>", R_DEBUG) | ||
| to_world_log(progress_message) | ||
| admin_notice(SPAN_SERIALIZER(progress_message), R_DEBUG) | ||
| to_world_log(SPAN_SERIALIZER(progress_message)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,65 @@ | ||
| /* | ||
| Serialized type names | ||
| */ | ||
| #define SERIALIZER_TYPE_NULL "NULL" | ||
| #define SERIALIZER_TYPE_VAR "VAR" | ||
| #define SERIALIZER_TYPE_TEXT "TEXT" | ||
| #define SERIALIZER_TYPE_NUM "NUM" | ||
| #define SERIALIZER_TYPE_PATH "PATH" | ||
| #define SERIALIZER_TYPE_FILE "FILE" | ||
| #define SERIALIZER_TYPE_WRAPPER "WRAP" | ||
| #define SERIALIZER_TYPE_LIST "LIST" | ||
| #define SERIALIZER_TYPE_LIST_EMPTY "EMPTY" | ||
| #define SERIALIZER_TYPE_DATUM "OBJ" | ||
| #define SERIALIZER_TYPE_DATUM_FLAT "FLAT_OBJ" | ||
| #define SERIALIZER_TYPE_FLAT_REF "FLAT_REF" | ||
|
|
||
| /* | ||
| SQL table names | ||
| */ | ||
| #define SQLS_TABLE_DATUM "thing" | ||
| #define SQLS_TABLE_DATUM_VARS "thing_var" | ||
| #define SQLS_TABLE_LIST_ELEM "list_element" | ||
| #define SQLS_TABLE_Z_LEVELS "z_level" | ||
| #define SQLS_TABLE_AREAS "areas" | ||
| #define SQLS_TABLE_LIMBO "limbo" | ||
| #define SQLS_TABLE_LIMBO_DATUM "limbo_thing" | ||
| #define SQLS_TABLE_LIMBO_DATUM_VARS "limbo_thing_var" | ||
| #define SQLS_TABLE_LIMBO_LIST_ELEM "limbo_list_element" | ||
| ///A macro for getting the current save DB name | ||
| #define SQLS_SAVE_DATABASE global.sqldb | ||
|
|
||
| ///////////////////////////////////////////////////////// | ||
| // Serialized type names | ||
| ///////////////////////////////////////////////////////// | ||
|
|
||
| #define SERIALIZER_TYPE_NULL "NULL" | ||
| #define SERIALIZER_TYPE_VAR "VAR" | ||
| #define SERIALIZER_TYPE_TEXT "TEXT" | ||
| #define SERIALIZER_TYPE_NUM "NUM" | ||
| #define SERIALIZER_TYPE_PATH "PATH" | ||
| #define SERIALIZER_TYPE_FILE "FILE" | ||
| #define SERIALIZER_TYPE_WRAPPER "WRAP" | ||
| #define SERIALIZER_TYPE_LIST "LIST" | ||
| #define SERIALIZER_TYPE_LIST_EMPTY "EMPTY" | ||
| #define SERIALIZER_TYPE_DATUM "OBJ" | ||
| #define SERIALIZER_TYPE_DATUM_FLAT "FLAT_OBJ" | ||
| #define SERIALIZER_TYPE_FLAT_REF "FLAT_REF" | ||
|
|
||
| ///////////////////////////////////////////////////////// | ||
| // SQL table names | ||
| ///////////////////////////////////////////////////////// | ||
|
|
||
| #define SQLS_TABLE_DATUM "thing" | ||
| #define SQLS_TABLE_DATUM_VARS "thing_var" | ||
| #define SQLS_TABLE_LIST_ELEM "list_element" | ||
| #define SQLS_TABLE_Z_LEVELS "z_level" | ||
| #define SQLS_TABLE_AREAS "areas" | ||
| #define SQLS_TABLE_LIMBO "limbo" | ||
| #define SQLS_TABLE_LIMBO_DATUM "limbo_thing" | ||
| #define SQLS_TABLE_LIMBO_DATUM_VARS "limbo_thing_var" | ||
| #define SQLS_TABLE_LIMBO_LIST_ELEM "limbo_list_element" | ||
|
|
||
| ///////////////////////////////////////////////////////// | ||
| // SQL Stored Functions Names | ||
| ///////////////////////////////////////////////////////// | ||
|
|
||
| ///Name of the stored function that returns the time we last made a world save from the db. | ||
| #define SQLS_FUNC_GET_LAST_SAVE_TIME "GetLastWorldSaveTime" | ||
| ///Log to the table when a world save begins, returns the current save log id. | ||
| #define SQLS_FUNC_LOG_SAVE_WORLD_START "LogSaveWorldStart" | ||
| ///Log to the table when a limbo/storage save begins, returns the current save log id. | ||
| #define SQLS_FUNC_LOG_SAVE_STORAGE_START "LogSaveStorageStart" | ||
| ///Log to the table when any save ends, returns the current save log id. | ||
| #define SQLS_FUNC_LOG_SAVE_END "LogSaveEnd" | ||
|
|
||
| ///////////////////////////////////////////////////////// | ||
| // SQL Stored Procedures Names | ||
| ///////////////////////////////////////////////////////// | ||
|
|
||
| ///Delete the current world save from the db, so we can write a newer one. Procedures are executed with CALL, and don't return anything. | ||
| #define SQLS_PROC_CLEAR_WORLD_SAVE "ClearWorldSave" | ||
|
|
||
| ///////////////////////////////////////////////////////// | ||
| // SQL Helpers | ||
| ///////////////////////////////////////////////////////// | ||
|
|
||
| ///A helper for executing a sql query and throwing the proper exception with a standardized error message. QUERY must be a variable. | ||
| #define SQLS_EXECUTE_AND_REPORT_ERROR(QUERY, ERRORMSG)\ | ||
| if(!QUERY.Execute()){\ | ||
| var/errormsg = ERRORMSG + " '[QUERY.ErrorMsg()]'"; \ | ||
| var/errormsg = ERRORMSG + " '[QUERY.ErrorMsg()]'" + "\n'[QUERY.sql]'"; \ | ||
| to_world_log(errormsg);\ | ||
| throw new /exception/sql_connection(errormsg, __FILE__, __LINE__); \ | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,34 @@ | ||
| /datum/configuration | ||
| var/autosave_interval = 60 MINUTES | ||
| var/autosave_auto_reset = 12 HOURS | ||
| var/autosave_interval = 2 HOURS | ||
| var/autosave_auto_restart = 12 HOURS | ||
| var/save_error_tolerance = PERSISTENCE_ERROR_TOLERANCE_NONE | ||
|
|
||
| /datum/configuration/load_mod_config(name, value) | ||
| . = ..() | ||
| switch(name) | ||
| if("autosave_interval") | ||
| autosave_interval = text2num(value) MINUTES | ||
| . = TRUE | ||
| if("autosave_auto_restart") | ||
| autosave_auto_restart = text2num(value) HOURS | ||
| . = TRUE | ||
| if("save_error_tolerance") | ||
| value = lowertext(value) | ||
| switch(value) | ||
| if("any") | ||
| save_error_tolerance = PERSISTENCE_ERROR_TOLERANCE_ANY | ||
| if("recoverable") | ||
| save_error_tolerance = PERSISTENCE_ERROR_TOLERANCE_RECOVERABLE | ||
| if("none") | ||
| save_error_tolerance = PERSISTENCE_ERROR_TOLERANCE_NONE | ||
| else | ||
| log_misc("Bad value for '[name]' : '[value]'! (Expected 'any', 'recoverable' or 'none')") | ||
| . = TRUE | ||
|
|
||
| ///Hook to add persistence settings meant to be in the game_options file if any. | ||
| /datum/configuration/load_mod_game_options(name, value) | ||
| . = ..() | ||
|
|
||
| ///Hook to add persistence settings meant to be in the dbconfig file if any. | ||
| /datum/configuration/load_mod_dbconfig(name, value) | ||
| . = ..() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.