Minor update.

This commit is contained in:
genxium 2023-02-05 20:24:09 +08:00
parent 6b3d1ed49a
commit f10389bf55
5 changed files with 24 additions and 9 deletions

View File

@ -461,7 +461,7 @@
"array": [
0,
0,
209.6693197428241,
209.73151519075364,
0,
0,
0,

View File

@ -547,7 +547,7 @@
"array": [
0,
0,
209.6693197428241,
209.73151519075364,
0,
0,
0,

View File

@ -735,6 +735,7 @@ cc.Class({
self.hideFindingPlayersGUI();
console.warn('On battle resynced! renderFrameId=', rdf.Id);
}
self.renderFrameId = rdf.Id;
self.lastRenderFrameIdTriggeredAt = performance.now();
// In this case it must be true that "rdf.id > chaserRenderFrameId".
@ -745,6 +746,10 @@ cc.Class({
self.ctrl = canvasNode.getComponent("TouchEventsManager");
self.enableInputControls();
self.transitToState(ALL_MAP_STATES.VISUAL);
const selfPlayerRichInfo = self.playerRichInfoDict.get(self.selfPlayerInfo.Id);
const newMapPos = cc.v2().sub(selfPlayerRichInfo.node.position);
self.node.setPosition(newMapPos);
self.battleState = ALL_BATTLE_STATES.IN_BATTLE;
}
@ -926,8 +931,9 @@ batchInputFrameIdRange=[${batch[0].inputFrameId}, ${batch[batch.length - 1].inpu
fromUDP=${fromUDP}`);
self.chaserRenderFrameId = renderFrameId1;
let rollbackFrames = (self.renderFrameId - self.chaserRenderFrameId);
if (0 > rollbackFrames)
if (0 > rollbackFrames) {
rollbackFrames = 0;
}
self.networkDoctor.logRollbackFrames(rollbackFrames);
},
@ -1112,7 +1118,12 @@ fromUDP=${fromUDP}`);
// Inside the following "self.rollbackAndChase" actually ROLLS FORWARD w.r.t. the corresponding delayedInputFrame, REGARDLESS OF whether or not "self.chaserRenderFrameId == self.renderFrameId" now.
const latestRdfResults = self.rollbackAndChase(self.renderFrameId, self.renderFrameId + 1, self.gopkgsCollisionSys, self.gopkgsCollisionSysMap, false);
self.networkDoctor.logRollbackFrames(self.renderFrameId - self.chaserRenderFrameId);
let rollbackFrames = (self.renderFrameId - self.chaserRenderFrameId);
if (0 > rollbackFrames) {
rollbackFrames = 0;
}
self.networkDoctor.logRollbackFrames(rollbackFrames);
let prevRdf = latestRdfResults[0],
rdf = latestRdfResults[1];
/*

View File

@ -27,7 +27,7 @@
#include "cocos2d.h"
#include "cocos/audio/include/AudioEngine.h"
//#include "cocos/audio/include/AudioEngine.h"
#include "cocos/scripting/js-bindings/manual/jsb_module_register.hpp"
#include "cocos/scripting/js-bindings/manual/jsb_global.h"
#include "cocos/scripting/js-bindings/jswrapper/SeApi.h"
@ -81,13 +81,13 @@ void AppDelegate::applicationDidEnterBackground()
{
EventDispatcher::dispatchEnterBackgroundEvent();
// Ensure that handle AudioEngine enter background after all enter background events are handled
AudioEngine::onEnterBackground();
//AudioEngine::onEnterBackground();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
// Ensure that handle AudioEngine enter foreground before all enter foreground events are handled
AudioEngine::onEnterForeground();
//AudioEngine::onEnterForeground();
EventDispatcher::dispatchEnterForegroundEvent();
}

View File

@ -33,6 +33,8 @@
"design-resolution-height": 640,
"design-resolution-width": 960,
"excluded-modules": [
"Audio",
"AudioSource",
"Collider",
"DragonBones",
"Geom Utils",
@ -43,8 +45,11 @@
"Physics",
"PageView",
"PageViewIndicator",
"ParticleSystem",
"RichText",
"Slider",
"ScrollBar",
"ScrollView",
"Spine Skeleton",
"StudioComponent",
"VideoPlayer",
@ -78,6 +83,5 @@
"width": 960
},
"use-customize-simulator": true,
"use-project-simulator-setting": false,
"start-scene": "current"
"use-project-simulator-setting": false
}