• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

darcros/node-minecraft-proxy: Simple Minecraft proxy written in Node.js using th ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

darcros/node-minecraft-proxy

开源软件地址(OpenSource Url):

https://github.com/darcros/node-minecraft-proxy

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

node-minecraft-proxy

Simple Minecraft proxy written in Node.js using the node-minecraft-protocol library

Features

  • Connect to proxy
  • Forward players to servers
  • Change server
  • Basic plugin support, see ./src/Plugins/ChatCommands.js for an example

Installation

npm install basic-minecraft-proxy

Examples

See also ./examples/ for other examples

Creating a proxy

This example shows how to create a new proxy and how to the options are passed.

const McProxy = require('minecraft-proxy');

let localServerOptions = {
  'port': '25578',
  'version': '1.12.1',
  'online-mode': false,
  'motd': 'nodejs minecraft proxy'
}

let serverList = {
  hub: {
    host: 'localhost',
    port: 25565,
    isDefault: true,
    isFallback: true
  },
  minigames: {
    host: 'localhost',
    port: 25566
  }
}

// if you leave proxyOptions empty yo may as well not pass it in the arguments, I wrote it anyway to point out that it exist
let proxyOptions = {}

/*
  Use the "/server <serverName>" command in chat to move between servers.
  <serverName> is the name that you chose for the server inside the serverList
  This command is implemented by /src/Plugins/ChatCommands.js and it can be disabled by setting enablePlugin: false inside proxyOptions
*/
let proxy = McProxy.createProxy(localServerOptions, serverList, proxyOptions);

proxy.on('error', console.error);

proxy.on('listening', () => {
  console.info('Listening!');
});

Moving players from a server to another

In this example every player will be moved from the hub server (default) to the minigames server 30 seconds after having logged in.

proxy.on('login', (player) => {
  setTimeout(() => {
    proxy.setRemoteServer(player.id, "minigames");
  }, 30 * 1000);
});

Documentation

See the wiki.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap