Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
BackendApi Interface Reference

Public Member Functions

void BackendApi ()
 
void ~BackendApi ()
 
proto native void SetSessionCallback (DSSessionCallback callback)
 Set session callback to recieve all session related events.
 
proto native WorkshopApi GetWorkshop ()
 Get Workshop Api.
 
proto native WorldSaveApi GetWorldSaveApi ()
 
proto native ClientLobbyApi GetClientLobby ()
 Get Lobby Api.
 
proto native int GetDSBoxcount ()
 Get active count of server instances.
 
proto native DSBox GetDSBox (int iIndex)
 Get DS box instance.
 
proto native SessionStorage GetStorage ()
 Get Session Storage.
 
proto native DSSession GetDSSession ()
 Get DS server instance.
 
proto native int GetStatusCount ()
 Return count of services.
 
proto native ServiceStatusItem GetStatusItem (int iIndex)
 Return specific status object.
 
proto native ServiceStatusItem GetMainStatus ()
 Return Main status object.
 
proto native int GetNewsCount ()
 Return count of News messages.
 
proto native NewsFeedItem GetNewsItem (int iIndex)
 Return specific News message.
 
proto native int GetNotifyCount ()
 Return count of Notification messages.
 
proto native NewsFeedItem GetNotifyItem (int iIndex)
 Return specific Notification message.
 
proto native string GetLinkItem (string linkName)
 Return specific Link by it's name.
 
proto native bool Shutdown ()
 Shutdown backend - request processing.
 
proto native bool IsAuthenticated ()
 Client is Authenticated - relate requests may procceed.
 
proto native bool IsAuthInProgress ()
 Client is busy - Authentication in process.
 
proto native bool IsRunning ()
 True if HTTP communication enabled (initialization, runtime or shutdown may be pending at same time)
 
proto native bool IsInitializing ()
 True if HTTP communication is being activated (initializing yet)
 
proto native bool IsActive ()
 True if HTTP communication active (initialized)
 
proto native void RefreshCommStatus ()
 Refresh status - ping services to obtain response time.
 
proto native int GetCommTestStatus ()
 Get comm test status, 0==not executed, 1==running, 2==finished, 3==failed.
 
proto native float GetCommResponseTime ()
 Read service response time in milliseconds, call RefreshCommStatus() to update results.
 
proto native float GetCommTimeLastSuccess ()
 Get time in seconds since last successful request (limit is 1hr - does not count more)
 
proto native float GetCommTimeLastFail ()
 Get time in seconds since last successful request (limit is 1hr - does not count more)
 
proto native void Unlink (BackendCallback callback)
 Unlink the bi-account and clear credentials.
 
string GetErrorCode (int code)
 Error code to string.
 
void OnPlatformActive (int code)
 Called when platform ready and provided all data necessary to connect online.
 
void OnPlatformMissing (int code)
 Called when platform is not ready - perhaps user is not signed-in.
 
void OnCannotInitiate (int code)
 Called when initiate cannot be called.
 
void OnCannotShutdown (int code)
 Called when shutdown cannot be proceeded.
 
void OnCannotAuth (int code)
 Called when authentication failed.
 
void OnSuccess (string step)
 Called when step was successfully proceeded.
 
void OnFail (string step)
 Called when step failed.
 
string GetPlayerUID (int iPlayerId)
 
proto native string GetPlayerIdentityId (int iPlayerId)
 Get Player Identity ID by Player ID.
 
proto native string GetLocalIdentityId ()
 Get Local Identity ID on client.
 
proto native bool IsLocalPlatformAssigned ()
 Return true if local platform data are to be used for authentication/ persistency of client (meaningless on server)
 
proto native void Request (int request, BackendCallback cb, JsonApiStruct dataObject)
 Ask specific request with callback result.
 
proto native void PlayerRequest (int request, BackendCallback cb, JsonApiStruct dataObject, int iPlayerId)
 Ask player request with callback result from controller (Lobby)
 
proto native void PlayerData (JsonApiStruct dataObject, int iPlayerId)
 Expand player data upon defined structure, this is Server-Side only!
 
proto native void SettingsData (string sFileName, JsonApiStruct dataObject)
 Expand settings data upon defined structure, this is Server-Side only!
 
proto native void FeedbackMessage (BackendCallback cb, JsonApiStruct dataObject, string message)
 Send feedback message and/ or script object with whatever data on it (additionally it is possible to handle callback as well)
 
proto native void FeedbackImage (BackendCallback cb, JsonApiStruct dataObject, string fileName)
 Send feedback image and/ or script object with whatever data on it (additionally it is possible to handle callback as well)
 
proto native void SetCredentialsItem (EBackendCredentials item, string str)
 Set credentials value per item.
 
proto native string GetCredentialsItem (EBackendCredentials item)
 Get credentials value per item.
 
proto native void VerifyCredentials (BackendCallback callback, bool storeCredentials)
 Invoke credentials update (authenticate with new name+password)
 
proto native int RemainingAccountLockedTime ()
 The bi-account remains locked for X seconds.
 
proto native bool IsBIAccountLinked ()
 Return true if BI Account is linked to local Identity.
 
proto native owned string GetBackendEnv ()
 Get target backend environment.
 
proto native bool GetRunningDSConfig (DSConfig config)
 
proto native bool LoadDSConfig (DSConfig config, string fileName)
 
proto native bool SaveDSConfig (DSConfig config, string fileName)
 
proto native void SetDefaultIpPort (DSConfig config)
 
proto native int GetAvailableConfigs (out notnull array< string > configs)
 
proto native int GetAvailableConfigPaths (out notnull array< string > configs)
 
proto native ServerConfigApi GetServerConfigApi ()
 
proto native BanServiceApi GetBanServiceApi ()
 Get Ban Service API.
 
proto native bool IsListedServerAdmin (int iPlayerId)
 Check if player is in list of admins defined in server config.
 
proto native bool IsServerOwner (int iPlayerId)
 Check if player is server owner defined by ownerToken.
 
proto native void NewSession ()
 Called when new server or client game session is started.
 
proto native void SetDebugHandling (EBackendRequest eRequest, EBackendDebugHandling eHandlingType)
 Debugging API for internal builds.
 

Constructor & Destructor Documentation

◆ BackendApi()

void BackendApi.BackendApi ( )

◆ ~BackendApi()

void BackendApi.~BackendApi ( )

Member Function Documentation

◆ FeedbackImage()

proto native void BackendApi.FeedbackImage ( BackendCallback  cb,
JsonApiStruct  dataObject,
string  fileName 
)

Send feedback image 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
fileNameIs path to image you want to send

◆ FeedbackMessage()

proto native void BackendApi.FeedbackMessage ( BackendCallback  cb,
JsonApiStruct  dataObject,
string  message 
)

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

◆ GetAvailableConfigPaths()

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

◆ GetAvailableConfigs()

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

◆ GetBackendEnv()

proto native owned string BackendApi.GetBackendEnv ( )

Get target backend environment.

◆ GetBanServiceApi()

proto native BanServiceApi BackendApi.GetBanServiceApi ( )

Get Ban Service API.

◆ GetClientLobby()

proto native ClientLobbyApi BackendApi.GetClientLobby ( )

Get Lobby Api.

◆ GetCommResponseTime()

proto native float BackendApi.GetCommResponseTime ( )

Read service response time in milliseconds, call RefreshCommStatus() to update results.

◆ GetCommTestStatus()

proto native int BackendApi.GetCommTestStatus ( )

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

◆ GetCommTimeLastFail()

proto native float BackendApi.GetCommTimeLastFail ( )

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

◆ GetCommTimeLastSuccess()

proto native float BackendApi.GetCommTimeLastSuccess ( )

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

◆ GetCredentialsItem()

proto native string BackendApi.GetCredentialsItem ( EBackendCredentials  item)

Get credentials value per item.

Parameters
itemIs type of EBackendCredentials parameter you want to read

◆ GetDSBox()

proto native DSBox BackendApi.GetDSBox ( int  iIndex)

Get DS box instance.

◆ GetDSBoxcount()

proto native int BackendApi.GetDSBoxcount ( )

Get active count of server instances.

◆ GetDSSession()

proto native DSSession BackendApi.GetDSSession ( )

Get DS server instance.

◆ GetErrorCode()

string BackendApi.GetErrorCode ( int  code)

Error code to string.

◆ GetLinkItem()

proto native string BackendApi.GetLinkItem ( string  linkName)

Return specific Link by it's name.

◆ GetLocalIdentityId()

proto native string BackendApi.GetLocalIdentityId ( )

Get Local Identity ID on client.

◆ GetMainStatus()

proto native ServiceStatusItem BackendApi.GetMainStatus ( )

Return Main status object.

◆ GetNewsCount()

proto native int BackendApi.GetNewsCount ( )

Return count of News messages.

◆ GetNewsItem()

proto native NewsFeedItem BackendApi.GetNewsItem ( int  iIndex)

Return specific News message.

◆ GetNotifyCount()

proto native int BackendApi.GetNotifyCount ( )

Return count of Notification messages.

◆ GetNotifyItem()

proto native NewsFeedItem BackendApi.GetNotifyItem ( int  iIndex)

Return specific Notification message.

◆ GetPlayerIdentityId()

proto native string BackendApi.GetPlayerIdentityId ( int  iPlayerId)

Get Player Identity ID by Player ID.

Parameters
iPlayerIdIs id of player in session

◆ GetPlayerUID()

string BackendApi.GetPlayerUID ( int  iPlayerId)

◆ GetRunningDSConfig()

proto native bool BackendApi.GetRunningDSConfig ( DSConfig  config)

◆ GetServerConfigApi()

proto native ServerConfigApi BackendApi.GetServerConfigApi ( )

◆ GetStatusCount()

proto native int BackendApi.GetStatusCount ( )

Return count of services.

◆ GetStatusItem()

proto native ServiceStatusItem BackendApi.GetStatusItem ( int  iIndex)

Return specific status object.

◆ GetStorage()

proto native SessionStorage BackendApi.GetStorage ( )

Get Session Storage.

◆ GetWorkshop()

proto native WorkshopApi BackendApi.GetWorkshop ( )

Get Workshop Api.

◆ GetWorldSaveApi()

proto native WorldSaveApi BackendApi.GetWorldSaveApi ( )

◆ IsActive()

proto native bool BackendApi.IsActive ( )

True if HTTP communication active (initialized)

◆ IsAuthenticated()

proto native bool BackendApi.IsAuthenticated ( )

Client is Authenticated - relate requests may procceed.

◆ IsAuthInProgress()

proto native bool BackendApi.IsAuthInProgress ( )

Client is busy - Authentication in process.

◆ IsBIAccountLinked()

proto native bool BackendApi.IsBIAccountLinked ( )

Return true if BI Account is linked to local Identity.

◆ IsInitializing()

proto native bool BackendApi.IsInitializing ( )

True if HTTP communication is being activated (initializing yet)

◆ IsListedServerAdmin()

proto native 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 native bool BackendApi.IsLocalPlatformAssigned ( )

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

◆ IsRunning()

proto native bool BackendApi.IsRunning ( )

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

◆ IsServerOwner()

proto native 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 native bool BackendApi.LoadDSConfig ( DSConfig  config,
string  fileName 
)

◆ NewSession()

proto native void BackendApi.NewSession ( )

Called when new server or client game session is started.

◆ OnCannotAuth()

void BackendApi.OnCannotAuth ( int  code)

Called when authentication failed.

◆ OnCannotInitiate()

void BackendApi.OnCannotInitiate ( int  code)

Called when initiate cannot be called.

◆ OnCannotShutdown()

void BackendApi.OnCannotShutdown ( int  code)

Called when shutdown cannot be proceeded.

◆ OnFail()

void BackendApi.OnFail ( string  step)

Called when step failed.

◆ OnPlatformActive()

void BackendApi.OnPlatformActive ( int  code)

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

◆ OnPlatformMissing()

void BackendApi.OnPlatformMissing ( int  code)

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

◆ OnSuccess()

void BackendApi.OnSuccess ( string  step)

Called when step was successfully proceeded.

◆ PlayerData()

proto native 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 native 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 native void BackendApi.RefreshCommStatus ( )

Refresh status - ping services to obtain response time.

◆ RemainingAccountLockedTime()

proto native int BackendApi.RemainingAccountLockedTime ( )

The bi-account remains locked for X seconds.

◆ Request()

proto native 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 native bool BackendApi.SaveDSConfig ( DSConfig  config,
string  fileName 
)

◆ SetCredentialsItem()

proto native 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 native void BackendApi.SetDebugHandling ( EBackendRequest  eRequest,
EBackendDebugHandling  eHandlingType 
)

Debugging API for internal builds.

◆ SetDefaultIpPort()

proto native void BackendApi.SetDefaultIpPort ( DSConfig  config)

◆ SetSessionCallback()

proto native 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 native 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 native bool BackendApi.Shutdown ( )

Shutdown backend - request processing.

◆ Unlink()

proto native void BackendApi.Unlink ( BackendCallback  callback)

Unlink the bi-account and clear credentials.

◆ VerifyCredentials()

proto native 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: