24 protected int m_iCode = -1;
25 protected int m_iRestCode = -1;
26 protected int m_iApiCode = -1;
30 protected ref ScriptInvoker<SCR_BackendCallback> Event_OnSuccess;
31 protected ref ScriptInvoker<SCR_BackendCallback, int, int, int> Event_OnFail;
32 protected ref ScriptInvoker<SCR_BackendCallback> Event_OnTimeOut;
34 protected ref ScriptInvoker<SCR_BackendCallback> Event_OnResponse;
41 protected void InvokeEventOnSuccess()
44 Event_OnSuccess.Invoke(
this);
48 ScriptInvoker GetEventOnSuccess()
51 Event_OnSuccess =
new ScriptInvoker();
53 return Event_OnSuccess;
60 Event_OnFail.Invoke(
callback, code, restCode, apiCode);
64 ScriptInvoker GetEventOnFail()
67 Event_OnFail =
new ScriptInvoker();
73 protected void InvokeEventOnTimeOut()
76 Event_OnTimeOut.Invoke(
this);
80 ScriptInvoker GetEventOnTimeOut()
83 Event_OnTimeOut =
new ScriptInvoker();
85 return Event_OnTimeOut;
89 protected void InvokeEventOnResponse()
92 Event_OnResponse.Invoke(
this);
96 ScriptInvoker GetEventOnResponse()
98 if (!Event_OnResponse)
99 Event_OnResponse =
new ScriptInvoker();
101 return Event_OnResponse;
109 override void OnSuccess(
int code)
113 InvokeEventOnSuccess();
115 InvokeEventOnResponse();
119 override void OnError(
int code,
int restCode,
int apiCode)
122 InvokeEventOnFail(
this, code, restCode, apiCode);
124 InvokeEventOnResponse();
128 override void OnTimeout()
131 InvokeEventOnTimeOut();
133 InvokeEventOnResponse();
144 protected void CacheLastResponse(
EBackendCallbackResponse result,
int code = -1,
int restCode = -1,
int apiCode = -1)
148 m_iRestCode = restCode;
149 m_iApiCode = apiCode;