Przeglądaj źródła

Initial Commit

tags/v0.1.4^2
Shaun 7 lat temu
rodzic
commit
669bbbc415
4 zmienionych plików z 409 dodań i 1 usunięć
  1. +18
    -0
      src/server/components/extensions/adminCommands.js
  2. +14
    -1
      src/server/components/social.js
  3. +370
    -0
      src/server/config/maps/cave/map.json
  4. +7
    -0
      src/server/config/roles.js

+ 18
- 0
src/server/components/extensions/adminCommands.js Wyświetl plik

@@ -0,0 +1,18 @@
define([
], function(
) {
return {
roleLevel: null,

init: function(blueprint) {
this.roleLevel = blueprint.roleLevel;
},

onBeforeChat: function(msg) {
console.log(msg.message);
msg.ignore = true;
}
};
});

+ 14
- 1
src/server/components/social.js Wyświetl plik

@@ -12,7 +12,14 @@ define([
partyLeaderId: null,
party: null,

init: function() {},
init: function() {
var roleLevel = roles.getRoleLevel(this.obj);
if (roleLevel >= 10) {
this.obj.extendComponent('social', 'adminCommands', {
roleLevel: roleLevel
});
}
},

simplify: function() {
return {
@@ -68,6 +75,12 @@ define([
},

chat: function(msg) {
if (this.onBeforeChat) {
this.onBeforeChat(msg.data);
if (msg.data.ignore)
return;
}

var charname = this.obj.auth.charname;
var level = this.obj.stats.values.level;
if (level >= 10)


+ 370
- 0
src/server/config/maps/cave/map.json
Plik diff jest za duży
Wyświetl plik


+ 7
- 0
src/server/config/roles.js Wyświetl plik

@@ -45,6 +45,13 @@ define([
}
},

getRoleLevel: function(player) {
var account = player.account;
var level = this.accounts[account] ? this.accounts[account].level : 0;

return level;
},

isRoleLevel: function(player, requireLevel, message) {
var account = player.account;
var level = this.accounts[account] ? this.accounts[account].level : 0;


Ładowanie…
Anuluj
Zapisz