Preparation for native app build.

This commit is contained in:
genxium 2023-01-22 23:05:32 +08:00
parent b5b43bb596
commit 58e60a789f
11 changed files with 45 additions and 32 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View File

@ -198,3 +198,6 @@ window.getOrCreateAnimationClipForGid = function(gid, tiledMapInfo, tilesElListU
animationClip: animClip,
};
};
// Node.js, this is a workaround to avoid accessing the non-existent "TextDecoder class" from "jsexport.js".
window.fs = function() {};

View File

@ -362,7 +362,7 @@
"array": [
0,
0,
216.6734179122529,
216.50635094610968,
0,
0,
0,

View File

@ -547,7 +547,7 @@
"array": [
0,
0,
210.16474188040044,
216.50635094610968,
0,
0,
0,

View File

@ -75,10 +75,10 @@ cc.Class({
onLoad() {
BaseCharacter.prototype.onLoad.call(this);
this.effAnimNode = this.animNode.getChildByName(this.speciesName);
this.animComp = this.effAnimNode.getComponent(dragonBones.ArmatureDisplay);
if (!this.animComp) {
this.animComp = this.effAnimNode.getComponent(cc.Animation);
}
//this.animComp = this.effAnimNode.getComponent(dragonBones.ArmatureDisplay);
//if (!this.animComp) {
this.animComp = this.effAnimNode.getComponent(cc.Animation);
//}
this.effAnimNode.active = true;
},
@ -107,13 +107,13 @@ cc.Class({
let playingAnimName = null;
let underlyingAnimationCtrl = null;
if (this.animComp instanceof dragonBones.ArmatureDisplay) {
underlyingAnimationCtrl = this.animComp._armature.animation; // ALWAYS use the dragonBones api instead of ccc's wrapper!
playingAnimName = underlyingAnimationCtrl.lastAnimationName;
} else {
underlyingAnimationCtrl = this.animComp.currentClip;
playingAnimName = (!underlyingAnimationCtrl ? null : underlyingAnimationCtrl.name);
}
//if (this.animComp instanceof dragonBones.ArmatureDisplay) {
// underlyingAnimationCtrl = this.animComp._armature.animation; // ALWAYS use the dragonBones api instead of ccc's wrapper!
// playingAnimName = underlyingAnimationCtrl.lastAnimationName;
//} else {
underlyingAnimationCtrl = this.animComp.currentClip;
playingAnimName = (!underlyingAnimationCtrl ? null : underlyingAnimationCtrl.name);
//}
// It turns out that "prevRdfPlayer.CharacterState" is not useful in this function :)
if (newAnimName == playingAnimName && window.ATK_CHARACTER_STATE_INTERRUPT_WAIVE_SET.has(newCharacterState)) {
@ -122,11 +122,11 @@ cc.Class({
return;
}
if (this.animComp instanceof dragonBones.ArmatureDisplay) {
this._interruptPlayingAnimAndPlayNewAnimDragonBones(rdfPlayer, prevRdfPlayer, newCharacterState, newAnimName, underlyingAnimationCtrl, playingAnimName, chConfig);
} else {
this._interruptPlayingAnimAndPlayNewAnimFrameAnim(rdfPlayer, prevRdfPlayer, newCharacterState, newAnimName, playingAnimName, chConfig);
}
//if (this.animComp instanceof dragonBones.ArmatureDisplay) {
// this._interruptPlayingAnimAndPlayNewAnimDragonBones(rdfPlayer, prevRdfPlayer, newCharacterState, newAnimName, underlyingAnimationCtrl, playingAnimName, chConfig);
//} else {
this._interruptPlayingAnimAndPlayNewAnimFrameAnim(rdfPlayer, prevRdfPlayer, newCharacterState, newAnimName, playingAnimName, chConfig);
//}
},
_interruptPlayingAnimAndPlayNewAnimDragonBones(rdfPlayer, prevRdfPlayer, newCharacterState, newAnimName, underlyingAnimationCtrl, playingAnimName, chConfig) {

View File

@ -81,8 +81,11 @@ NetworkDoctor.prototype.logSkippedRenderFrameCnt = function() {
NetworkDoctor.prototype.isTooFast = function() {
const [sendingFps, srvDownsyncFps, peerUpsyncFps, rollbackFrames, skippedRenderFrameCnt] = this.stats();
if (sendingFps >= this.inputRateThreshold && srvDownsyncFps >= this.inputRateThreshold) {
// At least my network is OK for both TX & RX directions.
if (sendingFps >= this.inputRateThreshold + 2) {
// Don't send too fast
return true;
} else if (sendingFps >= this.inputRateThreshold && srvDownsyncFps >= this.inputRateThreshold) {
// At least my network is OK for both TX & RX directions -- PING value might help as a supplement information here to confirm that the "selfPlayer" is not lagged in RX which results in the "rollbackFrames", but not necessary -- a significant lag within the "inputFrameDownsyncQ" will reduce "srvDownsyncFps".
if (rollbackFrames >= this.rollbackFramesThreshold) {
// I got many frames rolled back while none of my peers effectively helped my preciction. Deliberately not using "peerUpsyncThreshold" here because when using UDP p2p upsync broadcasting, we expect to receive effective p2p upsyncs from every other player.
return true;

View File

@ -1,7 +1,7 @@
{
"ver": "1.0.5",
"uuid": "40edd08e-316c-44b8-a50f-bd173554c554",
"isPlugin": true,
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,

View File

@ -15,16 +15,16 @@
"orientation": "portrait",
"subContext": ""
},
"encryptJs": true,
"encryptJs": false,
"excludeScenes": [
"8491a86c-bec9-4813-968a-128ca01639e0"
],
"fb-instant-games": {},
"includeSDKBox": false,
"inlineSpriteFrames": true,
"inlineSpriteFrames_native": true,
"inlineSpriteFrames_native": false,
"md5Cache": false,
"mergeStartScene": true,
"mergeStartScene": false,
"optimizeHotUpdate": false,
"orientation": {
"landscapeLeft": true,
@ -39,7 +39,7 @@
},
"startScene": "2ff474d9-0c9e-4fe3-87ec-fbff7cae85b4",
"title": "DelayNoMore",
"webOrientation": "portrait",
"webOrientation": "landscape",
"wechatgame": {
"REMOTE_SERVER_ROOT": "https://bgmoba.lokcol.com/static/",
"appid": "wxf497c910a2a25edc",
@ -56,5 +56,6 @@
"mac": {
"packageName": "org.cocos2d.helloworld"
},
"win32": {}
"win32": {},
"includeAnySDK": null
}

View File

@ -33,10 +33,15 @@
"design-resolution-height": 640,
"design-resolution-width": 960,
"excluded-modules": [
"Audio",
"AudioSource",
"Collider",
"DragonBones",
"Geom Utils",
"Intersection",
"Mesh",
"MotionStreak",
"NodePool",
"Physics",
"PageView",
"PageViewIndicator",

View File

@ -4,24 +4,25 @@ all: help
## Available proxies for downloading go modules are listed in "https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away".
#GOPROXY=https://mirrors.aliyun.com/goproxy
GOPROXY=https://goproxy.io
DST=../frontend/assets/scripts/modules
serve:
gopherjs serve $(PROJECTNAME)
clean:
gopherjs clean
rm -f ../frontend/assets/plugin_scripts/jsexport.js
#rm -f ../frontend/assets/plugin_scripts/jsexport.js.map
rm -f $(DST)/jsexport.js
#rm -f $(DST)/jsexport.js.map
build: clean
gopherjs build $(PROJECTNAME)
mv ./jsexport.js ../frontend/assets/plugin_scripts/
#mv ./jsexport.js.map ../frontend/assets/plugin_scripts/
mv ./jsexport.js $(DST)/
#mv ./jsexport.js.map $(DST)/
build-min: clean
gopherjs build -m $(PROJECTNAME)
mv ./jsexport.js ../frontend/assets/plugin_scripts/
#mv ./jsexport.js.map ../frontend/assets/plugin_scripts/
mv ./jsexport.js $(DST)/
#mv ./jsexport.js.map $(DST)/
.PHONY: help