C# Class OpenSim.Data.SQLite.SQLiteSimulationData

A RegionData Interface to the SQLite database
Inheritance: ISimulationDataStore
显示文件 Open project: N3X15/VoxelSim

Public Methods

Method Description
Commit ( ) : void

Dispose ( ) : void
Initialise ( string connectionString ) : void

Initialises RegionData Interface Loads and initialises a new SQLite connection and maintains it.

LoadLandObjects ( UUID regionUUID ) : List

LoadObjects ( UUID regionUUID ) : List

Load persisted objects from region storage.

LoadRegionSettings ( UUID regionUUID ) : OpenSim.Framework.RegionSettings
LoadRegionWindlightSettings ( UUID regionUUID ) : RegionLightShareData
LoadTerrain ( UUID regionID ) : ].double[

Load the latest terrain revision from region storage

RemoveLandObject ( UUID globalID ) : void

RemoveObject ( UUID obj, UUID regionUUID ) : void

Removes an object from region storage

RemoveRegionWindlightSettings ( UUID regionID ) : void
SQLiteSimulationData ( ) : System
SQLiteSimulationData ( string connectionString ) : System
Shutdown ( ) : void

See Commit

StoreLandObject ( ILandObject parcel ) : void

StoreObject ( SceneObjectGroup obj, UUID regionUUID ) : void

Adds an object into region storage

StorePrimInventory ( UUID primID, ICollection items ) : void

StoreRegionSettings ( OpenSim.Framework.RegionSettings rs ) : void
StoreRegionWindlightSettings ( RegionLightShareData wl ) : void
StoreTerrain ( double ter, UUID regionID ) : void

Store a terrain revision in region storage

Protected Methods

Method Description
CreateDataSetMapping ( IDataAdapter da, string tableName ) : void

Private Methods

Method Description
LoadItems ( SceneObjectPart prim ) : void

Load in a prim's persisted inventory.

PrintDataSet ( DataSet ds ) : void
RemoveItems ( UUID uuid ) : void

Remove all persisted items of the given prim. The caller must acquire the necessrary synchronization locks and commit or rollback changes.

addPrim ( SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID ) : void

Persistently store a prim.

buildItem ( DataRow row ) : TaskInventoryItem

Build a prim inventory item from the persisted data.

buildLandAccessData ( DataRow row ) : ParcelManager.ParcelAccessEntry

Build a land access entry from the persisted data.

buildLandData ( DataRow row ) : LandData

Build a Land Data from the persisted data.

buildPrim ( DataRow row ) : SceneObjectPart

buildRegionSettings ( DataRow row ) : OpenSim.Framework.RegionSettings
buildShape ( DataRow row ) : OpenSim.Framework.PrimitiveBaseShape

createCol ( DataTable dt, string name, Type type ) : void

createInsertCommand ( string table, DataTable dt ) : SqliteCommand

Create an insert command

This is subtle enough to deserve some commentary. Instead of doing *lots* and *lots of hardcoded strings for database definitions we'll use the fact that realistically all insert statements look like "insert into A(b, c) values(:b, :c) on the parameterized query front. If we just have a list of b, c, etc... we can generate these strings instead of typing them out.

createItemsTable ( ) : DataTable

creates "primitems" table

createLandAccessListTable ( ) : DataTable

create "landaccesslist" table

createLandTable ( ) : DataTable

Creates "land" table

createPrimTable ( ) : DataTable

Creates the "prims" table

createRegionSettingsTable ( ) : DataTable
createShapeTable ( ) : DataTable

Creates "primshapes" table

createSqliteParameter ( string name, Type type ) : SqliteParameter

This is a convenience function that collapses 5 repetitive lines for defining SqliteParameters to 2 parameters: column name and database type. It assumes certain conventions like :param as the param name to replace in parametrized queries, and that source version is always current version, both of which are fine for us.

createTerrainTable ( ) : DataTable

Creates the "terrain" table

createUpdateCommand ( string table, string pk, DataTable dt ) : SqliteCommand

create an update command

createUpdateCommand ( string table, string pk1, string pk2, DataTable dt ) : SqliteCommand

create an update command

dbtypeFromType ( Type type ) : DbType

Type conversion function

fillItemRow ( DataRow row, TaskInventoryItem taskItem ) : void

fillLandAccessRow ( DataRow row, ParcelManager entry, UUID parcelID ) : void

fillLandRow ( DataRow row, LandData land, UUID regionUUID ) : void

fillPrimRow ( DataRow row, SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID ) : void

fillRegionSettingsRow ( DataRow row, OpenSim.Framework.RegionSettings settings ) : void
fillShapeRow ( DataRow row, SceneObjectPart prim ) : void

serializeTerrain ( double val ) : Array

setupItemsCommands ( SqliteDataAdapter da, SqliteConnection conn ) : void

setupLandAccessCommands ( SqliteDataAdapter da, SqliteConnection conn ) : void

setupLandCommands ( SqliteDataAdapter da, SqliteConnection conn ) : void

setupPrimCommands ( SqliteDataAdapter da, SqliteConnection conn ) : void

setupRegionSettingsCommands ( SqliteDataAdapter da, SqliteConnection conn ) : void
setupShapeCommands ( SqliteDataAdapter da, SqliteConnection conn ) : void

setupTerrainCommands ( SqliteDataAdapter da, SqliteConnection conn ) : void

Method Details

Commit() public method

public Commit ( ) : void
return void

CreateDataSetMapping() protected method

protected CreateDataSetMapping ( IDataAdapter da, string tableName ) : void
da IDataAdapter
tableName string
return void

Dispose() public method

public Dispose ( ) : void
return void

Initialise() public method

Initialises RegionData Interface Loads and initialises a new SQLite connection and maintains it.
public Initialise ( string connectionString ) : void
connectionString string the connection string
return void

LoadLandObjects() public method

public LoadLandObjects ( UUID regionUUID ) : List
regionUUID UUID
return List

LoadObjects() public method

Load persisted objects from region storage.
public LoadObjects ( UUID regionUUID ) : List
regionUUID UUID The region UUID
return List

LoadRegionSettings() public method

public LoadRegionSettings ( UUID regionUUID ) : OpenSim.Framework.RegionSettings
regionUUID UUID
return OpenSim.Framework.RegionSettings

LoadRegionWindlightSettings() public method

public LoadRegionWindlightSettings ( UUID regionUUID ) : RegionLightShareData
regionUUID UUID
return OpenSim.Framework.RegionLightShareData

LoadTerrain() public method

Load the latest terrain revision from region storage
public LoadTerrain ( UUID regionID ) : ].double[
regionID UUID the region UUID
return ].double[

RemoveLandObject() public method

public RemoveLandObject ( UUID globalID ) : void
globalID UUID
return void

RemoveObject() public method

Removes an object from region storage
public RemoveObject ( UUID obj, UUID regionUUID ) : void
obj UUID the object
regionUUID UUID the region UUID
return void

RemoveRegionWindlightSettings() public method

public RemoveRegionWindlightSettings ( UUID regionID ) : void
regionID UUID
return void

SQLiteSimulationData() public method

public SQLiteSimulationData ( ) : System
return System

SQLiteSimulationData() public method

public SQLiteSimulationData ( string connectionString ) : System
connectionString string
return System

Shutdown() public method

See Commit
public Shutdown ( ) : void
return void

StoreLandObject() public method

public StoreLandObject ( ILandObject parcel ) : void
parcel ILandObject
return void

StoreObject() public method

Adds an object into region storage
public StoreObject ( SceneObjectGroup obj, UUID regionUUID ) : void
obj OpenSim.Region.Framework.Scenes.SceneObjectGroup the object
regionUUID UUID the region UUID
return void

StorePrimInventory() public method

public StorePrimInventory ( UUID primID, ICollection items ) : void
primID UUID
items ICollection
return void

StoreRegionSettings() public method

public StoreRegionSettings ( OpenSim.Framework.RegionSettings rs ) : void
rs OpenSim.Framework.RegionSettings
return void

StoreRegionWindlightSettings() public method

public StoreRegionWindlightSettings ( RegionLightShareData wl ) : void
wl OpenSim.Framework.RegionLightShareData
return void

StoreTerrain() public method

Store a terrain revision in region storage
public StoreTerrain ( double ter, UUID regionID ) : void
ter double terrain heightfield
regionID UUID region UUID
return void