Enfusion Script API
Loading...
Searching...
No Matches
BackendApi Interface Reference

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.
 

Detailed Description

Backend Api instance.

Member Function Documentation

◆ FeedbackMessage()

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)

Parameters
cbIs script callback where you will recieve result/ error or even data when request finsihes
dataObjectIs optional destination when request uses or response return Json data and you want to work with object
messageIs custom
dataRaw image data of screenshot, if any
widthWidth of the screenshot
heightHeight of the screenshot
channelsHow many channels does the image use (4 for RGBA)
quality1-100, the higher number the better quality but also bigger size of the image

◆ GetAvailableConfigPaths()

proto external int BackendApi.GetAvailableConfigPaths ( out notnull array< string > configs)

◆ GetAvailableConfigs()

proto external int BackendApi.GetAvailableConfigs ( out notnull array< string > configs)

◆ GetBackendEnv()

proto external owned string BackendApi.GetBackendEnv ( )

Get target backend environment.

◆ GetBanServiceApi()

proto external BanServiceApi BackendApi.GetBanServiceApi ( )

Get Ban Service Api.

◆ GetClientLobby()

proto external ClientLobbyApi BackendApi.GetClientLobby ( )

Get Client Lobby Api.

◆ GetCommResponseTime()

proto external float BackendApi.GetCommResponseTime ( )

Read service response time in milliseconds, if value is subzero - test was not executed yet, call RefreshCommStatus()

◆ GetCommTestStatus()

proto external int BackendApi.GetCommTestStatus ( )

Get comm test status, 0==not executed, 1==running, 2==finished, 3==failed.

◆ GetCommTimeLastFail()

proto external float BackendApi.GetCommTimeLastFail ( )

Get time in seconds since last successful request (limit is 1hr - does not count more)

◆ GetCommTimeLastSuccess()

proto external float BackendApi.GetCommTimeLastSuccess ( )

Get time in seconds since last successful request (limit is 1hr - does not count more)

◆ GetCredentialsItem()

proto external string BackendApi.GetCredentialsItem ( EBackendCredentials item)

Get credentials value per item.

Parameters
itemIs type of EBackendCredentials parameter you want to read

◆ GetDSSession()

proto external DSSession BackendApi.GetDSSession ( )

Get DS server instance.

◆ GetErrorCode()

string BackendApi.GetErrorCode ( int code)

Error code to string.

◆ GetLinkItem()

proto external string BackendApi.GetLinkItem ( string linkName)

Return specific Link by it's name.

◆ GetLocalIdentityId()

proto external string BackendApi.GetLocalIdentityId ( )

Get Local Identity ID on client.

◆ GetMainStatus()

proto external ServiceStatusItem BackendApi.GetMainStatus ( )

Return Main status object.

◆ GetNewsCount()

proto external int BackendApi.GetNewsCount ( )

Return count of News messages.

◆ GetNewsItem()

proto external NewsFeedItem BackendApi.GetNewsItem ( int iIndex)

Return specific News message.

◆ GetNotifyCount()

proto external int BackendApi.GetNotifyCount ( )

Return count of Notification messages.

◆ GetNotifyItem()

proto external NewsFeedItem BackendApi.GetNotifyItem ( int iIndex)

Return specific Notification message.

◆ GetPlayerIdentityId()

proto external string BackendApi.GetPlayerIdentityId ( int iPlayerId)

Get Player Identity ID by Player ID.

Parameters
iPlayerIdIs id of player in session

◆ GetPlayerPlatformId()

proto external string BackendApi.GetPlayerPlatformId ( int iPlayerId)

Get Player Platform ID by Player ID.

Parameters
iPlayerIdIs id of player in session
Note
Xbox and PS Ids are hashed in SHA-256

◆ GetPlayerPlatformKind()

proto external PlatformKind BackendApi.GetPlayerPlatformKind ( int iPlayerId)

Get Player Platform Kind by Player ID.

Parameters
iPlayerIdIs id of player in session

◆ GetPlayerUID()

string BackendApi.GetPlayerUID ( int iPlayerId)

◆ GetRunningDSConfig()

proto external bool BackendApi.GetRunningDSConfig ( DSConfig config)

◆ GetServerConfigApi()

proto external ServerConfigApi BackendApi.GetServerConfigApi ( )

Get Server Config Api.

◆ GetStatusCount()

proto external int BackendApi.GetStatusCount ( )

Return count of services.

◆ GetStatusItem()

proto external ServiceStatusItem BackendApi.GetStatusItem ( int iIndex)

Return specific status object.

◆ GetStorage()

proto external SessionStorage BackendApi.GetStorage ( )

Get Session Storage.

◆ GetWorkshop()

proto external WorkshopApi BackendApi.GetWorkshop ( )

Get Workshop Api.

◆ IsActive()

proto external bool BackendApi.IsActive ( )

True if HTTP communication active (initialized)

◆ IsAuthenticated()

proto external bool BackendApi.IsAuthenticated ( )

Client is Authenticated - relate requests may proceed.

◆ IsAuthInProgress()

proto external bool BackendApi.IsAuthInProgress ( )

Client is busy - Authentication in process.

◆ IsBIAccountLinked()

proto external bool BackendApi.IsBIAccountLinked ( )

Return true if BI Account is linked to local Identity.

◆ IsInitializing()

proto external bool BackendApi.IsInitializing ( )

True if HTTP communication is being activated (initializing yet)

◆ IsListedServerAdmin()

proto external bool BackendApi.IsListedServerAdmin ( int iPlayerId)

Check if player is in list of admins defined in server config.

Parameters
iPlayerIdis Id of Player which is being verified

◆ IsLocalPlatformAssigned()

proto external bool BackendApi.IsLocalPlatformAssigned ( )

Return true if local platform data are to be used for authentication/ persistency of client (meaningless on server)

◆ IsRunning()

proto external bool BackendApi.IsRunning ( )

True if HTTP communication enabled (initialization, runtime or shutdown may be pending at same time)

◆ IsServerOwner()

proto external bool BackendApi.IsServerOwner ( int iPlayerId)

Check if player is server owner defined by ownerToken.

Parameters
iPlayerIdis Id of Player which is being verified

◆ LoadDSConfig()

proto external bool BackendApi.LoadDSConfig ( DSConfig config,
string fileName )

◆ NewSession()

proto external void BackendApi.NewSession ( )

Called when new server or client game session is started.

◆ OnCannotInitiate()

void BackendApi.OnCannotInitiate ( int code)

Called when initiate cannot be called.

◆ OnPlatformActive()

void BackendApi.OnPlatformActive ( )

Called when platform ready and provided all data necessary to connect online.

◆ OnPlatformMissing()

void BackendApi.OnPlatformMissing ( )

Called when platform is not ready - perhaps user is not signed-in.

◆ PlayerData()

proto external void BackendApi.PlayerData ( JsonApiStruct dataObject,
int iPlayerId )

Expand player data upon defined structure, this is Server-Side only!

Note
Data are available only after player was successfully accepted into Room/ Lobby on server
Parameters
dataObjectIs optional destination when request uses or response return Json data and you want to work with object
iPlayerIdIs Player Id used on player identity

◆ PlayerRequest()

proto external void BackendApi.PlayerRequest ( int request,
BackendCallback cb,
JsonApiStruct dataObject,
int iPlayerId )

Ask player request with callback result from controller (Lobby)

Parameters
requestIs type of request, which is EBackendRequest
cbIs script callback where you will recieve result/ error or even data when request finsihes
dataObjectIs optional destination when request uses or response return Json data and you want to work with object
iPlayerIdIs Player Id used on player identity

◆ RefreshCommStatus()

proto external void BackendApi.RefreshCommStatus ( )

Refresh status - ping services to obtain response time.

◆ RemainingAccountLockedTime()

proto external int BackendApi.RemainingAccountLockedTime ( )

The bi-account remains locked for X seconds.

◆ Request()

proto external void BackendApi.Request ( int request,
BackendCallback cb,
JsonApiStruct dataObject )

Ask specific request with callback result.

Parameters
requestIs type of request, which is EBackendRequest
cbIs script callback where you will recieve result/ error or even data when request finsihes
dataObjectIs optional destination when request uses or response return Json data and you want to work with object

◆ SaveDSConfig()

proto external bool BackendApi.SaveDSConfig ( DSConfig config,
string fileName )

◆ SetCredentialsItem()

proto external void BackendApi.SetCredentialsItem ( EBackendCredentials item,
string str )

Set credentials value per item.

Parameters
itemIs type of EBackendCredentials parameter you want to set
strIs value itself

◆ SetDebugHandling()

proto external void BackendApi.SetDebugHandling ( EBackendRequest eRequest,
EBackendDebugHandling eHandlingType )

Debugging API for internal builds.

◆ SetDefaultIpPort()

proto external void BackendApi.SetDefaultIpPort ( DSConfig config)

◆ SetSessionCallback()

proto external void BackendApi.SetSessionCallback ( DSSessionCallback callback)

Set session callback to recieve all session related events.

Parameters
callback- check all events and respective description upon object

◆ SettingsData()

proto external void BackendApi.SettingsData ( string sFileName,
JsonApiStruct dataObject )

Expand settings data upon defined structure, this is Server-Side only!

Note
Data are available only after game was successfully executed and connected to online services
Parameters
sFileNameIs name of settings file you want to access, remember - it must exist!
dataObjectIs optional destination when request uses or response return Json data and you want to work with object

◆ Shutdown()

proto external bool BackendApi.Shutdown ( )

Shutdown backend - request processing.

◆ Unlink()

proto external void BackendApi.Unlink ( BackendCallback callback)

Unlink the bi-account and clear credentials.

◆ VerifyCredentials()

proto external void BackendApi.VerifyCredentials ( BackendCallback callback,
bool storeCredentials )

Invoke credentials update (authenticate with new name+password)


The documentation for this interface was generated from the following file: