Browse Source

feat #1756: Removed the notifyServerUisReady method and just made the client only send the ack to the instancer once UIs ARE ready instead

tags/v0.10.6^2
Shaun 2 years ago
parent
commit
a2f67d7397
8 changed files with 2587 additions and 29 deletions
  1. +1
    -6
      src/client/js/system/client.js
  2. +4
    -7
      src/client/ui/factory.js
  3. +0
    -6
      src/server/components/player.js
  4. +2575
    -3
      src/server/package-lock.json
  5. +1
    -1
      src/server/security/connections.js
  6. +1
    -2
      src/server/security/routerConfig.js
  7. +2
    -1
      src/server/world/instancer.js
  8. +3
    -3
      src/server/world/instancer/handshakes.js

+ 1
- 6
src/client/js/system/client.js View File

@@ -94,13 +94,8 @@ define([
},

getMap: function (eventName, msgs) {
events.emit('onBuildIngameUis');
events.emit('onGetMap', msgs[0]);

client.request({
threadModule: 'instancer',
method: 'clientAck',
data: {}
});
},

onGetObject: function (eventName, msgs) {


+ 4
- 7
src/client/ui/factory.js View File

@@ -19,7 +19,7 @@ define([
if (root)
this.root = root + '/';

events.on('onEnterGame', this.onEnterGame.bind(this));
events.on('onBuildIngameUis', this.onEnterGame.bind(this));
events.on('onUiKeyDown', this.onUiKeyDown.bind(this));
events.on('onResize', this.onResize.bind(this));

@@ -58,12 +58,9 @@ define([
);

client.request({
cpn: 'player',
method: 'performAction',
data: {
cpn: 'player',
method: 'notifyServerUiReady'
}
threadModule: 'instancer',
method: 'clientAck',
data: {}
});
},



+ 0
- 6
src/server/components/player.js View File

@@ -276,11 +276,5 @@ module.exports = {
msg.data.data.callbackId = atlas.registerCallback(msg.callback);

atlas.performAction(this.obj, msg.data);
},

notifyServerUiReady: function () {
this.obj.instance.eventEmitter.emit('onPlayerUiReady', {
obj: this.obj
});
}
};

+ 2575
- 3
src/server/package-lock.json
File diff suppressed because it is too large
View File


+ 1
- 1
src/server/security/connections.js View File

@@ -79,7 +79,7 @@ module.exports = {
(
player.dead &&
!(
(msg.method === 'performAction' && ['respawn', 'notifyServerUiReady'].includes(msg.data.method)) ||
(msg.method === 'performAction' && ['respawn'].includes(msg.data.method)) ||
(msg.method === 'clientAck')
)
)


+ 1
- 2
src/server/security/routerConfig.js View File

@@ -18,8 +18,7 @@ const routerConfig = {
wardrobe: ['open', 'apply'],
stats: ['respawn'],
passives: ['tickNode', 'untickNode'],
workbench: ['open', 'craft', 'getRecipe'],
player: ['notifyServerUiReady']
workbench: ['open', 'craft', 'getRecipe']
},
globalAllowed: {
clientConfig: ['getClientConfig'],


+ 2
- 1
src/server/world/instancer.js View File

@@ -230,10 +230,11 @@ module.exports = {
});
},

//This function fires when the player logs in the first time, not upon rezone
onAddObject: function (obj) {
if (obj.player) {
obj.stats.onLogin();
eventEmitter.emit('onAfterPlayerEnterZone', obj);
eventEmitter.emit('onAfterPlayerEnterZone', obj, { isTransfer: false });
}

questBuilder.obtain(obj);


+ 3
- 3
src/server/world/instancer/handshakes.js View File

@@ -20,14 +20,14 @@ const stageZoneIn = msg => {
const doZoneIn = function (staged) {
const { onAddObject, instances: [ { objects, questBuilder, eventEmitter } ] } = instancer;

const { transfer, obj } = staged;
const { transfer: isTransfer, obj } = staged;

if (!transfer)
if (!isTransfer)
objects.addObject(obj, onAddObject.bind(instancer));
else {
let o = objects.transferObject(obj);
questBuilder.obtain(o);
eventEmitter.emit('onAfterPlayerEnterZone', o);
eventEmitter.emit('onAfterPlayerEnterZone', o, { isTransfer });
}
};



Loading…
Cancel
Save