4 ref ScriptInvoker m_OnResult =
new ScriptInvoker;
8 override void OnPrivilegeResult(UserPrivilege privilege, UserPrivilegeResult result)
10 m_OnResult.Invoke(privilege, result);
18 ref ScriptInvoker m_OnDownloading =
new ScriptInvoker();
19 ref ScriptInvoker m_OnSuccess =
new ScriptInvoker();
20 ref ScriptInvoker m_OnItem =
new ScriptInvoker();
21 ref ScriptInvoker m_OnDownloadSuccess =
new ScriptInvoker();
22 ref ScriptInvoker m_OnUnsubscribe =
new ScriptInvoker();
23 ref ScriptInvoker m_OnScenarios =
new ScriptInvoker();
24 ref ScriptInvoker m_OnImage =
new ScriptInvoker();
25 ref ScriptInvoker m_OnDependencies =
new ScriptInvoker();
27 ref ScriptInvoker m_OnError =
new ScriptInvoker();
28 ref ScriptInvoker m_OnTimeout =
new ScriptInvoker();
33 m_OnDownloading =
null;
36 m_OnDownloadSuccess =
null;
37 m_OnUnsubscribe =
null;
38 m_OnDependencies =
null;
44 override void OnSuccess(
int code)
48 case EBackendRequest.EBREQ_WORKSHOP_GetDownloadURL:
49 m_OnDownloading.Invoke();
52 case EBackendRequest.EBREQ_WORKSHOP_GetAsset:
53 m_OnItem.Invoke(code);
56 case EBackendRequest.EBREQ_WORKSHOP_DownloadAsset:
57 m_OnDownloadSuccess.Invoke(code);
60 case EBackendRequest.EBREQ_WORKSHOP_DeleteSubscriptions:
61 m_OnUnsubscribe.Invoke();
64 case EBackendRequest.EBREQ_WORKSHOP_GetDependencyTree:
65 m_OnDependencies.Invoke(code);
68 case EBackendRequest.EBREQ_WORKSHOP_DownloadImage:
69 m_OnImage.Invoke(code);
72 case EBackendRequest.EBREQ_WORKSHOP_GetAssetScenarios:
73 m_OnScenarios.Invoke(code);
82 override void OnError( EBackendError code,
int restCode,
int apiCode )
84 Print(
"[BackendCallback] OnError: "+ g_Game.GetBackendApi().GetErrorCode(code) +
" RestCode: " + restCode +
" ApiCode: "+apiCode);
85 m_OnError.Invoke(code);
88 override void OnTimeout()
90 Print(
"[BackendCallback] OnTimeout");
104 ref ScriptInvoker m_OnError =
new ScriptInvoker;
105 ref ScriptInvoker m_OnTimeout =
new ScriptInvoker;
106 ref ScriptInvoker m_OnSuccess =
new ScriptInvoker;
111 #ifdef WORKSHOP_DEBUG
112 Print(
string.Format(
"%1 new",
this), LogLevel.DEBUG);
119 #ifdef WORKSHOP_DEBUG
120 Print(
string.Format(
"%1 Delete",
this), LogLevel.DEBUG);
125 override void OnSuccess(
int code )
127 #ifdef WORKSHOP_DEBUG
128 Print(
string.Format(
"%1 OnSuccess: %2",
this,
typename.EnumToString(EBackendRequest, code)), LogLevel.DEBUG);
130 m_OnSuccess.Invoke(
this, code);
134 override void OnError(EBackendError code,
int restCode,
int apiCode )
136 Print(
string.Format(
"%1 OnError: %2 %3 %4",
this,
typename.EnumToString(EBackendError, code), restCode, apiCode), LogLevel.ERROR);
137 m_OnError.Invoke(
this, code, restCode, apiCode);
141 override void OnTimeout()
143 Print(
string.Format(
"%1 OnTimeout",
this), LogLevel.ERROR);
144 m_OnTimeout.Invoke(
this);
168 ref ScriptInvoker m_OnDownloadImage =
new ScriptInvoker;
169 ref ScriptInvoker m_OnGetAssets =
new ScriptInvoker;
176 #ifdef WORKSHOP_DEBUG
177 Print(
string.Format(
"%1 New: page: %2",
this, this.m_iPageId), LogLevel.DEBUG);
183 #ifdef WORKSHOP_DEBUG
184 Print(
string.Format(
"%1 Delete: page: %2",
this, this.m_iPageId), LogLevel.DEBUG);
189 override void OnSuccess(
int code)
191 super.OnSuccess(code);
195 case EBackendRequest.EBREQ_WORKSHOP_GetAssetList:
196 m_OnGetAssets.Invoke(
this);
199 case EBackendRequest.EBREQ_WORKSHOP_DownloadImage:
200 m_OnDownloadImage.Invoke(
this);
213 ref ScriptInvoker m_OnGetAsset =
new ScriptInvoker;
214 ref ScriptInvoker m_OnGetDependencyTree =
new ScriptInvoker;
215 ref ScriptInvoker m_OnDownloadImage =
new ScriptInvoker;
216 ref ScriptInvoker m_OnGetAssetScenarios =
new ScriptInvoker;
225 override void OnSuccess(
int code)
227 super.OnSuccess(code);
231 case EBackendRequest.EBREQ_WORKSHOP_GetAsset:
232 m_OnGetAsset.Invoke(
this);
235 case EBackendRequest.EBREQ_WORKSHOP_GetDependencyTree:
236 m_OnGetDependencyTree.Invoke(
this);
239 case EBackendRequest.EBREQ_WORKSHOP_DownloadImage:
240 m_OnDownloadImage.Invoke(
this);
243 case EBackendRequest.EBREQ_WORKSHOP_GetAssetScenarios:
244 m_OnGetAssetScenarios.Invoke(
this);