DayZ 1.24
Loading...
Searching...
No Matches
BackendApi Class Reference

Private Member Functions

void BackendApi ()
 
void ~BackendApi ()
 
proto native bool Initiate ()
 Initiate backend - request processing.
 
proto native bool Shutdown ()
 Shutdown backend - request processing.
 
proto native bool IsDisconnected ()
 Backend offline - authentication may be initiated.
 
proto native bool IsRuntime ()
 Backend fully working and initialized.
 
proto native bool IsBusy ()
 Backend is busy - authentication in process.
 
string GetErrorCode (int code)
 Error code to string.
 
void OnCannotInitiate (int code)
 Called when initiate cannot be called.
 
void OnCannotShutdown (int code)
 Called when shutdown cannot be proceeded.
 
void OnSuccess (string step)
 Called when step was successfully proceeded.
 
void OnFail (string step)
 Called when step failed.
 
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 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 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 ()
 Invoke credentials update (authenticate with new name+password)
 

Detailed Description

Definition at line 129 of file BackendApi.c.

Constructor & Destructor Documentation

◆ BackendApi()

void BackendApi::BackendApi ( )
inlineprivate

Definition at line 131 of file BackendApi.c.

131{}

◆ ~BackendApi()

void BackendApi::~BackendApi ( )
inlineprivate

Definition at line 132 of file BackendApi.c.

132{}

Member Function Documentation

◆ FeedbackMessage()

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

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
dataIs optional callback when request uses or response return Json data and you want to work with object
messageIs custom

◆ GetCredentialsItem()

proto native string BackendApi::GetCredentialsItem ( EBackendCredentials item)
private

Get credentials value per item.

Parameters
itemIs type of EBackendCredentials parameter you want to read

◆ GetErrorCode()

string BackendApi::GetErrorCode ( int code)
inlineprivate

Error code to string.

Definition at line 159 of file BackendApi.c.

160 {
161 string result;
162
163 if (code == EBackendError.EBERR_OK)
164 result = "OK";
165 else if (code == EBackendError.EBERR_UNKNOWN)
166 result = "Offline";
167 else if (code == EBackendError.EBERR_DISABLED)
168 result = "Communication Disabled";
169 else if (code == EBackendError.EBERR_INVALID_STATE)
170 result = "Cannot be called from current state";
171 else if (code == EBackendError.EBERR_BUSY)
172 result = "Busy processing requests";
173 else if (code == EBackendError.EBERR_ALREADY_OFFLINE)
174 result = "Already disconnected";
175 else if (code == EBackendError.EBERR_ALREADY_ONLINE)
176 result = "Already connected";
177 else if (code == EBackendError.EBERR_LOGIN_FAILED)
178 result = "Failed to logon";
179 else if (code == EBackendError.EBERR_AUTH_FAILED)
180 result = "Failed to Authenticate";
181 else
182 result = "*";
183
184 return result;
185 }
EBackendError
Backend error.
Definition BackendApi.c:7

Referenced by OnCannotInitiate(), and OnCannotShutdown().

◆ Initiate()

proto native bool BackendApi::Initiate ( )
private

Initiate backend - request processing.

◆ IsBusy()

proto native bool BackendApi::IsBusy ( )
private

Backend is busy - authentication in process.

◆ IsDisconnected()

proto native bool BackendApi::IsDisconnected ( )
private

Backend offline - authentication may be initiated.

◆ IsRuntime()

proto native bool BackendApi::IsRuntime ( )
private

Backend fully working and initialized.

◆ OnCannotInitiate()

void BackendApi::OnCannotInitiate ( int code)
inlineprivate

Called when initiate cannot be called.

Definition at line 190 of file BackendApi.c.

191 {
192 Print("!!! [Backend] Cannot Initiate: " + GetErrorCode(code));
193 }
string GetErrorCode(int code)
Error code to string.
Definition BackendApi.c:159
proto void Print(void var)
Prints content of variable to console/log.

References GetErrorCode(), and Print().

◆ OnCannotShutdown()

void BackendApi::OnCannotShutdown ( int code)
inlineprivate

Called when shutdown cannot be proceeded.

Definition at line 198 of file BackendApi.c.

199 {
200 Print("!!! [Backend] Cannot Shutdown: " + GetErrorCode(code));
201 }

References GetErrorCode(), and Print().

◆ OnFail()

void BackendApi::OnFail ( string step)
inlineprivate

Called when step failed.

Definition at line 214 of file BackendApi.c.

215 {
216 Print("[Backend] Failed to Proceed: " + step);
217 }

References Print().

◆ OnSuccess()

void BackendApi::OnSuccess ( string step)
inlineprivate

Called when step was successfully proceeded.

Definition at line 206 of file BackendApi.c.

207 {
208 Print("[Backend] Successfully Solicited: " + step);
209 }

References Print().

◆ PlayerRequest()

proto native void BackendApi::PlayerRequest ( int request,
BackendCallback cb,
JsonApiStruct dataObject,
int iPlayerId )
private

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
dataIs optional callback when request uses or response return Json data and you want to work with object
iPlayerIdIs Player Id used on player identity

◆ Request()

proto native void BackendApi::Request ( int request,
BackendCallback cb,
JsonApiStruct dataObject )
private

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
dataIs optional callback when request uses or response return Json data and you want to work with object

◆ SetCredentialsItem()

proto native void BackendApi::SetCredentialsItem ( EBackendCredentials item,
string str )
private

Set credentials value per item.

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

◆ Shutdown()

proto native bool BackendApi::Shutdown ( )
private

Shutdown backend - request processing.

◆ VerifyCredentials()

proto native void BackendApi::VerifyCredentials ( )
private

Invoke credentials update (authenticate with new name+password)


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