C# Class WhiteCore.Modules.FileBasedSimulationData

FileBased DataStore, do not store anything in any databases, instead save .sim files for it
Inheritance: ISimulationDataStore, IDisposable
Mostra file Open project: WhiteCoreSim/WhiteCore-Dev

Protected Properties

Property Type Description
_oldRegionLoader IRegionDataLoader
_regionData RegionData
_regionLoader IRegionDataLoader
defaultDataPath string
m_backupSaveTimer System.Timers.Timer
m_displayNotSavingNotice bool
m_fileName string
m_keepOldSave bool
m_mapcenter_x int
m_mapcenter_y int
m_oldSaveDirectory string
m_oldSaveHasBeenSaved bool
m_regionNameSeed string[]
m_removeArchiveDays int
m_requiresSave bool
m_saveBackupChanges bool
m_saveBackups bool
m_saveChanges bool
m_saveLock object
m_saveTimer System.Timers.Timer
m_scene IScene
m_shutdown bool
m_storeDirectory string
m_timeBetweenBackupSaves int
m_timeBetweenSaves int

Public Methods

Method Description
CacheDispose ( ) : void
CleanupRegionBackups ( IScene scene, string cmds ) : void

Cleanups the old region backups.

Copy ( ) : ISimulationDataStore
CreateNewRegion ( ISimulationBase simBase, int>.Dictionary currentInfo ) : WhiteCore.Framework.SceneInfo.RegionInfo
CreateNewRegion ( ISimulationBase simBase, WhiteCore.Framework.SceneInfo.RegionInfo regionInfo, int>.Dictionary currentInfo ) : WhiteCore.Framework.SceneInfo.RegionInfo

Initializes a new region using the passed regioninfo

CreateNewRegion ( ISimulationBase simBase, string regionName, int>.Dictionary currentInfo ) : WhiteCore.Framework.SceneInfo.RegionInfo
DeleteUpOldArchives ( int daysOld ) : void
Dispose ( ) : void
FileBasedSimulationData ( ) : System
FindBackupRegionFiles ( ) : List
FindRegionBackupFiles ( string regionName ) : List
FindRegionInfos ( bool &newRegion, ISimulationBase simBase ) : List
ForceBackup ( ) : void
GetLastBackupFileName ( string regionName ) : string
Initialise ( ) : void
LoadLandObjects ( ) : List

Around for legacy things

LoadObjects ( ) : List
LoadRegionInfo ( string fileName, ISimulationBase simBase ) : WhiteCore.Framework.SceneInfo.RegionInfo
LoadRegionNameInfo ( string regionName, ISimulationBase simBase ) : WhiteCore.Framework.SceneInfo.RegionInfo
LoadTerrain ( bool RevertMap, int RegionSizeX, int RegionSizeY ) : void
LoadWater ( bool RevertMap, int RegionSizeX, int RegionSizeY ) : void
RemoveRegion ( ) : void
RestoreBackupFile ( string fileName, string regionName ) : bool
RestoreLastBackup ( string regionName ) : bool

Restores the last backup.

SetRegion ( IScene scene ) : void
Shutdown ( ) : void
Tainted ( ) : void
UpdateRegionInfo ( IScene scene, string cmds ) : void

Updates the region info, allowing for changes etc.

UpdateRegionPrims ( IScene scene, string cmds ) : void

Sets the region prim capacity.

Protected Methods

Method Description
ReadBackup ( string fileName ) : void
ReadConfig ( ISimulationBase simBase ) : void

Read the config for the data loader

SaveBackup ( bool isOldSave ) : void

Save a backup of the sim

SerializeDateTime ( ) : string
UpdateRegionCapacity ( ) : void
m_backupSaveTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Save a backup into the oldSaveDirectory on the timer event

m_saveTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Save a backup on the timer event

Private Methods

Method Description
BuildOldSaveFileName ( ) : string
BuildSaveFileName ( ) : string
BuildSaveFileName ( string name ) : string
CreateRegionFromConsole ( WhiteCore.Framework.SceneInfo.RegionInfo info, bool prompt, int>.Dictionary currentInfo ) : WhiteCore.Framework.SceneInfo.RegionInfo

Creates/updates a region from console.

GetRegionArchives ( ) : List

Gets any region preset OAR files.

GetRegionLocation ( WhiteCore.Framework.SceneInfo.RegionInfo &regInfo ) : bool

Gets the region location.

GetRegionName ( WhiteCore.Framework.SceneInfo.RegionInfo &regInfo ) : bool

Gets the name of the region.

GetRegionOptional ( WhiteCore.Framework.SceneInfo.RegionInfo &regInfo ) : bool

Gets the region optional settings.

GetRegionSize ( WhiteCore.Framework.SceneInfo.RegionInfo &regInfo ) : bool

Gets the size of the region.

ModifyRegionSettings ( WhiteCore.Framework.SceneInfo.RegionInfo &regInfo, bool advanced ) : bool

Modifies the region settings.

ReadFromData ( byte data ) : ITerrainChannel
WhiteCoreEventManager_OnGenericEvent ( string FunctionName, object parameters ) : object

Look for the backup event, and if it is there, trigger the backup of the sim

WriteTerrainToStream ( ITerrainChannel tModule ) : byte[]

Method Details

CacheDispose() public method

public CacheDispose ( ) : void
return void

CleanupRegionBackups() public method

Cleanups the old region backups.
public CleanupRegionBackups ( IScene scene, string cmds ) : void
scene IScene Scene
cmds string Commands
return void

Copy() public method

public Copy ( ) : ISimulationDataStore
return ISimulationDataStore

CreateNewRegion() public method

public CreateNewRegion ( ISimulationBase simBase, int>.Dictionary currentInfo ) : WhiteCore.Framework.SceneInfo.RegionInfo
simBase ISimulationBase
currentInfo int>.Dictionary
return WhiteCore.Framework.SceneInfo.RegionInfo

CreateNewRegion() public method

Initializes a new region using the passed regioninfo
public CreateNewRegion ( ISimulationBase simBase, WhiteCore.Framework.SceneInfo.RegionInfo regionInfo, int>.Dictionary currentInfo ) : WhiteCore.Framework.SceneInfo.RegionInfo
simBase ISimulationBase Sim base.
regionInfo WhiteCore.Framework.SceneInfo.RegionInfo Region info.
currentInfo int>.Dictionary Current region info.
return WhiteCore.Framework.SceneInfo.RegionInfo

CreateNewRegion() public method

public CreateNewRegion ( ISimulationBase simBase, string regionName, int>.Dictionary currentInfo ) : WhiteCore.Framework.SceneInfo.RegionInfo
simBase ISimulationBase
regionName string
currentInfo int>.Dictionary
return WhiteCore.Framework.SceneInfo.RegionInfo

DeleteUpOldArchives() public method

public DeleteUpOldArchives ( int daysOld ) : void
daysOld int
return void

Dispose() public method

public Dispose ( ) : void
return void

FileBasedSimulationData() public method

public FileBasedSimulationData ( ) : System
return System

FindBackupRegionFiles() public method

public FindBackupRegionFiles ( ) : List
return List

FindRegionBackupFiles() public method

public FindRegionBackupFiles ( string regionName ) : List
regionName string
return List

FindRegionInfos() public method

public FindRegionInfos ( bool &newRegion, ISimulationBase simBase ) : List
newRegion bool
simBase ISimulationBase
return List

ForceBackup() public method

public ForceBackup ( ) : void
return void

GetLastBackupFileName() public method

public GetLastBackupFileName ( string regionName ) : string
regionName string
return string

Initialise() public method

public Initialise ( ) : void
return void

LoadLandObjects() public method

Around for legacy things
public LoadLandObjects ( ) : List
return List

LoadObjects() public method

public LoadObjects ( ) : List
return List

LoadRegionInfo() public method

public LoadRegionInfo ( string fileName, ISimulationBase simBase ) : WhiteCore.Framework.SceneInfo.RegionInfo
fileName string
simBase ISimulationBase
return WhiteCore.Framework.SceneInfo.RegionInfo

LoadRegionNameInfo() public method

public LoadRegionNameInfo ( string regionName, ISimulationBase simBase ) : WhiteCore.Framework.SceneInfo.RegionInfo
regionName string
simBase ISimulationBase
return WhiteCore.Framework.SceneInfo.RegionInfo

LoadTerrain() public method

public LoadTerrain ( bool RevertMap, int RegionSizeX, int RegionSizeY ) : void
RevertMap bool
RegionSizeX int
RegionSizeY int
return void

LoadWater() public method

public LoadWater ( bool RevertMap, int RegionSizeX, int RegionSizeY ) : void
RevertMap bool
RegionSizeX int
RegionSizeY int
return void

ReadBackup() protected method

protected ReadBackup ( string fileName ) : void
fileName string
return void

ReadConfig() protected method

Read the config for the data loader
protected ReadConfig ( ISimulationBase simBase ) : void
simBase ISimulationBase
return void

RemoveRegion() public method

public RemoveRegion ( ) : void
return void

RestoreBackupFile() public method

public RestoreBackupFile ( string fileName, string regionName ) : bool
fileName string
regionName string
return bool

RestoreLastBackup() public method

Restores the last backup.
public RestoreLastBackup ( string regionName ) : bool
regionName string Region name.
return bool

SaveBackup() protected method

Save a backup of the sim
protected SaveBackup ( bool isOldSave ) : void
isOldSave bool
return void

SerializeDateTime() protected method

protected SerializeDateTime ( ) : string
return string

SetRegion() public method

public SetRegion ( IScene scene ) : void
scene IScene
return void

Shutdown() public method

public Shutdown ( ) : void
return void

Tainted() public method

public Tainted ( ) : void
return void

UpdateRegionCapacity() protected method

protected UpdateRegionCapacity ( ) : void
return void

UpdateRegionInfo() public method

Updates the region info, allowing for changes etc.
public UpdateRegionInfo ( IScene scene, string cmds ) : void
scene IScene Scene
cmds string Commands
return void

UpdateRegionPrims() public method

Sets the region prim capacity.
public UpdateRegionPrims ( IScene scene, string cmds ) : void
scene IScene Scene
cmds string Commands
return void

m_backupSaveTimer_Elapsed() protected method

Save a backup into the oldSaveDirectory on the timer event
protected m_backupSaveTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void
sender object
e System.Timers.ElapsedEventArgs
return void

m_saveTimer_Elapsed() protected method

Save a backup on the timer event
protected m_saveTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void
sender object
e System.Timers.ElapsedEventArgs
return void

Property Details

_oldRegionLoader protected_oe property

protected IRegionDataLoader _oldRegionLoader
return IRegionDataLoader

_regionData protected_oe property

protected RegionData,WhiteCore.Modules _regionData
return RegionData

_regionLoader protected_oe property

protected IRegionDataLoader _regionLoader
return IRegionDataLoader

defaultDataPath protected_oe property

protected string defaultDataPath
return string

m_backupSaveTimer protected_oe property

protected Timer,System.Timers m_backupSaveTimer
return System.Timers.Timer

m_displayNotSavingNotice protected_oe property

protected bool m_displayNotSavingNotice
return bool

m_fileName protected_oe property

protected string m_fileName
return string

m_keepOldSave protected_oe property

protected bool m_keepOldSave
return bool

m_mapcenter_x protected_oe property

protected int m_mapcenter_x
return int

m_mapcenter_y protected_oe property

protected int m_mapcenter_y
return int

m_oldSaveDirectory protected_oe property

protected string m_oldSaveDirectory
return string

m_oldSaveHasBeenSaved protected_oe property

protected bool m_oldSaveHasBeenSaved
return bool

m_regionNameSeed protected_oe property

protected string[] m_regionNameSeed
return string[]

m_removeArchiveDays protected_oe property

protected int m_removeArchiveDays
return int

m_requiresSave protected_oe property

protected bool m_requiresSave
return bool

m_saveBackupChanges protected_oe property

protected bool m_saveBackupChanges
return bool

m_saveBackups protected_oe property

protected bool m_saveBackups
return bool

m_saveChanges protected_oe property

protected bool m_saveChanges
return bool

m_saveLock protected_oe property

protected object m_saveLock
return object

m_saveTimer protected_oe property

protected Timer,System.Timers m_saveTimer
return System.Timers.Timer

m_scene protected_oe property

protected IScene m_scene
return IScene

m_shutdown protected_oe property

protected bool m_shutdown
return bool

m_storeDirectory protected_oe property

protected string m_storeDirectory
return string

m_timeBetweenBackupSaves protected_oe property

protected int m_timeBetweenBackupSaves
return int

m_timeBetweenSaves protected_oe property

protected int m_timeBetweenSaves
return int