- 有一些服务端
- 有一些世界,可以用文件系统来管理
- 世界可能是空的,但是具备独立的种子
- 玩家第一次进入服务器将会被分配三个世界,主世界,地狱和末地
- 玩家在上线的时候,将与其存在关联的世界载入
- 世界可能会载入到任意一个服务端内,并建立关联
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exec = require('child_process').exec | |
const readline = require('readline'); | |
const cmd = "ifconfig pppoe-wan |grep 'inet addr' |cut -d: -f2|awk '{print $1}'" | |
const ipPattern = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ | |
function get_pppoe_ip() { | |
return new Promise((resolve, reject) => { | |
exec(cmd, (err, stdout, stderr) => { | |
stdout = stdout.replace(/\n/g, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ip = require("ip"); | |
const fs = require("fs"); | |
const rl = require("readline"); | |
// https://www.regextester.com/93987 | |
var cidrPattern = /^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$/; | |
function readSourceFromStdin(callbcak) { | |
let source = {}; | |
let input = rl.createInterface({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest | |
const http = require('http'); | |
const https = require('https'); | |
const url = require('url') | |
const fs = require('fs'); | |
const readline = require('readline'); | |
function parse(input) { | |
const writeStream = fs.createWriteStream("output"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chn_routes = [ | |
'1.0.1.0/24', | |
'1.0.2.0/23', | |
'1.0.8.0/21', | |
'1.0.32.0/19', | |
'1.1.0.0/24', | |
'1.1.2.0/23', | |
'1.1.4.0/22', | |
'1.1.8.0/21', | |
'1.1.16.0/20', |
I hereby claim:
- I am theTd on github.
- I am thetd (https://keybase.io/thetd) on keybase.
- I have a public key whose fingerprint is F94A E27E 05B6 B0F2 8345 33B5 2EEB 5255 1E5B 87B3
To claim this, I am signing this object: