CandideServer.Saving.GameSaveManager
Type JSONpublic class in CandideServer.Saving
Type metadata
- Assembly
CandideServer - Namespace
CandideServer.Saving - Base type
System.Object - Hash
C6A72085B28F6B08E20975FF0DE4A697ED08B2EFDCDAD9CF56396F0B0F0603CE
Relationships
Base type
System.Object
Fields
| Name | Visibility | Signature |
|---|---|---|
AnalyticsFirsts# | private | private System.String AnalyticsFirsts |
AutoSaveEnabled# | public | public System.Boolean AutoSaveEnabled |
Deserializer# | public | public CandideCreator.Shared.Serialization.CandideDeserializer Deserializer |
GameStateSaveReflection# | public | public CandideCreator.Shared.Serialization.CandideReflection GameStateSaveReflection |
GameStateSaveSerializer# | public | public CandideCreator.Shared.Serialization.CandideSerializer GameStateSaveSerializer |
TimeBetweenAutoSaves# | public | public System.TimeSpan TimeBetweenAutoSaves |
_lastSaveTime# | private | private System.DateTime _lastSaveTime |
_queuedSaveDirectory# | private | private System.String _queuedSaveDirectory |
_saveQueuedOffThread# | private | private System.Boolean _saveQueuedOffThread |
_savingTask# | private | private System.Threading.Tasks.Task _savingTask |
_stopAfterSave# | private | private System.Boolean _stopAfterSave |
Methods
CheckIsInvalidWorldName
#
public System.Boolean CheckIsInvalidWorldName(System.String worldName)
Method metadata
- Visibilitypublic
- Return type
System.Boolean - StaticTrue
- VirtualFalse
- Hash
23DCB38A71AFF0F3A3AA911B36E54D2DD1AE2DAD81CA6714DC63E2AD1FEE5C50 - Body hash
618B0AFB27DEA1A78220E1DDE276A92A148F1CAC23087673BCE84021F90E0215 - IL size47
Referenced calls
System.String::IsNullOrWhiteSpace(System.String)System.IO.Path::GetInvalidFileNameChars()System.String::IndexOfAny(System.Char[])System.String::Contains(System.Char)System.String::Trim()System.String::op_Inequality(System.String, System.String)
EmptyGameState
#
public System.Void EmptyGameState()
Method metadata
- Visibilitypublic
- Return type
System.Void - StaticTrue
- VirtualFalse
- Hash
4D8DE8C5942DB6A741E9E10E63BD6BD622D4D1333DB98E660E6D140AC74C0982 - Body hash
88D1BD43B945B1419511825BC27386CF49ECB80939432B3915EAF3699B2C9F4E - IL size120
Referenced calls
System.Type::GetTypeFromHandle(System.RuntimeTypeHandle)System.Type::GetMembers(System.Reflection.BindingFlags)System.Reflection.FieldInfo::GetValue(System.Object)System.Object::GetType()System.Type::GetMethod(System.String, System.Reflection.BindingFlags, System.Type[])System.Reflection.MethodBase::Invoke(System.Object, System.Object[])System.Reflection.FieldInfo::get_FieldType()CandideCreator.Shared.Serialization.CandideReflection::GetDefaultValue(System.Type)System.Reflection.FieldInfo::SetValue(System.Object, System.Object)
Called by
String literals
Clear
EmptyRunState
#
public System.Void EmptyRunState()
Method metadata
- Visibilitypublic
- Return type
System.Void - StaticTrue
- VirtualFalse
- Hash
047AD8CEFD66533242F3B4F3FC6A28FEAEA6BDF73199038D9D2D7F7C17411CC1 - Body hash
7464E1961B60A65E3D981997F25D7BA07F5ABD4561B927E83236AE32F6E61396 - IL size120
Referenced calls
System.Type::GetTypeFromHandle(System.RuntimeTypeHandle)System.Type::GetMembers(System.Reflection.BindingFlags)System.Reflection.FieldInfo::GetValue(System.Object)System.Object::GetType()System.Type::GetMethod(System.String, System.Reflection.BindingFlags, System.Type[])System.Reflection.MethodBase::Invoke(System.Object, System.Object[])System.Reflection.FieldInfo::get_FieldType()CandideCreator.Shared.Serialization.CandideReflection::GetDefaultValue(System.Type)System.Reflection.FieldInfo::SetValue(System.Object, System.Object)
String literals
Clear
GetShallowDictionaryCopy
#
private System.Object GetShallowDictionaryCopy(System.Type type, System.Object source)
Method metadata
- Visibilityprivate
- Return type
System.Object - StaticTrue
- VirtualFalse
- Hash
0C46CD385188D8D0CD935349968AED654762B1EA00BCE28DDE051F258CD66F8D - Body hash
281DB31F53E6E92E776A0EA7328AA9D3B547F1F2B9EDA1F7F5F82879C9B19051 - IL size90
Referenced calls
System.Type::get_GenericTypeArguments()System.Type::GetTypeFromHandle(System.RuntimeTypeHandle)System.Type::MakeGenericType(System.Type[])System.Type::MakeArrayType()System.Type::GetConstructor(System.Type[])CandideCreator.Shared.Helpers.ReflectionHelper::GetActivator(System.Reflection.ConstructorInfo)ReflectionHelper.ObjectActivator::Invoke(System.Object[])
LoadGame
#
public System.Void LoadGame(CandideServer.GameDescription gameDescription, System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>> state)
Method metadata
- Visibilitypublic
- Return type
System.Void - StaticTrue
- VirtualFalse
- Hash
4FE548EA6F0C0DE71C8D431E24D8EB03172C7C32D556BAB7F71C6C8D9838FB43 - Body hash
577086B7C5C4D159951B2C89718049999124314497A81C231B3456F01FE236AD - IL size57
Referenced calls
String literals
servergamestate-loaded
LoadGameDescriptionFromDirectory
#
public CandideServer.GameDescription LoadGameDescriptionFromDirectory(System.String directoryPath)
Method metadata
- Visibilitypublic
- Return type
CandideServer.GameDescription - StaticTrue
- VirtualFalse
- Hash
592894D58BB7FD44C6B4851AE48D607EAD4CD98A8C7B0754FF9F1D1E62F4A791 - Body hash
207C00761EA1C0741F7CC122B40AC6DC98DF6E68C51824CAF60EE056E619A6F4 - IL size348
Referenced calls
System.IO.Path::Combine(System.String, System.String)System.IO.File::Exists(System.String)System.IO.File::OpenRead(System.String)CandideCreator.Shared.Serialization.CandideDeserializer::Clear()CandideCreator.Shared.Serialization.CandideDeserializer::Deserialize(CandideCreator.Shared.Serialization.CandideReflection, System.IO.Stream, System.Boolean)System.IO.Path::GetFileName(System.String)System.IDisposable::Dispose()System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::.ctor(System.Int32, System.Int32)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::AppendLiteral(System.String)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::AppendFormatted(System.String)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::AppendFormatted(!!0)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::ToStringAndClear()CandideCreator.Shared.Helpers.WarningHelper::Warning(System.String)
Called by
String literals
world_descError while loading world desc file '':world_desc_backupError while loading world desc backup file '
LoadGameFromFile
#
public System.Boolean LoadGameFromFile(CandideServer.GameDescription description, System.String gameStateFilePath)
Method metadata
- Visibilitypublic
- Return type
System.Boolean - StaticTrue
- VirtualFalse
- Hash
00FF60272B824FD52D871A45A60C5315E1F82A3BBCFCFC62C593F980E9A1C8B3 - Body hash
1C3C2653726696340EF8B3C3E6BC6933983DFA34949D41578D5D28746783A322 - IL size174
Referenced calls
System.IO.File::OpenRead(System.String)System.Diagnostics.Stopwatch::StartNew()System.IO.MemoryStream::.ctor(System.Int32)System.IO.Compression.GZipStream::.ctor(System.IO.Stream, System.IO.Compression.CompressionMode)System.IO.Stream::CopyTo(System.IO.Stream)System.Diagnostics.Stopwatch::Restart()System.IO.Stream::set_Position(System.Int64)CandideCreator.Shared.Serialization.CandideDeserializer::Clear()CandideCreator.Shared.Serialization.CandideDeserializer::Deserialize(CandideCreator.Shared.Serialization.CandideReflection, System.IO.Stream, System.Boolean)System.String::Concat(System.String, System.String)CandideCreator.Shared.Helpers.WarningHelper::Warning(System.String)CandideServer.Saving.GameSaveManager::LoadGame(CandideServer.GameDescription, System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>>)System.IDisposable::Dispose()
String literals
Failed to load game state for game
LoadGameState
#
private System.Void LoadGameState(System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>> state)
Method metadata
- Visibilityprivate
- Return type
System.Void - StaticTrue
- VirtualFalse
- Hash
E8EF67353634D3C75760896DD1DC403C8AB5F121DCE1EC6E95C1A10770F6D7D3 - Body hash
081FD7FBD312FD00A318F20346CF5DEA69D04D6E7DDFCF19B113BD758C3D674D - IL size413
Referenced calls
CandideServer.Saving.GameSaveManager::EmptyRunState()CandideServer.Saving.GameSaveManager::EmptyGameState()GameSaveManager.<>c::<LoadGameState>b__26_0(System.ValueTuple<System.String, System.Object>)System.Func<System.ValueTuple<System.String, System.Object>, System.String>::.ctor(System.Object, System.IntPtr)GameSaveManager.<>c::<LoadGameState>b__26_1(System.ValueTuple<System.String, System.Object>)System.Func<System.ValueTuple<System.String, System.Object>, System.Object>::.ctor(System.Object, System.IntPtr)System.Linq.Enumerable::ToDictionary(System.Collections.Generic.IEnumerable<!!0>, System.Func<!!0, !!1>, System.Func<!!0, !!2>)System.Collections.Generic.Dictionary<System.String, System.Object>::TryGetValue(!0, !1&)System.Collections.Generic.Dictionary<System.String, Shared.Models.WorldFlag>::.ctor()System.Collections.Generic.Dictionary<System.String, System.Object>::set_Item(!0, !1)System.Type::GetTypeFromHandle(System.RuntimeTypeHandle)System.Type::GetMembers(System.Reflection.BindingFlags)System.Reflection.MemberInfo::get_Name()System.String::op_Equality(System.String, System.String)System.Reflection.FieldInfo::SetValue(System.Object, System.Object)CandideCreator.Shared.Helpers.ServerWarningHelper::Warning(System.String)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::.ctor(System.Int32, System.Int32)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::AppendLiteral(System.String)System.Object::GetType()System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::AppendFormatted(!!0)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::ToStringAndClear()CandideServer.Models.Inventory.InventorySaveModel::ToSharedInventoryModel()System.Collections.Generic.Dictionary<System.Guid, Shared.Models.Items.SharedInventoryModel>::set_Item(!0, !1)
String literals
WorldFlagsInventoriesSavedInventorySaveModels were null while loading worldUnknown saved inventory formatA saved inventory was null when loading game.analytics_firsts
QueueSave
#
public System.Void QueueSave(System.String directoryPath, System.Boolean offThread, System.Boolean stopAfterSave)
Method metadata
- Visibilitypublic
- Return type
System.Void - StaticTrue
- VirtualFalse
- Hash
9058E9008100855AA25C2FF28465226EABDE23832AE93E880D394207BD1B219B - Body hash
37C84425C45B8C82BEA097621D260B37DD4E6F1CE0B850BDACB5630EC722BF63 - IL size19
SaveGameState
#
public System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>> SaveGameState(System.Boolean forOffThreadSerializing)
Method metadata
- Visibilitypublic
- Return type
System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>> - StaticTrue
- VirtualFalse
- Hash
35C3CABF442E4F89FADCD0CD1FB3567973E736639A65DD369B743650D89BAEAF - Body hash
31A39FA1ECC004C08580B5CC0A22E1A40A61A18223E5A5A379854362D5872AB3 - IL size778
Referenced calls
CandideServer.EventBus.EventBusManager::SendEvent(System.String, System.Object, System.Boolean)System.DateTime::get_UtcNow()System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>>::.ctor()System.Type::GetTypeFromHandle(System.RuntimeTypeHandle)System.Type::GetMembers(System.Reflection.BindingFlags)System.Reflection.MemberInfo::get_Name()System.String::op_Equality(System.String, System.String)System.Reflection.FieldInfo::GetValue(System.Object)System.Reflection.FieldInfo::get_FieldType()CandideServer.Saving.GameSaveManager::GetShallowDictionaryCopy(System.Type, System.Object)System.ValueTuple<System.String, System.Object>::.ctor(!0, !1)System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>>::Add(!0)System.Collections.Generic.HashSet<System.String>::get_Comparer()System.Collections.Generic.HashSet<System.String>::.ctor(System.Collections.Generic.IEnumerable<!0>, System.Collections.Generic.IEqualityComparer<!0>)System.Type::get_IsArray()System.Collections.Generic.Dictionary<System.Guid, Shared.Models.Items.SharedInventoryModel>::get_Values()Dictionary.ValueCollection<System.Guid, Shared.Models.Items.SharedInventoryModel>::GetEnumerator()Dictionary.ValueCollection.Enumerator<System.Guid, Shared.Models.Items.SharedInventoryModel>::get_Current()Dictionary.ValueCollection.Enumerator<System.Guid, Shared.Models.Items.SharedInventoryModel>::MoveNext()System.IDisposable::Dispose()CandideServer.Models.Inventory.InventorySaveModel::FromInventoryModel(Shared.Models.Items.SharedInventoryModel)System.Collections.Generic.Dictionary<System.Guid, CandideServer.Entities.ServerEntityModel>::get_Values()Dictionary.ValueCollection<System.Guid, CandideServer.Entities.ServerEntityModel>::get_Count()System.Collections.Generic.Dictionary<System.Guid, CandideServer.Entities.ServerEntityModel>::.ctor(System.Int32)Dictionary.ValueCollection<System.Guid, CandideServer.Entities.ServerEntityModel>::GetEnumerator()Dictionary.ValueCollection.Enumerator<System.Guid, CandideServer.Entities.ServerEntityModel>::get_Current()System.Collections.Generic.Dictionary<System.Guid, CandideServer.Entities.ServerEntityModel>::Add(!0, !1)Dictionary.ValueCollection.Enumerator<System.Guid, CandideServer.Entities.ServerEntityModel>::MoveNext()System.Collections.Generic.Dictionary<System.Guid, CandideServer.Models.Worlds.WorldModel>::get_Values()Dictionary.ValueCollection<System.Guid, CandideServer.Models.Worlds.WorldModel>::get_Count()System.Collections.Generic.Dictionary<System.Guid, CandideServer.Models.Worlds.WorldModel>::.ctor(System.Int32)Dictionary.ValueCollection<System.Guid, CandideServer.Models.Worlds.WorldModel>::GetEnumerator()
Called by
String literals
before-servergamestate-savedInventoriesEntitiesWorldsanalytics_firsts
SaveGameToDirectory
#
public System.Threading.Tasks.Task SaveGameToDirectory(System.String directoryPath, System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>> gameState, System.Boolean sendNetworkMessages, System.Boolean sendLockInMessage)
Method metadata
- Visibilitypublic
- Return type
System.Threading.Tasks.Task - StaticTrue
- VirtualFalse
- Hash
134A391C9AF7C99ED4DBE873AED51D9D480819C4CFC3B14816D4F05144877BD4 - Body hash
198F21E287742EA8D84AC7CDF71F961F198E31AAEA43C9FBAFFB1B17497EBFAF - IL size284
Referenced calls
GameSaveManager.<>c__DisplayClass16_0::.ctor()System.IO.Directory::Exists(System.String)System.IO.Directory::CreateDirectory(System.String)Shared.Text.StringId::op_Implicit(System.String)CandideServer.MessageModels.ChatLogMessage::AsStringId(Shared.Text.StringId, CandideServer.Models.ChatMessageType, System.Boolean, System.String)CandideServer.ServerServices.ChatLogServerService::SendChatLogMessageThreadSafe(CandideServer.MessageModels.ChatLogMessage)System.DateTime::get_UtcNow()System.Nullable<System.DateTime>::.ctor(!0)CandideServer.ServerGameState::GetWorldPlayTimeSeconds()CandideServer.Saving.GameSaveManager::SaveWorldDescToDirectory(System.String, CandideServer.GameDescription)System.IO.Path::Combine(System.String, System.String)System.IO.MemoryStream::.ctor(System.Int32)System.Diagnostics.Stopwatch::StartNew()CandideCreator.Shared.Serialization.CandideSerializer::Serialize(CandideCreator.Shared.Serialization.CandideReflection, System.IO.Stream, !!0, System.Boolean)System.Diagnostics.Stopwatch::get_Elapsed()System.IO.Stream::set_Position(System.Int64)GameSaveManager.<>c__DisplayClass16_0::<SaveGameToDirectory>b__0()System.Action::.ctor(System.Object, System.IntPtr)System.Threading.Tasks.Task::Run(System.Action)System.IDisposable::Dispose()
String literals
HostServer_SavingGamegame_stategame_state_tempgame_state_backupHostServer_DataLockedInForSaving
SaveNewGameToDirectory
#
public System.Boolean SaveNewGameToDirectory(System.String directoryPath, CandideServer.GameDescription gameDescription, System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>> state, System.Action onSaveError)
Method metadata
- Visibilitypublic
- Return type
System.Boolean - StaticTrue
- VirtualFalse
- Hash
A39B74D29CAE0D9FD9DEFF59AB181CF67471DEF284D132216F0AC340CC44A012 - Body hash
4A462EF24A0EA82A56A5B6C75AF4B728C42E1A977A2774441BBFB7DD6EB2714D - IL size295
Referenced calls
System.IO.Directory::CreateDirectory(System.String)System.IO.Path::Combine(System.String, System.String)System.IO.File::Exists(System.String)System.Action::Invoke()System.IO.File::Create(System.String)CandideCreator.Shared.Serialization.CandideSerializer::Serialize(CandideCreator.Shared.Serialization.CandideReflection, System.IO.Stream, !!0, System.Boolean)System.IO.Compression.GZipStream::.ctor(System.IO.Stream, System.IO.Compression.CompressionLevel)System.IO.FileStream::Flush(System.Boolean)System.IDisposable::Dispose()System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::.ctor(System.Int32, System.Int32)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::AppendLiteral(System.String)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::AppendFormatted(!!0)System.Runtime.CompilerServices.DefaultInterpolatedStringHandler::ToStringAndClear()CandideCreator.Shared.Helpers.WarningHelper::Warning(System.String)
String literals
world_descgame_stateError while saving new world:
SaveWithCallbacks
#
public System.Threading.Tasks.Task SaveWithCallbacks(System.String saveDirectoryPath, System.Action<System.Int32> saveStepCallback)
Method metadata
- Visibilitypublic
- Return type
System.Threading.Tasks.Task - StaticTrue
- VirtualFalse
- Hash
E1FC958EDB7D93E2D9518984AD67F9E5D5B44CED44E2053E4827AF375FB7D50B - Body hash
017DFA08FC6384AC9FD4AD4840D3D965D54DEFE99A7E426D189D86D0A994939E - IL size36
Referenced calls
GameSaveManager.<>c__DisplayClass15_0::.ctor()GameSaveManager.<>c__DisplayClass15_0::<SaveWithCallbacks>b__0()System.Func<System.Threading.Tasks.Task>::.ctor(System.Object, System.IntPtr)System.Threading.Tasks.Task::Run(System.Func<System.Threading.Tasks.Task>)
SaveWorldDescToDirectory
#
public System.Threading.Tasks.Task SaveWorldDescToDirectory(System.String directoryPath, CandideServer.GameDescription desc)
Method metadata
- Visibilitypublic
- Return type
System.Threading.Tasks.Task - StaticTrue
- VirtualFalse
- Hash
0F337636FBA0A034EB8C909255088DC36127572F599CA3976CA3640292C50D02 - Body hash
11E7342193D049DACB9F23A75ADD8A90208A5978C706B3A392F992E916624F73 - IL size137
Referenced calls
GameSaveManager.<>c__DisplayClass17_0::.ctor()System.IO.Path::Combine(System.String, System.String)System.IO.MemoryStream::.ctor()CandideCreator.Shared.Serialization.CandideSerializer::Serialize(CandideCreator.Shared.Serialization.CandideReflection, System.IO.Stream, !!0, System.Boolean)System.IO.Stream::set_Position(System.Int64)GameSaveManager.<>c__DisplayClass17_0::<SaveWorldDescToDirectory>b__0()System.Action::.ctor(System.Object, System.IntPtr)System.Threading.Tasks.Task::Run(System.Action)System.IDisposable::Dispose()
String literals
world_descworld_desc_tempworld_desc_backup
Update
#
public System.Void Update()
Method metadata
- Visibilitypublic
- Return type
System.Void - StaticTrue
- VirtualFalse
- Hash
FDCAAAF2CA59D5CE8C989DF0E67647EFABDC068B44FF725CA6637C1F4548F19F - Body hash
D168485ECB2317F78FC02C88CB9F1301971DCC848C17BAF81EFD9DCE47064803 - IL size231
Referenced calls
GameSaveManager.<>c__DisplayClass12_0::.ctor()System.Threading.Tasks.Task::get_IsCompleted()CandideServer.Saving.GameSaveManager::UpdateAutoSave()System.Threading.Monitor::Enter(System.Object, System.Boolean&)System.Diagnostics.Stopwatch::StartNew()CandideServer.Saving.GameSaveManager::SaveGameState(System.Boolean)System.Threading.Monitor::Exit(System.Object)GameSaveManager.<>c__DisplayClass12_0::<Update>b__0()System.Func<System.Threading.Tasks.Task>::.ctor(System.Object, System.IntPtr)System.Threading.Tasks.Task::Run(System.Func<System.Threading.Tasks.Task>)CandideServer.Saving.GameSaveManager::SaveGameToDirectory(System.String, System.Collections.Generic.List<System.ValueTuple<System.String, System.Object>>, System.Boolean, System.Boolean)System.Threading.Tasks.Task::Wait()CandideServer.Server.BaseServer::Stop(System.Boolean)
UpdateAutoSave
#
private System.Void UpdateAutoSave()
Method metadata
- Visibilityprivate
- Return type
System.Void - StaticTrue
- VirtualFalse
- Hash
B130EB47ADC0659C5CA12CDC4BC0C21EC5117BDF2CDD6ECD37B6BE6A42D3C0D8 - Body hash
14CE04256DAD7E54376D2FDDB73940F7AE2F2E92E47DD60957EED203BA0A0CF2 - IL size75
Referenced calls
System.DateTime::get_UtcNow()System.DateTime::op_Subtraction(System.DateTime, System.DateTime)System.TimeSpan::op_LessThan(System.TimeSpan, System.TimeSpan)CandideServer.Saving.GameSaveManager::QueueSave(System.String, System.Boolean, System.Boolean)