com.taptap.sdk.cloudsave 4.8.0-beta.1 → 4.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Mobile/Editor/NativeDependencies.xml +8 -2
- package/Mobile/Editor/TapCloudSaveMobileProcessBuild.cs +1 -0
- package/Mobile/Runtime/TapCloudSaveBridge.cs +168 -57
- package/Runtime/Internal/ITapCloudSaveBridge.cs +14 -9
- package/Runtime/Internal/TapCloudSaveInitTask.cs +2 -0
- package/Runtime/Internal/TapTapCloudSaveInternal.cs +22 -29
- package/Runtime/Public/TapTapCloudSave.cs +18 -29
- package/Standalone/Editor/TapCloudSaveStandaloneProcessBuild.cs +26 -0
- package/Standalone/Editor/TapCloudSaveStandaloneProcessBuild.cs.meta +11 -0
- package/Standalone/Editor/TapSDK.CloudSave.Standalone.Editor.asmdef +17 -0
- package/Standalone/Editor/TapSDK.CloudSave.Standalone.Editor.asmdef.meta +7 -0
- package/Standalone/Editor.meta +8 -0
- package/Standalone/Plugins/x86_64/cloudsave_sdk.dll +0 -0
- package/Standalone/Plugins/x86_64/cloudsave_sdk.dll.meta +80 -0
- package/Standalone/Plugins/x86_64.meta +8 -0
- package/Standalone/Plugins.meta +8 -0
- package/Standalone/Runtime/Internal/TapCloudSaveArchiveListResponse.cs +11 -0
- package/Standalone/Runtime/Internal/TapCloudSaveArchiveListResponse.cs.meta +11 -0
- package/Standalone/Runtime/Internal/TapCloudSaveBaseResponse.cs +29 -0
- package/Standalone/Runtime/Internal/TapCloudSaveBaseResponse.cs.meta +11 -0
- package/Standalone/Runtime/Internal/TapCloudSaveTracker.cs +101 -0
- package/Standalone/Runtime/Internal/TapCloudSaveTracker.cs.meta +11 -0
- package/Standalone/Runtime/Internal/TapCloudSaveWrapper.cs +518 -0
- package/Standalone/Runtime/Internal/TapCloudSaveWrapper.cs.meta +11 -0
- package/Standalone/Runtime/Internal.meta +8 -0
- package/Standalone/Runtime/TapCloudSaveResultCode.cs +9 -0
- package/Standalone/Runtime/TapCloudSaveResultCode.cs.meta +11 -0
- package/Standalone/Runtime/TapCloudSaveStandalone.cs +672 -0
- package/Standalone/Runtime/TapCloudSaveStandalone.cs.meta +11 -0
- package/Standalone/Runtime.meta +8 -0
- package/Standalone/TapSDK.CloudSave.Standalone.Runtime.asmdef +22 -0
- package/Standalone/TapSDK.CloudSave.Standalone.Runtime.asmdef.meta +7 -0
- package/Standalone.meta +8 -0
- package/link.xml.meta +1 -1
- package/package.json +10 -10
|
@@ -1,46 +1,35 @@
|
|
|
1
|
-
using
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Threading.Tasks;
|
|
4
|
+
using TapSDK.CloudSave.Internal;
|
|
2
5
|
|
|
3
6
|
namespace TapSDK.CloudSave
|
|
4
7
|
{
|
|
5
8
|
public class TapTapCloudSave
|
|
6
9
|
{
|
|
10
|
+
public static readonly string Version = "4.8.1";
|
|
11
|
+
|
|
7
12
|
public static void RegisterCloudSaveCallback(ITapCloudSaveCallback callback)
|
|
8
13
|
{
|
|
9
14
|
TapTapCloudSaveInternal.RegisterCloudSaveCallback(callback);
|
|
10
15
|
}
|
|
11
16
|
|
|
12
|
-
public static
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
TapTapCloudSaveInternal.CreateArchive(metadata, archiveFilePath, archiveCoverPath, callback);
|
|
16
|
-
}
|
|
17
|
+
public static Task<ArchiveData> CreateArchive(ArchiveMetadata metadata, string archiveFilePath, string archiveCoverPath) =>
|
|
18
|
+
TapTapCloudSaveInternal.CreateArchive(metadata, archiveFilePath, archiveCoverPath);
|
|
17
19
|
|
|
18
|
-
public static
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
TapTapCloudSaveInternal.UpdateArchive(archiveUuid, metadata, archiveFilePath, archiveCoverPath, callback);
|
|
22
|
-
}
|
|
20
|
+
public static Task<ArchiveData> UpdateArchive(string archiveUuid, ArchiveMetadata metadata, string archiveFilePath, string archiveCoverPath) =>
|
|
21
|
+
TapTapCloudSaveInternal.UpdateArchive(archiveUuid, metadata, archiveFilePath, archiveCoverPath);
|
|
23
22
|
|
|
24
|
-
public static
|
|
25
|
-
|
|
26
|
-
TapTapCloudSaveInternal.DeleteArchive(archiveUuid, callback);
|
|
27
|
-
}
|
|
23
|
+
public static Task<ArchiveData> DeleteArchive(string archiveUuid) =>
|
|
24
|
+
TapTapCloudSaveInternal.DeleteArchive(archiveUuid);
|
|
28
25
|
|
|
29
|
-
public static
|
|
30
|
-
|
|
31
|
-
TapTapCloudSaveInternal.GetArchiveList(callback);
|
|
32
|
-
}
|
|
26
|
+
public static Task<List<ArchiveData>> GetArchiveList() =>
|
|
27
|
+
TapTapCloudSaveInternal.GetArchiveList();
|
|
33
28
|
|
|
34
|
-
public static
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
TapTapCloudSaveInternal.GetArchiveData(archiveUuid, archiveFileId, callback);
|
|
38
|
-
}
|
|
29
|
+
public static Task<byte[]> GetArchiveData(string archiveUuid, string archiveFileId) =>
|
|
30
|
+
TapTapCloudSaveInternal.GetArchiveData(archiveUuid, archiveFileId);
|
|
39
31
|
|
|
40
|
-
public static
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
TapTapCloudSaveInternal.GetArchiveCover(archiveUuid, archiveFileId, callback);
|
|
44
|
-
}
|
|
32
|
+
public static Task<byte[]> GetArchiveCover(string archiveUuid, string archiveFileId) =>
|
|
33
|
+
TapTapCloudSaveInternal.GetArchiveCover(archiveUuid, archiveFileId);
|
|
45
34
|
}
|
|
46
35
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using TapSDK.Core.Editor;
|
|
3
|
+
using UnityEditor.Build.Reporting;
|
|
4
|
+
|
|
5
|
+
namespace TapSDK.CloudSave.Standalone.Editor
|
|
6
|
+
{
|
|
7
|
+
public class TapCloudSaveStandaloneProcessBuild : SDKLinkProcessBuild
|
|
8
|
+
{
|
|
9
|
+
public override int callbackOrder => 0;
|
|
10
|
+
|
|
11
|
+
public override string LinkPath => "TapSDK/CloudSave/link.xml";
|
|
12
|
+
|
|
13
|
+
public override LinkedAssembly[] LinkedAssemblies =>
|
|
14
|
+
new LinkedAssembly[]
|
|
15
|
+
{
|
|
16
|
+
new LinkedAssembly { Fullname = "TapSDK.CloudSave.Runtime" },
|
|
17
|
+
new LinkedAssembly { Fullname = "TapSDK.CloudSave.Standalone.Runtime" },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
public override Func<BuildReport, bool> IsTargetPlatform =>
|
|
21
|
+
(report) =>
|
|
22
|
+
{
|
|
23
|
+
return BuildTargetUtils.IsSupportStandalone(report.summary.platform);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.CloudSave.Standalone.Editor",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:56f3da7a178484843974054bafe77e73"
|
|
5
|
+
],
|
|
6
|
+
"includePlatforms": [
|
|
7
|
+
"Editor"
|
|
8
|
+
],
|
|
9
|
+
"excludePlatforms": [],
|
|
10
|
+
"allowUnsafeCode": false,
|
|
11
|
+
"overrideReferences": false,
|
|
12
|
+
"precompiledReferences": [],
|
|
13
|
+
"autoReferenced": true,
|
|
14
|
+
"defineConstraints": [],
|
|
15
|
+
"versionDefines": [],
|
|
16
|
+
"noEngineReferences": false
|
|
17
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: ab1626c057f474478a7240f424e355cd
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
: Any
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings:
|
|
19
|
+
Exclude Android: 1
|
|
20
|
+
Exclude Editor: 0
|
|
21
|
+
Exclude Linux64: 0
|
|
22
|
+
Exclude OSXUniversal: 0
|
|
23
|
+
Exclude Win: 0
|
|
24
|
+
Exclude Win64: 0
|
|
25
|
+
Exclude iOS: 1
|
|
26
|
+
- first:
|
|
27
|
+
Android: Android
|
|
28
|
+
second:
|
|
29
|
+
enabled: 0
|
|
30
|
+
settings:
|
|
31
|
+
CPU: ARMv7
|
|
32
|
+
- first:
|
|
33
|
+
Any:
|
|
34
|
+
second:
|
|
35
|
+
enabled: 0
|
|
36
|
+
settings: {}
|
|
37
|
+
- first:
|
|
38
|
+
Editor: Editor
|
|
39
|
+
second:
|
|
40
|
+
enabled: 1
|
|
41
|
+
settings:
|
|
42
|
+
CPU: x86_64
|
|
43
|
+
DefaultValueInitialized: true
|
|
44
|
+
OS: AnyOS
|
|
45
|
+
- first:
|
|
46
|
+
Standalone: Linux64
|
|
47
|
+
second:
|
|
48
|
+
enabled: 1
|
|
49
|
+
settings:
|
|
50
|
+
CPU: AnyCPU
|
|
51
|
+
- first:
|
|
52
|
+
Standalone: OSXUniversal
|
|
53
|
+
second:
|
|
54
|
+
enabled: 1
|
|
55
|
+
settings:
|
|
56
|
+
CPU: x86_64
|
|
57
|
+
- first:
|
|
58
|
+
Standalone: Win
|
|
59
|
+
second:
|
|
60
|
+
enabled: 1
|
|
61
|
+
settings:
|
|
62
|
+
CPU: None
|
|
63
|
+
- first:
|
|
64
|
+
Standalone: Win64
|
|
65
|
+
second:
|
|
66
|
+
enabled: 1
|
|
67
|
+
settings:
|
|
68
|
+
CPU: AnyCPU
|
|
69
|
+
- first:
|
|
70
|
+
iPhone: iOS
|
|
71
|
+
second:
|
|
72
|
+
enabled: 0
|
|
73
|
+
settings:
|
|
74
|
+
AddToEmbeddedBinaries: false
|
|
75
|
+
CPU: AnyCPU
|
|
76
|
+
CompileFlags:
|
|
77
|
+
FrameworkDependencies:
|
|
78
|
+
userData:
|
|
79
|
+
assetBundleName:
|
|
80
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
using Newtonsoft.Json;
|
|
2
|
+
using Newtonsoft.Json.Linq;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.CloudSave.Standalone
|
|
5
|
+
{
|
|
6
|
+
internal class TapCloudSaveBaseResponse
|
|
7
|
+
{
|
|
8
|
+
[JsonProperty("success")]
|
|
9
|
+
public bool success { get; set; }
|
|
10
|
+
|
|
11
|
+
[JsonProperty("now")]
|
|
12
|
+
public int now { get; set; }
|
|
13
|
+
|
|
14
|
+
[JsonProperty("data")]
|
|
15
|
+
public JObject data { get; set; }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
internal class TapCloudSaveError
|
|
19
|
+
{
|
|
20
|
+
[JsonProperty("code")]
|
|
21
|
+
public int code { get; set; }
|
|
22
|
+
|
|
23
|
+
[JsonProperty("msg")]
|
|
24
|
+
public string msg { get; set; }
|
|
25
|
+
|
|
26
|
+
[JsonProperty("error")]
|
|
27
|
+
public string error { get; set; }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using Newtonsoft.Json;
|
|
4
|
+
using TapSDK.Core.Standalone.Internal.Openlog;
|
|
5
|
+
|
|
6
|
+
namespace TapSDK.CloudSave.Standalone
|
|
7
|
+
{
|
|
8
|
+
internal class TapCloudSaveTracker
|
|
9
|
+
{
|
|
10
|
+
private const string ACTION_INIT = "init";
|
|
11
|
+
private const string ACTION_START = "start";
|
|
12
|
+
private const string ACTION_SUCCESS = "success";
|
|
13
|
+
private const string ACTION_FAIL = "fail";
|
|
14
|
+
|
|
15
|
+
private static TapCloudSaveTracker instance;
|
|
16
|
+
|
|
17
|
+
private TapOpenlogStandalone openlog;
|
|
18
|
+
|
|
19
|
+
private TapCloudSaveTracker()
|
|
20
|
+
{
|
|
21
|
+
openlog = new TapOpenlogStandalone("TapCloudSave", TapTapCloudSave.Version);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public static TapCloudSaveTracker Instance
|
|
25
|
+
{
|
|
26
|
+
get
|
|
27
|
+
{
|
|
28
|
+
if (instance == null)
|
|
29
|
+
{
|
|
30
|
+
instance = new TapCloudSaveTracker();
|
|
31
|
+
}
|
|
32
|
+
return instance;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
internal void TrackInit()
|
|
37
|
+
{
|
|
38
|
+
ReportLog(ACTION_INIT);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
internal void TrackStart(string funcNace, string seesionId)
|
|
42
|
+
{
|
|
43
|
+
Dictionary<string, string> parameters = new Dictionary<string, string>
|
|
44
|
+
{
|
|
45
|
+
{ "func_name", funcNace },
|
|
46
|
+
{ "session_id", seesionId },
|
|
47
|
+
};
|
|
48
|
+
ReportLog(
|
|
49
|
+
ACTION_START,
|
|
50
|
+
new Dictionary<string, string>()
|
|
51
|
+
{
|
|
52
|
+
{ "args", JsonConvert.SerializeObject(parameters) },
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
internal void TrackSuccess(string funcNace, string seesionId)
|
|
58
|
+
{
|
|
59
|
+
Dictionary<string, string> parameters = new Dictionary<string, string>
|
|
60
|
+
{
|
|
61
|
+
{ "func_name", funcNace },
|
|
62
|
+
{ "session_id", seesionId },
|
|
63
|
+
};
|
|
64
|
+
ReportLog(
|
|
65
|
+
ACTION_SUCCESS,
|
|
66
|
+
new Dictionary<string, string>()
|
|
67
|
+
{
|
|
68
|
+
{ "args", JsonConvert.SerializeObject(parameters) },
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
internal void TrackFailure(
|
|
74
|
+
string funcNace,
|
|
75
|
+
string seesionId,
|
|
76
|
+
int errorCode = -1,
|
|
77
|
+
string errorMessage = null
|
|
78
|
+
)
|
|
79
|
+
{
|
|
80
|
+
Dictionary<string, string> parameters = new Dictionary<string, string>
|
|
81
|
+
{
|
|
82
|
+
{ "func_name", funcNace },
|
|
83
|
+
{ "session_id", seesionId },
|
|
84
|
+
{ "error_code", errorCode.ToString() },
|
|
85
|
+
{ "error_msg", errorMessage },
|
|
86
|
+
};
|
|
87
|
+
ReportLog(
|
|
88
|
+
ACTION_FAIL,
|
|
89
|
+
new Dictionary<string, string>()
|
|
90
|
+
{
|
|
91
|
+
{ "args", JsonConvert.SerializeObject(parameters) },
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private void ReportLog(string action, Dictionary<string, string> parameters = null)
|
|
97
|
+
{
|
|
98
|
+
openlog.LogBusiness(action, parameters);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|