暂存
This commit is contained in:
parent
0222378540
commit
6f2571068d
|
@ -258,6 +258,7 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
if (data.data.shareLvl) {
|
||||
if (data.data.shareLvl.length > 0) {
|
||||
console.log("设置分享等级", data.data.shareLvl);
|
||||
cc.fx.GameConfig.GM_INFO.helpLevel = data.data.shareLvl;
|
||||
}
|
||||
}
|
||||
|
@ -362,8 +363,12 @@ export default class GameManager extends cc.Component {
|
|||
// console.log("没有等级信息,从用户接口拿到数据");
|
||||
if (levelInfo.level) {
|
||||
cc.fx.GameConfig.GM_INFO.level = levelInfo.level;
|
||||
if (cc.fx.GameConfig.GM_INFO.helpLevel == (cc.fx.GameConfig.GM_INFO.level + 1)) {
|
||||
cc.fx.GameConfig.GM_INFO.level += 1;
|
||||
}
|
||||
}
|
||||
this.load4 = true;
|
||||
cc.fx.StorageMessage.setStorage("level", cc.fx.GameConfig.GM_INFO.level);
|
||||
console.log("关卡等级成功时间耗时:", Date.now() - this.nowTime);
|
||||
cc.fx.GameTool.setUserLevel((data) => {
|
||||
});
|
||||
|
@ -373,10 +378,14 @@ export default class GameManager extends cc.Component {
|
|||
//游戏前端存储 新于服务器端,以游戏前端信息为主,放服务器存储
|
||||
let temp = data.result.timestamp - levelInfo.timestamp;
|
||||
console.log("等级时间差:", temp);
|
||||
if ((data.result.timestamp - levelInfo.timestamp) < 10000) {
|
||||
if ((data.result.timestamp - levelInfo.timestamp) < 10000 && levelInfo.level >= data.result.data) {
|
||||
if (levelInfo.level) {
|
||||
console.log("以游戏前端等级为准", data.result.data);
|
||||
cc.fx.GameConfig.GM_INFO.level = levelInfo.level;
|
||||
if (cc.fx.GameConfig.GM_INFO.helpLevel == (cc.fx.GameConfig.GM_INFO.level + 1)) {
|
||||
cc.fx.GameConfig.GM_INFO.level += 1;
|
||||
}
|
||||
cc.fx.StorageMessage.setStorage("level", cc.fx.GameConfig.GM_INFO.level);
|
||||
// console.log("等级为:",cc.fx.GameConfig.GM_INFO.level);
|
||||
cc.fx.GameTool.setUserLevel((data) => {
|
||||
});
|
||||
|
@ -566,7 +575,6 @@ export default class GameManager extends cc.Component {
|
|||
cc.fx.GameConfig.GM_INFO.magicAmount = 3;
|
||||
cc.fx.StorageMessage.setStorage("prop", propInfo);
|
||||
|
||||
|
||||
cc.fx.GameTool.setUserInfo((data) => {
|
||||
if (data.result.code == 200) {
|
||||
console.log("上传用户信息成功", data);
|
||||
|
@ -813,6 +821,9 @@ export default class GameManager extends cc.Component {
|
|||
else if (data.result.code == 200) {
|
||||
console.log("有等级信息,从关卡接口拿到数据", data.result.data);
|
||||
cc.fx.GameConfig.GM_INFO.level = data.result.data;
|
||||
if (cc.fx.GameConfig.GM_INFO.helpLevel == (cc.fx.GameConfig.GM_INFO.level + 1)) {
|
||||
cc.fx.GameConfig.GM_INFO.level += 1;
|
||||
}
|
||||
let levelInfo = { "level": cc.fx.GameConfig.GM_INFO.level, "timestamp": timestamp };
|
||||
// console.log("444444存储关卡信息:",levelInfo);
|
||||
cc.fx.StorageMessage.setStorage("level", levelInfo);
|
||||
|
|
Loading…
Reference in New Issue
Block a user