feat: support address arg
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
393ae6ce25
commit
64159b621f
@ -6,7 +6,9 @@ import { attachEvents } from './event'
|
|||||||
|
|
||||||
let username = process.argv[2] || 'Mr_jtb'
|
let username = process.argv[2] || 'Mr_jtb'
|
||||||
let version = process.argv[3] || '1.12.2'
|
let version = process.argv[3] || '1.12.2'
|
||||||
let client = createConnection('192.168.2.5', 25577, username)
|
let address = process.argv[4] || '192.168.2.5:25577'
|
||||||
|
let realAddress = address.split(":");
|
||||||
|
let client = createConnection(realAddress[0], parseInt(realAddress[1] || "25565"), username)
|
||||||
|
|
||||||
function createConnection(host: string, port: number, username: string) {
|
function createConnection(host: string, port: number, username: string) {
|
||||||
let client = createClient({
|
let client = createClient({
|
||||||
|
Loading…
Reference in New Issue
Block a user