GameDB  1.6.0
GameDB Pro is a plugin that provides an easy to use and powerful game and meta data editor
GameDBLibrary.GameDBBase Class Reference

The base class all GameDBs inherit from. The GameDB provides methods for importing data. More...

Inheritance diagram for GameDBLibrary.GameDBBase:
GameDBCodegenExample.GameDB

Public Member Functions

Exception Import (string jsonData, bool notify=true)
 Imports JSON representing the GameDB. More...
 
Exception Import (string jsonData, string[] columImportList, bool notify=true)
 Imports JSON representing the GameDB. Allows specifying only certain fields to be imported. Useful for limiting the memory used of the loaded GameDB. More...
 
RequestUpdater ImportFromServer (string serverHost, string downloadHost, string userID, string tag, string originalJSON, string cachePath, bool binary, string key, string salt, string[] columImportList=null, Action< Exception > onImport=null)
 (Pro Version only)
Imports the GameDB from a server. Can be used in conjuction with the Golang server provided in the (Pro version) This allows over the air updating of GameDBs so new data can be pushed to clients without the need of releasing new versions of the clients. Downloaded GameDBs will be cached locally to avoid downloading again if they haven't changed. If they have change, only the diff between the original built-in GameDB and the uploaded GameDB will be downloaded. More...
 

Public Attributes

Action OnDBLoaded = null
 OnDBLoaded allows callbacks to be added that are triggered if notify = true when importing or loading data. This allows code to deal with data potentially beind asynchronously loaded (when imported from a server) or hot reloaded via an Import or Reload from the GameDB Editor during run-time in editor. More...
 
string Name => m_internal.Name
 Gets the name of the GameDB set when instantiating. More...
 

Properties

string ScopeName = string.Empty [get]
 Gets the ScopeName of the GameDB set when creating it in the GameDB Editor. More...
 
Logger Logger [get, set]
 Gets or sets the logger used for internal logs. More...
 

Detailed Description

The base class all GameDBs inherit from. The GameDB provides methods for importing data.

Member Function Documentation

◆ Import() [1/2]

Exception GameDBLibrary.GameDBBase.Import ( string  jsonData,
bool  notify = true 
)

Imports JSON representing the GameDB.

Parameters
jsonDataA string representing the JSON format of the GameDB to import.
notifyif set to true the OnDBLoaded callback will be triggered for the GameDB (defaults to true).
Returns
An exception is returned if the GameDB fails to imprt

◆ Import() [2/2]

Exception GameDBLibrary.GameDBBase.Import ( string  jsonData,
string []  columImportList,
bool  notify = true 
)

Imports JSON representing the GameDB. Allows specifying only certain fields to be imported. Useful for limiting the memory used of the loaded GameDB.

Parameters
jsonDataA string representing the JSON format of the GameDB to import.
columImportListAn array of field names to import.
notifyif set to true the OnDBLoaded callback will be triggered for the GameDB (defaults to true).
Returns
An exception is returned if the GameDB fails to imprt

◆ ImportFromServer()

RequestUpdater GameDBLibrary.GameDBBase.ImportFromServer ( string  serverHost,
string  downloadHost,
string  userID,
string  tag,
string  originalJSON,
string  cachePath,
bool  binary,
string  key,
string  salt,
string []  columImportList = null,
Action< Exception >  onImport = null 
)

(Pro Version only)
Imports the GameDB from a server. Can be used in conjuction with the Golang server provided in the (Pro version) This allows over the air updating of GameDBs so new data can be pushed to clients without the need of releasing new versions of the clients. Downloaded GameDBs will be cached locally to avoid downloading again if they haven't changed. If they have change, only the diff between the original built-in GameDB and the uploaded GameDB will be downloaded.

Parameters
serverHostThe server host base address of the GameDB server to communicate with. For example: https://mygamedbserver.com
downloadHostThe download host base address of the GameDB to download. For example https://s3.aws.com/mygamedb
userIDA unique identified used to represent the client downloading the GameDB. Can be used for A/B testing GameDB versions
tagThe tag used to download the correct version of the GameDB
originalJSONThe original json the update is based off. This will be imported if there are no cached version or anything to download from the server
cachePathThe path to cache downloaded GameDBs too
binaryif set to true the GameDB will be loaded as a binary source (defaults to false) (key and salt required if loading binary)
keythe key used to encrypt the database via the GameDBLibrary.BinaryGameDB utilities. Required if using binary = true
saltthe salt used to encrypt the database via the GameDBLibrary.BinaryGameDB utilities. Required if using binary = true
columImportListAn array of field names to import.
onImportA callback called when the data has be imported.
Returns
A RequestUpdater used to montior the request to the server.

Member Data Documentation

◆ Name

string GameDBLibrary.GameDBBase.Name => m_internal.Name

Gets the name of the GameDB set when instantiating.

The name of the GameDB.

◆ OnDBLoaded

Action GameDBLibrary.GameDBBase.OnDBLoaded = null

OnDBLoaded allows callbacks to be added that are triggered if notify = true when importing or loading data. This allows code to deal with data potentially beind asynchronously loaded (when imported from a server) or hot reloaded via an Import or Reload from the GameDB Editor during run-time in editor.

Property Documentation

◆ Logger

Logger GameDBLibrary.GameDBBase.Logger
getset

Gets or sets the logger used for internal logs.

The logger.

◆ ScopeName

string GameDBLibrary.GameDBBase.ScopeName = string.Empty
get

Gets the ScopeName of the GameDB set when creating it in the GameDB Editor.

The ScopeName