fix(game): 修复云端数据保存与获取逻辑
- 在SingletonModuleComp中增加云端数据保存成功日志输出 - 调整云端数据获取失败时的警告信息 - 初始化流程中云端登录成功后调用更新云端数据接口 - 任务开始时同步调用云端数据更新和获取接口 - 移除MissionHomeComp中未使用的HeroPageComp导入声明
This commit is contained in:
@@ -1,133 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"__type__": "cc.AnimationClip",
|
|
||||||
"_name": "loading",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {
|
|
||||||
"embeddedPlayerGroups": []
|
|
||||||
},
|
|
||||||
"_native": "",
|
|
||||||
"sample": 14,
|
|
||||||
"speed": 1,
|
|
||||||
"wrapMode": 2,
|
|
||||||
"enableTrsBlending": false,
|
|
||||||
"_duration": 0.8571428571428571,
|
|
||||||
"_hash": 500763545,
|
|
||||||
"_tracks": [
|
|
||||||
{
|
|
||||||
"__id__": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_exoticAnimation": null,
|
|
||||||
"_events": [],
|
|
||||||
"_embeddedPlayers": [],
|
|
||||||
"_additiveSettings": {
|
|
||||||
"__id__": 6
|
|
||||||
},
|
|
||||||
"_auxiliaryCurveEntries": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.animation.ObjectTrack",
|
|
||||||
"_binding": {
|
|
||||||
"__type__": "cc.animation.TrackBinding",
|
|
||||||
"path": {
|
|
||||||
"__id__": 2
|
|
||||||
},
|
|
||||||
"proxy": null
|
|
||||||
},
|
|
||||||
"_channel": {
|
|
||||||
"__id__": 4
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.animation.TrackPath",
|
|
||||||
"_paths": [
|
|
||||||
{
|
|
||||||
"__id__": 3
|
|
||||||
},
|
|
||||||
"spriteFrame"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.animation.ComponentPath",
|
|
||||||
"component": "cc.Sprite"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.animation.Channel",
|
|
||||||
"_curve": {
|
|
||||||
"__id__": 5
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.ObjectCurve",
|
|
||||||
"_times": [
|
|
||||||
0,
|
|
||||||
0.07142857142857142,
|
|
||||||
0.14285714285714285,
|
|
||||||
0.21428571428571427,
|
|
||||||
0.2857142857142857,
|
|
||||||
0.35714285714285715,
|
|
||||||
0.42857142857142855,
|
|
||||||
0.5,
|
|
||||||
0.5714285714285714,
|
|
||||||
0.6428571428571429,
|
|
||||||
0.7142857142857143,
|
|
||||||
0.7857142857142857
|
|
||||||
],
|
|
||||||
"_values": [
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@23c37",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@45a69",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@bd1b2",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@caa4e",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@8c243",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@0205e",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@d9301",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@bc63c",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@c8d54",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@d25cb",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@c412b",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@c48c0",
|
|
||||||
"__expectedType__": "cc.SpriteFrame"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.AnimationClipAdditiveSettings",
|
|
||||||
"enabled": false,
|
|
||||||
"refClip": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"ver": "2.0.3",
|
|
||||||
"importer": "animation-clip",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "ad7c914e-30a9-477b-8ba1-d12ac0aa3130",
|
|
||||||
"files": [
|
|
||||||
".cconb"
|
|
||||||
],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {
|
|
||||||
"name": "loading"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 958 KiB |
@@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"ver": "1.0.27",
|
|
||||||
"importer": "image",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "f42b9fb1-b246-4d57-8733-31a1365729a6",
|
|
||||||
"files": [
|
|
||||||
".json",
|
|
||||||
".png"
|
|
||||||
],
|
|
||||||
"subMetas": {
|
|
||||||
"6c48a": {
|
|
||||||
"importer": "texture",
|
|
||||||
"uuid": "f42b9fb1-b246-4d57-8733-31a1365729a6@6c48a",
|
|
||||||
"displayName": "ui2",
|
|
||||||
"id": "6c48a",
|
|
||||||
"name": "texture",
|
|
||||||
"userData": {
|
|
||||||
"wrapModeS": "repeat",
|
|
||||||
"wrapModeT": "repeat",
|
|
||||||
"minfilter": "linear",
|
|
||||||
"magfilter": "linear",
|
|
||||||
"mipfilter": "none",
|
|
||||||
"anisotropy": 0,
|
|
||||||
"isUuid": true,
|
|
||||||
"imageUuidOrDatabaseUri": "f42b9fb1-b246-4d57-8733-31a1365729a6",
|
|
||||||
"visible": false
|
|
||||||
},
|
|
||||||
"ver": "1.0.22",
|
|
||||||
"imported": true,
|
|
||||||
"files": [
|
|
||||||
".json"
|
|
||||||
],
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"userData": {
|
|
||||||
"hasAlpha": true,
|
|
||||||
"type": "texture",
|
|
||||||
"fixAlphaTransparencyArtifacts": false,
|
|
||||||
"redirect": "f42b9fb1-b246-4d57-8733-31a1365729a6@6c48a"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -87,9 +87,12 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateCloudData(){
|
updateCloudData(){
|
||||||
|
|
||||||
let gemeDate=this.getGameDate()
|
let gemeDate=this.getGameDate()
|
||||||
WxCloudApi.save(gemeDate).then((result) => {
|
WxCloudApi.save(gemeDate).then((result) => {
|
||||||
|
console.log('云端保存')
|
||||||
if(result.result.code === 200) {
|
if(result.result.code === 200) {
|
||||||
|
console.log("保存成功",result.result)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[SMC]: 游戏数据增加失败: ${result.result.msg}`);
|
console.warn(`[SMC]: 游戏数据增加失败: ${result.result.msg}`);
|
||||||
@@ -105,10 +108,11 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
WxCloudApi.get().then(async (result) => {
|
WxCloudApi.get().then(async (result) => {
|
||||||
if(result.result.code === 200) {
|
if(result.result.code === 200) {
|
||||||
let data=result.result.data
|
let data=result.result.data
|
||||||
|
console.log(`[SMC]: 获取游戏数据成功:`, result.result);
|
||||||
this.overrideLocalDataWithRemote(data)
|
this.overrideLocalDataWithRemote(data)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
console.warn(`[SMC]: 游戏数据增加失败: ${result.result.msg}`);
|
console.warn(`[SMC]: 游戏数据增加失败`);
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ export class Initialize extends ecs.Entity {
|
|||||||
|
|
||||||
if (loginResult.result.code === 200) {
|
if (loginResult.result.code === 200) {
|
||||||
console.log("[Initialize]: 云端登录成功");
|
console.log("[Initialize]: 云端登录成功");
|
||||||
|
smc.updateCloudData()
|
||||||
const cloudData = loginResult.result.data;
|
const cloudData = loginResult.result.data;
|
||||||
try {
|
try {
|
||||||
// 直接覆盖基础游戏数据
|
// 直接覆盖基础游戏数据
|
||||||
|
|||||||
Reference in New Issue
Block a user