3 static const string SESSION_SAVE_NAME =
"SCR_SaveFileManager_SessionSave";
5 protected string m_sFileName;
9 protected bool m_bHasData =
false;
11 override void OnSuccess(
int code)
13 super.OnSuccess(code);
15 PrintFormat(
"[SCR_ServerSaveRequestCallback] OnSuccess(): code=%1", code);
20 m_bHasData = code == EBackendRequest.EBREQ_WORKSHOP_GetAsset;
23 WorldSaveManifest manifest =
new WorldSaveManifest();
25 bool isNew =
GetGame().GetBackendApi().GetWorldSaveApi().GetTotalItemCount() == 0;
29 array<WorldSaveItem> items = {};
30 GetGame().GetBackendApi().GetWorldSaveApi().GetPageItems(items);
34 item.FillManifest(manifest);
43 manifest.m_sName = SESSION_SAVE_NAME;
50 item =
GetGame().GetBackendApi().GetWorldSaveApi().CreateLocalWorldSave(manifest);
55 GetGame().GetBackendApi().GetWorldSaveApi().UploadWorldSave(manifest, m_UploadCallback, item);
57 override void OnError(
int code,
int restCode,
int apiCode)
59 super.OnError(code, restCode, apiCode);
60 PrintFormat(
"[SCR_ServerSaveRequestCallback] OnError: code=%1 ('%4'), restCode=%2, apiCode=%3", code, restCode, apiCode,
GetGame().GetBackendApi().GetErrorCode(code));
62 override void OnTimeout()
65 Print(
"[SCR_ServerSaveRequestCallback] OnTimeout");
72 m_PageParams.limit = 1;
73 GetGame().GetBackendApi().GetWorldSaveApi().RequestPage(
this, m_PageParams,
false);
78 override void OnPack()
80 StoreBoolean(
"owned",
true);
87 override void OnSuccess(
int code)
89 PrintFormat(
"[SCR_ServerSaveUploadCallback] OnSuccess(): code=%1", code);
95 override void OnError(
int code,
int restCode,
int apiCode)
97 PrintFormat(
"[SCR_ServerSaveUploadCallback] OnError: code=%1 ('%4'), restCode=%2, apiCode=%3", code, restCode, apiCode,
GetGame().GetBackendApi().GetErrorCode(code));
99 override void OnTimeout()
101 Print(
"[SCR_ServerSaveUploadCallback] OnTimeout");