Enfusion Script API
|
Backend Api instance. More...
Public Member Functions | |
string | GetErrorCode (int code) |
Error code to string. | |
string | GetPlayerUID (int iPlayerId) |
proto external void | SetSessionCallback (DSSessionCallback callback) |
Set session callback to recieve all session related events. | |
proto external int | GetStatusCount () |
Return count of services. | |
proto external ServiceStatusItem | GetStatusItem (int iIndex) |
Return specific status object. | |
proto external ServiceStatusItem | GetMainStatus () |
Return Main status object. | |
proto external int | GetNewsCount () |
Return count of News messages. | |
proto external NewsFeedItem | GetNewsItem (int iIndex) |
Return specific News message. | |
proto external int | GetNotifyCount () |
Return count of Notification messages. | |
proto external NewsFeedItem | GetNotifyItem (int iIndex) |
Return specific Notification message. | |
proto external string | GetLinkItem (string linkName) |
Return specific Link by it's name. | |
proto external bool | Shutdown () |
Shutdown backend - request processing. | |
proto external void | VerifyCredentials (BackendCallback callback, bool storeCredentials) |
Invoke credentials update (authenticate with new name+password) | |
proto external void | Unlink (BackendCallback callback) |
Unlink the bi-account and clear credentials. | |
proto external int | RemainingAccountLockedTime () |
The bi-account remains locked for X seconds. | |
proto external bool | IsAuthenticated () |
Client is Authenticated - relate requests may proceed. | |
proto external bool | IsAuthInProgress () |
Client is busy - Authentication in process. | |
proto external bool | IsRunning () |
True if HTTP communication enabled (initialization, runtime or shutdown may be pending at same time) | |
proto external bool | IsInitializing () |
True if HTTP communication is being activated (initializing yet) | |
proto external bool | IsActive () |
True if HTTP communication active (initialized) | |
proto external void | RefreshCommStatus () |
Refresh status - ping services to obtain response time. | |
proto external int | GetCommTestStatus () |
Get comm test status, 0==not executed, 1==running, 2==finished, 3==failed. | |
proto external float | GetCommResponseTime () |
Read service response time in milliseconds, if value is subzero - test was not executed yet, call RefreshCommStatus() | |
proto external float | GetCommTimeLastSuccess () |
Get time in seconds since last successful request (limit is 1hr - does not count more) | |
proto external float | GetCommTimeLastFail () |
Get time in seconds since last successful request (limit is 1hr - does not count more) | |
proto external void | Request (int request, BackendCallback cb, JsonApiStruct dataObject) |
Ask specific request with callback result. | |
proto external void | PlayerRequest (int request, BackendCallback cb, JsonApiStruct dataObject, int iPlayerId) |
Ask player request with callback result from controller (Lobby) | |
proto external void | PlayerData (JsonApiStruct dataObject, int iPlayerId) |
Expand player data upon defined structure, this is Server-Side only! | |
proto external void | SettingsData (string sFileName, JsonApiStruct dataObject) |
Expand settings data upon defined structure, this is Server-Side only! | |
proto external void | FeedbackMessage (BackendCallback cb, JsonApiStruct dataObject, string message, PixelRawData data=null, int width=0, int height=0, int channels=0, int quality=0) |
Send feedback message and/ or script object with whatever data on it (additionally it is possible to handle callback as well) | |
proto external WorkshopApi | GetWorkshop () |
Get Workshop Api. | |
proto external ServerConfigApi | GetServerConfigApi () |
Get Server Config Api. | |
proto external BanServiceApi | GetBanServiceApi () |
Get Ban Service Api. | |
proto external ClientLobbyApi | GetClientLobby () |
Get Client Lobby Api. | |
proto external bool | IsListedServerAdmin (int iPlayerId) |
Check if player is in list of admins defined in server config. | |
proto external bool | IsServerOwner (int iPlayerId) |
Check if player is server owner defined by ownerToken. | |
proto external SessionStorage | GetStorage () |
Get Session Storage. | |
proto external DSSession | GetDSSession () |
Get DS server instance. | |
proto external string | GetPlayerIdentityId (int iPlayerId) |
Get Player Identity ID by Player ID. | |
proto external string | GetLocalIdentityId () |
Get Local Identity ID on client. | |
proto external PlatformKind | GetPlayerPlatformKind (int iPlayerId) |
Get Player Platform Kind by Player ID. | |
proto external string | GetPlayerPlatformId (int iPlayerId) |
Get Player Platform ID by Player ID. | |
proto external bool | IsLocalPlatformAssigned () |
Return true if local platform data are to be used for authentication/ persistency of client (meaningless on server) | |
proto external void | SetCredentialsItem (EBackendCredentials item, string str) |
Set credentials value per item. | |
proto external string | GetCredentialsItem (EBackendCredentials item) |
Get credentials value per item. | |
proto external bool | IsBIAccountLinked () |
Return true if BI Account is linked to local Identity. | |
proto external owned string | GetBackendEnv () |
Get target backend environment. | |
proto external bool | GetRunningDSConfig (DSConfig config) |
proto external bool | LoadDSConfig (DSConfig config, string fileName) |
proto external bool | SaveDSConfig (DSConfig config, string fileName) |
proto external void | SetDefaultIpPort (DSConfig config) |
proto external int | GetAvailableConfigs (out notnull array< string > configs) |
proto external int | GetAvailableConfigPaths (out notnull array< string > configs) |
proto external void | NewSession () |
Called when new server or client game session is started. | |
proto external void | SetDebugHandling (EBackendRequest eRequest, EBackendDebugHandling eHandlingType) |
Debugging API for internal builds. | |
void | OnPlatformActive () |
Called when platform ready and provided all data necessary to connect online. | |
void | OnPlatformMissing () |
Called when platform is not ready - perhaps user is not signed-in. | |
void | OnCannotInitiate (int code) |
Called when initiate cannot be called. | |
Backend Api instance.
proto external void BackendApi.FeedbackMessage | ( | BackendCallback | cb, |
JsonApiStruct | dataObject, | ||
string | message, | ||
PixelRawData | data = null, | ||
int | width = 0, | ||
int | height = 0, | ||
int | channels = 0, | ||
int | quality = 0 ) |
Send feedback message and/ or script object with whatever data on it (additionally it is possible to handle callback as well)
cb | Is script callback where you will recieve result/ error or even data when request finsihes |
dataObject | Is optional destination when request uses or response return Json data and you want to work with object |
message | Is custom |
data | Raw image data of screenshot, if any |
width | Width of the screenshot |
height | Height of the screenshot |
channels | How many channels does the image use (4 for RGBA) |
quality | 1-100, the higher number the better quality but also bigger size of the image |
proto external owned string BackendApi.GetBackendEnv | ( | ) |
Get target backend environment.
proto external BanServiceApi BackendApi.GetBanServiceApi | ( | ) |
Get Ban Service Api.
proto external ClientLobbyApi BackendApi.GetClientLobby | ( | ) |
Get Client Lobby Api.
proto external float BackendApi.GetCommResponseTime | ( | ) |
Read service response time in milliseconds, if value is subzero - test was not executed yet, call RefreshCommStatus()
proto external int BackendApi.GetCommTestStatus | ( | ) |
Get comm test status, 0==not executed, 1==running, 2==finished, 3==failed.
proto external float BackendApi.GetCommTimeLastFail | ( | ) |
Get time in seconds since last successful request (limit is 1hr - does not count more)
proto external float BackendApi.GetCommTimeLastSuccess | ( | ) |
Get time in seconds since last successful request (limit is 1hr - does not count more)
proto external string BackendApi.GetCredentialsItem | ( | EBackendCredentials | item | ) |
Get credentials value per item.
item | Is type of EBackendCredentials parameter you want to read |
proto external DSSession BackendApi.GetDSSession | ( | ) |
Get DS server instance.
proto external string BackendApi.GetLocalIdentityId | ( | ) |
Get Local Identity ID on client.
proto external ServiceStatusItem BackendApi.GetMainStatus | ( | ) |
Return Main status object.
proto external int BackendApi.GetNewsCount | ( | ) |
Return count of News messages.
proto external NewsFeedItem BackendApi.GetNewsItem | ( | int | iIndex | ) |
Return specific News message.
proto external int BackendApi.GetNotifyCount | ( | ) |
Return count of Notification messages.
proto external NewsFeedItem BackendApi.GetNotifyItem | ( | int | iIndex | ) |
Return specific Notification message.
Get Player Identity ID by Player ID.
iPlayerId | Is id of player in session |
Get Player Platform ID by Player ID.
iPlayerId | Is id of player in session |
proto external PlatformKind BackendApi.GetPlayerPlatformKind | ( | int | iPlayerId | ) |
Get Player Platform Kind by Player ID.
iPlayerId | Is id of player in session |
proto external ServerConfigApi BackendApi.GetServerConfigApi | ( | ) |
Get Server Config Api.
proto external int BackendApi.GetStatusCount | ( | ) |
Return count of services.
proto external ServiceStatusItem BackendApi.GetStatusItem | ( | int | iIndex | ) |
Return specific status object.
proto external SessionStorage BackendApi.GetStorage | ( | ) |
Get Session Storage.
proto external WorkshopApi BackendApi.GetWorkshop | ( | ) |
Get Workshop Api.
proto external bool BackendApi.IsActive | ( | ) |
True if HTTP communication active (initialized)
proto external bool BackendApi.IsAuthenticated | ( | ) |
Client is Authenticated - relate requests may proceed.
proto external bool BackendApi.IsAuthInProgress | ( | ) |
Client is busy - Authentication in process.
proto external bool BackendApi.IsBIAccountLinked | ( | ) |
Return true if BI Account is linked to local Identity.
proto external bool BackendApi.IsInitializing | ( | ) |
True if HTTP communication is being activated (initializing yet)
Check if player is in list of admins defined in server config.
iPlayerId | is Id of Player which is being verified |
proto external bool BackendApi.IsLocalPlatformAssigned | ( | ) |
Return true if local platform data are to be used for authentication/ persistency of client (meaningless on server)
proto external bool BackendApi.IsRunning | ( | ) |
True if HTTP communication enabled (initialization, runtime or shutdown may be pending at same time)
Check if player is server owner defined by ownerToken.
iPlayerId | is Id of Player which is being verified |
proto external void BackendApi.NewSession | ( | ) |
Called when new server or client game session is started.
void BackendApi.OnCannotInitiate | ( | int | code | ) |
Called when initiate cannot be called.
void BackendApi.OnPlatformActive | ( | ) |
Called when platform ready and provided all data necessary to connect online.
void BackendApi.OnPlatformMissing | ( | ) |
Called when platform is not ready - perhaps user is not signed-in.
proto external void BackendApi.PlayerData | ( | JsonApiStruct | dataObject, |
int | iPlayerId ) |
Expand player data upon defined structure, this is Server-Side only!
dataObject | Is optional destination when request uses or response return Json data and you want to work with object |
iPlayerId | Is Player Id used on player identity |
proto external void BackendApi.PlayerRequest | ( | int | request, |
BackendCallback | cb, | ||
JsonApiStruct | dataObject, | ||
int | iPlayerId ) |
Ask player request with callback result from controller (Lobby)
request | Is type of request, which is EBackendRequest |
cb | Is script callback where you will recieve result/ error or even data when request finsihes |
dataObject | Is optional destination when request uses or response return Json data and you want to work with object |
iPlayerId | Is Player Id used on player identity |
proto external void BackendApi.RefreshCommStatus | ( | ) |
Refresh status - ping services to obtain response time.
proto external int BackendApi.RemainingAccountLockedTime | ( | ) |
The bi-account remains locked for X seconds.
proto external void BackendApi.Request | ( | int | request, |
BackendCallback | cb, | ||
JsonApiStruct | dataObject ) |
Ask specific request with callback result.
request | Is type of request, which is EBackendRequest |
cb | Is script callback where you will recieve result/ error or even data when request finsihes |
dataObject | Is optional destination when request uses or response return Json data and you want to work with object |
proto external void BackendApi.SetCredentialsItem | ( | EBackendCredentials | item, |
string | str ) |
Set credentials value per item.
item | Is type of EBackendCredentials parameter you want to set |
str | Is value itself |
proto external void BackendApi.SetDebugHandling | ( | EBackendRequest | eRequest, |
EBackendDebugHandling | eHandlingType ) |
Debugging API for internal builds.
proto external void BackendApi.SetDefaultIpPort | ( | DSConfig | config | ) |
proto external void BackendApi.SetSessionCallback | ( | DSSessionCallback | callback | ) |
Set session callback to recieve all session related events.
callback | - check all events and respective description upon object |
proto external void BackendApi.SettingsData | ( | string | sFileName, |
JsonApiStruct | dataObject ) |
Expand settings data upon defined structure, this is Server-Side only!
sFileName | Is name of settings file you want to access, remember - it must exist! |
dataObject | Is optional destination when request uses or response return Json data and you want to work with object |
proto external bool BackendApi.Shutdown | ( | ) |
Shutdown backend - request processing.
proto external void BackendApi.Unlink | ( | BackendCallback | callback | ) |
Unlink the bi-account and clear credentials.
proto external void BackendApi.VerifyCredentials | ( | BackendCallback | callback, |
bool | storeCredentials ) |
Invoke credentials update (authenticate with new name+password)