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.
Files changed (35) hide show
  1. package/Mobile/Editor/NativeDependencies.xml +8 -2
  2. package/Mobile/Editor/TapCloudSaveMobileProcessBuild.cs +1 -0
  3. package/Mobile/Runtime/TapCloudSaveBridge.cs +168 -57
  4. package/Runtime/Internal/ITapCloudSaveBridge.cs +14 -9
  5. package/Runtime/Internal/TapCloudSaveInitTask.cs +2 -0
  6. package/Runtime/Internal/TapTapCloudSaveInternal.cs +22 -29
  7. package/Runtime/Public/TapTapCloudSave.cs +18 -29
  8. package/Standalone/Editor/TapCloudSaveStandaloneProcessBuild.cs +26 -0
  9. package/Standalone/Editor/TapCloudSaveStandaloneProcessBuild.cs.meta +11 -0
  10. package/Standalone/Editor/TapSDK.CloudSave.Standalone.Editor.asmdef +17 -0
  11. package/Standalone/Editor/TapSDK.CloudSave.Standalone.Editor.asmdef.meta +7 -0
  12. package/Standalone/Editor.meta +8 -0
  13. package/Standalone/Plugins/x86_64/cloudsave_sdk.dll +0 -0
  14. package/Standalone/Plugins/x86_64/cloudsave_sdk.dll.meta +80 -0
  15. package/Standalone/Plugins/x86_64.meta +8 -0
  16. package/Standalone/Plugins.meta +8 -0
  17. package/Standalone/Runtime/Internal/TapCloudSaveArchiveListResponse.cs +11 -0
  18. package/Standalone/Runtime/Internal/TapCloudSaveArchiveListResponse.cs.meta +11 -0
  19. package/Standalone/Runtime/Internal/TapCloudSaveBaseResponse.cs +29 -0
  20. package/Standalone/Runtime/Internal/TapCloudSaveBaseResponse.cs.meta +11 -0
  21. package/Standalone/Runtime/Internal/TapCloudSaveTracker.cs +101 -0
  22. package/Standalone/Runtime/Internal/TapCloudSaveTracker.cs.meta +11 -0
  23. package/Standalone/Runtime/Internal/TapCloudSaveWrapper.cs +518 -0
  24. package/Standalone/Runtime/Internal/TapCloudSaveWrapper.cs.meta +11 -0
  25. package/Standalone/Runtime/Internal.meta +8 -0
  26. package/Standalone/Runtime/TapCloudSaveResultCode.cs +9 -0
  27. package/Standalone/Runtime/TapCloudSaveResultCode.cs.meta +11 -0
  28. package/Standalone/Runtime/TapCloudSaveStandalone.cs +672 -0
  29. package/Standalone/Runtime/TapCloudSaveStandalone.cs.meta +11 -0
  30. package/Standalone/Runtime.meta +8 -0
  31. package/Standalone/TapSDK.CloudSave.Standalone.Runtime.asmdef +22 -0
  32. package/Standalone/TapSDK.CloudSave.Standalone.Runtime.asmdef.meta +7 -0
  33. package/Standalone.meta +8 -0
  34. package/link.xml.meta +1 -1
  35. package/package.json +10 -10
@@ -1,46 +1,35 @@
1
- using TapSDK.CloudSave.Internal;
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 void CreateArchive(string metadata, string archiveFilePath, string archiveCoverPath,
13
- ITapCloudSaveRequestCallback callback)
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 void UpdateArchive(string archiveUuid, string metadata, string archiveFilePath,
19
- string archiveCoverPath, ITapCloudSaveRequestCallback callback)
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 void DeleteArchive(string archiveUuid, ITapCloudSaveRequestCallback callback)
25
- {
26
- TapTapCloudSaveInternal.DeleteArchive(archiveUuid, callback);
27
- }
23
+ public static Task<ArchiveData> DeleteArchive(string archiveUuid) =>
24
+ TapTapCloudSaveInternal.DeleteArchive(archiveUuid);
28
25
 
29
- public static void GetArchiveList(ITapCloudSaveRequestCallback callback)
30
- {
31
- TapTapCloudSaveInternal.GetArchiveList(callback);
32
- }
26
+ public static Task<List<ArchiveData>> GetArchiveList() =>
27
+ TapTapCloudSaveInternal.GetArchiveList();
33
28
 
34
- public static void GetArchiveData(string archiveUuid, string archiveFileId,
35
- ITapCloudSaveRequestCallback callback)
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 void GetArchiveCover(string archiveUuid, string archiveFileId,
41
- ITapCloudSaveRequestCallback callback)
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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: dda36eaa894da49aaaa621fb93b0bd75
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: c879a497c7c1e1f47a78a9e028d51dee
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: d4653865773654a79a34840d73dfaa1e
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -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,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 101c62a95828048cc93ef7e5d6b64cfa
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 5357854b8ecbf4851944540c28915031
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,11 @@
1
+ using System.Collections.Generic;
2
+ using Newtonsoft.Json;
3
+
4
+ namespace TapSDK.CloudSave.Standalone
5
+ {
6
+ internal class TapCloudSaveArchiveListResponse
7
+ {
8
+ [JsonProperty("saves")]
9
+ public List<ArchiveData> saves { get; set; }
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 61206a5a265ae4a93b3e867f7f6314ec
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ 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,11 @@
1
+ fileFormatVersion: 2
2
+ guid: bfcbbaef939584a02a911c0aeeb2bae5
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 729397b8e788b4d608b9e9a200355798
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: