|
Nebula
|
#include <dbserver.h>
Provides highlevel access to the world database.
Inherits Core::RefCounted.
Public Member Functions | |
| DbServer () | |
| constructor | |
| virtual | ~DbServer () |
| destructor | |
| bool | OpenStaticDatabase (const Util::String &dbUri) |
| open the static world database directly | |
| bool | OpenGameDatabase (const Util::String &dbUri) |
| open the dynamic game database directly | |
| bool | OpenNewGame (const Util::String &profileURI, const Util::String &dbURI) |
| open the db subsystem in NewGame mode | |
| bool | OpenContinueGame (const Util::String &profileURI) |
| open the db subsysten in ContinueGame mode | |
| bool | OpenLoadGame (const Util::String &profileURI, const Util::String &dbURI, const Util::String &saveGameURI) |
| open the db subsystem in LoadGame mode | |
| void | DeleteCurrentGame (const Util::String &profileURI) |
| delete current game database file | |
| void | CloseStaticDatabase () |
| close the static database | |
| void | CloseGameDatabase () |
| close the dynamic database | |
| void | Close () |
| general close method | |
| bool | IsStaticDatabaseOpen () const |
| return true if static database is open | |
| bool | IsGameDatabaseOpen () const |
| return true if game database is open | |
| bool | CreateSaveGame (const Util::String &profileURI, const Util::String &dbURI, const Util::String &saveGameURI) |
| create a save game | |
| const Ptr< Database > & | GetGameDatabase () const |
| get the world database (for dynamic gameplay data) | |
| const Ptr< Database > & | GetStaticDatabase () const |
| get static database (for constant read-only data) | |
| bool | CurrentGameExists (const Util::String &profileURI) const |
| return true if a current world database exists | |
| void | SetWorkingDbInMemory (bool b) |
| set flag to load database as working db into memory | |
Public Member Functions inherited from Core::RefCounted | |
| RefCounted () | |
| constructor | |
| int | GetRefCount () const |
| get the current refcount | |
| void | AddRef () |
| increment refcount by one | |
| void | Release () |
| decrement refcount and destroy object if refcount is zero | |
| bool | IsInstanceOf (const Rtti &rtti) const |
| return true if this object is instance of given class | |
| bool | IsInstanceOf (const Util::String &className) const |
| return true if this object is instance of given class by string | |
| bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
| return true if this object is instance of given class by fourcc | |
| bool | IsA (const Rtti &rtti) const |
| return true if this object is instance of given class, or a derived class | |
| bool | IsA (const Util::String &rttiName) const |
| return true if this object is instance of given class, or a derived class, by string | |
| bool | IsA (const Util::FourCC &rttiFourCC) const |
| return true if this object is instance of given class, or a derived class, by fourcc | |
| const Util::String & | GetClassName () const |
| get the class name | |
| Util::FourCC | GetClassFourCC () const |
| get the class FourCC code | |
Private Member Functions | |
| __DeclareClass (DbServer) | |
| __DeclareSingleton (DbServer) | |
Private Attributes | |
| bool | workDbInMemory |
| Ptr< Db::Sqlite3Factory > | dbFactory |
| Ptr< Database > | staticDatabase |
| Ptr< Database > | gameDatabase |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::RefCounted | |
| static void | DumpRefCountingLeaks () |
| dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!) | |
Protected Member Functions inherited from Core::RefCounted | |
| virtual | ~RefCounted () |
| destructor (called when refcount reaches zero) | |
| Db::DbServer::DbServer | ( | ) |
constructor
|
virtual |
destructor
|
private |
|
private |
| void Db::DbServer::Close | ( | ) |
general close method
| void Db::DbServer::CloseGameDatabase | ( | ) |
close the dynamic database
Close the game database.
| void Db::DbServer::CloseStaticDatabase | ( | ) |
close the static database
Close the static database.
| bool Db::DbServer::CreateSaveGame | ( | const Util::String & | profileURI, |
| const Util::String & | dbURI, | ||
| const Util::String & | saveGameURI ) |
create a save game
This creates a new save game by making a copy of the current world database into the savegame directory.
If a savegame of that exists, it will be overwritten.
| bool Db::DbServer::CurrentGameExists | ( | const Util::String & | profileURI | ) | const |
return true if a current world database exists
Return true if a current game database exists.
| void Db::DbServer::DeleteCurrentGame | ( | const Util::String & | profileURI | ) |
delete current game database file
This deletes the current game state database.
get the world database (for dynamic gameplay data)
get static database (for constant read-only data)
|
inline |
return true if game database is open
|
inline |
return true if static database is open
| bool Db::DbServer::OpenContinueGame | ( | const Util::String & | profileURI | ) |
open the db subsysten in ContinueGame mode
This opens the database in Continue Game mode: the current game database in the user profile directory will simply be opened.
| bool Db::DbServer::OpenGameDatabase | ( | const Util::String & | dbUri | ) |
open the dynamic game database directly
Directly open the game database, which contains dynamic game data.
| bool Db::DbServer::OpenLoadGame | ( | const Util::String & | profileURI, |
| const Util::String & | dbURI, | ||
| const Util::String & | saveGameURI ) |
open the db subsystem in LoadGame mode
This opens the database in Load Game mode.
This will overwrite the current game database with a save game database and open this as usual.
| bool Db::DbServer::OpenNewGame | ( | const Util::String & | profileURI, |
| const Util::String & | dbURI ) |
| bool Db::DbServer::OpenStaticDatabase | ( | const Util::String & | dbUri | ) |
open the static world database directly
Directly open the static database.
The static database contains immutable read-only data.
|
inline |
set flag to load database as working db into memory
|
private |
|
private |