From 618531f5c6ad7a1d007eec7e02aa4c1684d8fe55 Mon Sep 17 00:00:00 2001 From: genxium Date: Sat, 18 Feb 2023 12:07:56 +0800 Subject: [PATCH] Minor fix. --- battle_srv/models/room.go | 9 ++++----- frontend/assets/resources/prefabs/FindingPlayer.prefab | 4 ++-- frontend/assets/scenes/login.fire | 2 +- frontend/assets/scripts/NetworkDoctor.js | 4 ++-- frontend/settings/builder.json | 5 ++--- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index dd54cc8..5fb98fd 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -426,11 +426,10 @@ func (pR *Room) StartBattle() { // Initialize the "collisionSys" as well as "RenderFrameBuffer" pR.CurDynamicsRenderFrameId = 0 - kickoffFrameJs := &battle.RoomDownsyncFrame{ - Id: pR.RenderFrameId, - PlayersArr: toJsPlayers(pR.Players), - CountdownNanos: pR.BattleDurationNanos, - } + kickoffFrameJs := battle.NewPreallocatedRoomDownsyncFrame(len(pR.Players), 64, 64) + battle.CloneRoomDownsyncFrame(pR.RenderFrameId, toJsPlayers(pR.Players), 0, make([]*battle.MeleeBullet, 0), make([]*battle.FireballBullet, 0), kickoffFrameJs) + kickoffFrameJs.CountdownNanos = pR.BattleDurationNanos + pR.RenderFrameBuffer.Put(kickoffFrameJs) // Refresh "Colliders" diff --git a/frontend/assets/resources/prefabs/FindingPlayer.prefab b/frontend/assets/resources/prefabs/FindingPlayer.prefab index 9509dc5..ea51677 100644 --- a/frontend/assets/resources/prefabs/FindingPlayer.prefab +++ b/frontend/assets/resources/prefabs/FindingPlayer.prefab @@ -59,7 +59,7 @@ "ctor": "Float64Array", "array": [ 480, - 320, + 480, 0, 0, 0, @@ -242,7 +242,7 @@ "ctor": "Float64Array", "array": [ 0, - 128, + -9.924, 0, 0, 0, diff --git a/frontend/assets/scenes/login.fire b/frontend/assets/scenes/login.fire index d15fcf3..a3fe1b3 100644 --- a/frontend/assets/scenes/login.fire +++ b/frontend/assets/scenes/login.fire @@ -461,7 +461,7 @@ "array": [ 0, 0, - 210.4441731196186, + 209.66956379694378, 0, 0, 0, diff --git a/frontend/assets/scripts/NetworkDoctor.js b/frontend/assets/scripts/NetworkDoctor.js index 5b91d7a..7936928 100644 --- a/frontend/assets/scripts/NetworkDoctor.js +++ b/frontend/assets/scripts/NetworkDoctor.js @@ -91,7 +91,7 @@ NetworkDoctor.prototype.isTooFast = function(mapIns) { // Don't send too fast if (CC_DEBUG) { // Printing of this message might induce a performance impact. - console.log(`Sending too fast, sendingFps=${sendingFps}`); + // console.log(`Sending too fast, sendingFps=${sendingFps}`); } return [true, inputFrameIdFront, sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt]; } else { @@ -109,7 +109,7 @@ NetworkDoctor.prototype.isTooFast = function(mapIns) { // first comparison condition is to avoid numeric overflow if (CC_DEBUG) { // Printing of this message might induce a performance impact. - console.log(`Game logic ticking too fast, selfInputFrameIdFront=${inputFrameIdFront}, minInputFrameIdFront=${minInputFrameIdFront}, inputFrameUpsyncDelayTolerance=${mapIns.inputFrameUpsyncDelayTolerance}`); + // console.log(`Game logic ticking too fast, selfInputFrameIdFront=${inputFrameIdFront}, minInputFrameIdFront=${minInputFrameIdFront}, inputFrameUpsyncDelayTolerance=${mapIns.inputFrameUpsyncDelayTolerance}`); } return [true, inputFrameIdFront, sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt]; } diff --git a/frontend/settings/builder.json b/frontend/settings/builder.json index fe5ef4a..ab222b4 100644 --- a/frontend/settings/builder.json +++ b/frontend/settings/builder.json @@ -17,8 +17,7 @@ }, "encryptJs": false, "excludeScenes": [ - "2ff474d9-0c9e-4fe3-87ec-fbff7cae85b4", - "92160186-3e0d-4e0a-ae20-97286170ba58" + "8491a86c-bec9-4813-968a-128ca01639e0" ], "fb-instant-games": {}, "includeSDKBox": false, @@ -38,7 +37,7 @@ "REMOTE_SERVER_ROOT": "", "orientation": "portrait" }, - "startScene": "8491a86c-bec9-4813-968a-128ca01639e0", + "startScene": "2ff474d9-0c9e-4fe3-87ec-fbff7cae85b4", "title": "DelayNoMore", "webOrientation": "landscape", "wechatgame": {