diff --git a/src/backend.ts b/src/backend.ts index 697db99..990808f 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -12,7 +12,7 @@ export interface IBackend { handlePing: boolean onlineMode: boolean useProxy: boolean - ping: { + ping?: { maxPlayer: number description?: string favicon?: string diff --git a/src/client.ts b/src/client.ts index f1a655a..25c9723 100644 --- a/src/client.ts +++ b/src/client.ts @@ -106,7 +106,7 @@ export class Client extends EventEmitter { public async pipeToBackend(backend: Backend, nextState: number): Promise { this.socket.unpipe() - await this.proxy.plugin.hooks.server.prePipeToBackend.promise(this) + await this.proxy.plugin.hooks.server.prePipeToBackend.promise(this, backend) if (this.closed) return const socket = connect(backend.port, backend.host) diff --git a/src/plugin-hook.ts b/src/plugin-hook.ts index 75dd002..a15cd3d 100644 --- a/src/plugin-hook.ts +++ b/src/plugin-hook.ts @@ -5,7 +5,7 @@ import {isEmpty} from 'lodash' import {AsyncParallelHook, AsyncSeriesBailHook} from 'tapable' import {Service} from 'typedi' import {VError} from 'verror' -import {IBackend} from './backend' +import {Backend, IBackend} from './backend' import {Client} from './client' import {Config} from './config' import {ProxyServer} from './proxy-server' @@ -20,7 +20,7 @@ export class PluginHook { public readonly hooks = Object.freeze({ server: { lookupBackend: new AsyncSeriesBailHook<[string], IBackend>(['serverName']), - prePipeToBackend: new AsyncParallelHook<[Client]>(), + prePipeToBackend: new AsyncParallelHook<[Client, Backend]>(), }, })