fix: 修复玩家人数获取错误 更新插件

This commit is contained in:
coding 2018-01-11 14:47:34 +00:00
parent be95acd001
commit e290f17771
2 changed files with 6 additions and 5 deletions

View File

@ -52,7 +52,7 @@ function send(event, player){
console.debug('玩家', player.getName(), "触发事件", event.class.simpleName);
setTimeout(function () {
// noinspection JSUnresolvedVariable
player.sendMessage("§a欢迎来到 §bMiaoScript §a的世界! 当前在线: " + server.players.length)
player.sendMessage("§a欢迎来到 §bMiaoScript §a的世界! 当前在线: " + server.players().length)
}, 10);
}

View File

@ -5,6 +5,7 @@ var wrapper = require('api/wrapper')
var command = require('api/command')
var manager = require('api/plugin')
var task = require('api/task')
var http = require('http')
var fs = require('fs')
@ -61,12 +62,12 @@ function enable() {
if (pkg) {
task.async(function install() {
var pfile = fs.file(__dirname, pname + '.js')
console.sender(sender, a开始下载插件: §b%s'.format(pkg.name))
console.sender(sender, a插件下载地址: §b%s'.format(pkg.url))
console.sender(sender, 6开始下载插件: §b%s'.format(pkg.name))
console.sender(sender, 6插件下载地址: §b%s'.format(pkg.url))
fs.save(pfile, http.get(pkg.url))
console.sender(sender, a插件 §b%s §a下载完毕 开始加载 ...'.format(pname))
console.sender(sender, 6插件 §b%s §a下载完毕 开始加载 ...'.format(pname))
manager.loadPlugin(pfile)
console.sender(sender, a插件 §b%s §a安装成功!'.format(pname))
console.sender(sender, 6插件 §b%s §a安装成功!'.format(pname))
})
} else {
console.log(sender, '§c插件 %s 不存在!'.format(pname))