Pārlūkot izejas kodu

refactor #1915

tags/v0.11.0
Shaun pirms 2 gadiem
vecāks
revīzija
42e9b2eded
7 mainītis faili ar 22 papildinājumiem un 14 dzēšanām
  1. +1
    -1
      src/client/js/objects/objects.js
  2. +7
    -2
      src/client/js/rendering/renderer.js
  3. +1
    -1
      src/client/js/sound/sound.js
  4. +10
    -7
      src/client/ui/templates/party/party.js
  5. +1
    -1
      src/server/config/quests/templates/questKillX.js
  6. +1
    -1
      src/server/config/quests/templates/questLootGen.js
  7. +1
    -1
      src/server/config/quests/templates/questTemplate.js

+ 1
- 1
src/client/js/objects/objects.js Parādīt failu

@@ -167,7 +167,7 @@ define([
events.emit('onGetPlayer', obj);
window.player = obj;

sound.unload(obj.zoneId);
sound.unload(obj.zoneName);

renderer.setPosition({
x: (obj.x - (renderer.width / (scale * 2))) * scale,


+ 7
- 2
src/client/js/rendering/renderer.js Parādīt failu

@@ -313,8 +313,13 @@ define([
return 0;
});

if (this.zoneId !== null)
events.emit('onRezone', this.zoneId);
if (this.zoneId !== null) {
events.emit('onRezone', {
oldZoneId: this.zoneId,
newZoneId: msg.zoneId
});
}

this.zoneId = msg.zoneId;

msg.clientObjects.forEach(c => {


+ 1
- 1
src/client/js/sound/sound.js Parādīt failu

@@ -52,7 +52,7 @@ define([
},

//Fired when a character rezones
// 'scope' is the new zone name
// 'newScope' is the new zone name
unload: function (newScope) {
const { sounds } = this;



+ 10
- 7
src/client/ui/templates/party/party.js Parādīt failu

@@ -39,7 +39,9 @@ define([
},

onGetConnectedPlayer: function (msg) {
let party = this.party;
const { party } = this;
const { player: { serverId: playerId, zoneId: playerZone } } = window;

if (!party)
return;

@@ -47,25 +49,26 @@ define([
msg = [msg];

msg.forEach(m => {
const { id: mId, zoneId: mZone } = m;

if (party.indexOf(m.id) === -1)
return;

let zone = m.zone;
if (m.id === window.player.serverId) {
if (mId === playerId) {
party.forEach(p => {
let player = globals.onlineList.find(o => o.id === p);
const mObj = globals.onlineList.find(o => o.id === p);

let el = this.find('.member[memberId="' + p + '"]');
el.removeClass('differentZone');

if (player.zone !== zone)
if (mObj.mZone !== mZone)
el.addClass('differentZone');
});
} else {
let el = this.find('.member[memberId="' + m.id + '"]');
el.removeClass('differentZone');

if (m.zone !== window.player.zone)
if (m.mZone !== playerZone)
el.addClass('differentZone');

el.find('.txtLevel').html('level: ' + m.level);
@@ -130,7 +133,7 @@ define([
.attr('memberId', p)
.on('contextmenu', this.showContext.bind(this, playerName, p));

if (player.zone !== window.player.zone)
if (player.zoneId !== window.player.zoneId)
el.addClass('differentZone');

//Find stats


+ 1
- 1
src/server/config/quests/templates/questKillX.js Parādīt failu

@@ -10,7 +10,7 @@ module.exports = {
//If we're not in the correct zone, don't do this check, it'll just crash the server
// since the mob won't be available (most likely) in the zoneFile
if (this.obj.zoneName === this.zoneName) {
let mobTypes = this.obj.instance.spawners.zoneConfig.mobs;
let mobTypes = this.obj.instance.zoneConfig.mobs;
if (this.mobName) {
let mobType = mobTypes[this.mobName.toLowerCase()];
//Maybe the zoneFile changed in the meantime. If so, regenerate


+ 1
- 1
src/server/config/quests/templates/questLootGen.js Parādīt failu

@@ -18,7 +18,7 @@ module.exports = {
//If we're not in the correct zone, don't do this check, it'll just crash the server
// since the mob won't be available (most likely) in the zoneFile
if (this.obj.zoneName === this.zoneName) {
let mobTypes = this.obj.instance.spawners.zoneConfig.mobs;
let mobTypes = this.obj.instance.zoneConfig.mobs;

if (this.mobType && this.item) {
//Check if the zoneFile changed


+ 1
- 1
src/server/config/quests/templates/questTemplate.js Parādīt failu

@@ -6,7 +6,7 @@ module.exports = {
return false;

if (!this.xp) {
let level = this.obj.instance.spawners.zoneConfig.level;
let level = this.obj.instance.zoneConfig.level;
level = level[0];
let xp = ~~(level * 22 * this.getXpMultiplier());
this.xp = xp;


Notiek ielāde…
Atcelt
Saglabāt