fix: some bug
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
b6d7847a79
commit
d8d03149df
@ -155,7 +155,11 @@ export namespace plugin {
|
|||||||
*/
|
*/
|
||||||
cname?: string
|
cname?: string
|
||||||
/**
|
/**
|
||||||
* 插件等级 付费插件自动注入
|
* 付费插件ID
|
||||||
|
*/
|
||||||
|
pid?: number
|
||||||
|
/**
|
||||||
|
* 付费插件等级 付费插件自动注入
|
||||||
*/
|
*/
|
||||||
level?: number
|
level?: number
|
||||||
/**
|
/**
|
||||||
|
@ -172,13 +172,13 @@ export namespace server {
|
|||||||
}
|
}
|
||||||
protected reflectRootLogger(consoleServer: any) {
|
protected reflectRootLogger(consoleServer: any) {
|
||||||
try {
|
try {
|
||||||
this.rootLogger = reflect.on(consoleServer).get('LOGGER').get().parent
|
this.rootLogger = reflect.on(consoleServer).get('LOGGER').get()
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (global.debug) {
|
if (global.debug) {
|
||||||
console.ex(error)
|
console.ex(error)
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.rootLogger = reflect.on(consoleServer).get(0).get().parent
|
this.rootLogger = reflect.on(consoleServer).get(0).get()
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (global.debug) {
|
if (global.debug) {
|
||||||
console.ex(error)
|
console.ex(error)
|
||||||
|
@ -6,7 +6,7 @@ let bukkitChatInvoke: BukkitChatInvoke
|
|||||||
abstract class BukkitChatInvoke {
|
abstract class BukkitChatInvoke {
|
||||||
private downgrade: boolean = false
|
private downgrade: boolean = false
|
||||||
protected RemapUtils: any
|
protected RemapUtils: any
|
||||||
protected ComponentSerializer:any
|
protected ComponentSerializer: any
|
||||||
|
|
||||||
protected ChatSerializer: any
|
protected ChatSerializer: any
|
||||||
protected nmsChatSerializerMethodName: string
|
protected nmsChatSerializerMethodName: string
|
||||||
@ -39,6 +39,8 @@ abstract class BukkitChatInvoke {
|
|||||||
if (nmsChatMessageTypeClass.isEnum()) {
|
if (nmsChatMessageTypeClass.isEnum()) {
|
||||||
this.chatMessageTypes = nmsChatMessageTypeClass.getEnumConstants()
|
this.chatMessageTypes = nmsChatMessageTypeClass.getEnumConstants()
|
||||||
break
|
break
|
||||||
|
} else if (nmsChatMessageTypeClass.getName() == 'int') {
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ class Reflect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!field) throw new Error(`can't reflect field ${typeof nameOrIndex == "number" ? 'index' : 'name'} ${nameOrIndex} from ${this.class.getName()}!`)
|
if (!field) throw new Error(`can't reflect field ${typeof nameOrIndex == "number" ? 'index' : 'name'} ${nameOrIndex} from ${this.class.getName()}!`)
|
||||||
|
fieldCache.set(key, field)
|
||||||
return accessible(field)
|
return accessible(field)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ export class NettyWebSocket extends Transport {
|
|||||||
private _host: string
|
private _host: string
|
||||||
private _port: number
|
private _port: number
|
||||||
private channel: any
|
private channel: any
|
||||||
private b = new Bootstrap();
|
private b: any
|
||||||
|
|
||||||
constructor(url: string, subProtocol: string = '', headers: WebSocketHeader = {}) {
|
constructor(url: string, subProtocol: string = '', headers: WebSocketHeader = {}) {
|
||||||
super(url, subProtocol, headers)
|
super(url, subProtocol, headers)
|
||||||
@ -102,6 +102,7 @@ export class NettyWebSocket extends Transport {
|
|||||||
// HttpResponseDecoder to WebSocketHttpResponseDecoder in the pipeline.
|
// HttpResponseDecoder to WebSocketHttpResponseDecoder in the pipeline.
|
||||||
let handler = new WebSocketClientHandler(WebSocketClientHandshakerFactory
|
let handler = new WebSocketClientHandler(WebSocketClientHandshakerFactory
|
||||||
.newHandshaker(uri, WebSocketVersion.V13, null, false, headers), this)
|
.newHandshaker(uri, WebSocketVersion.V13, null, false, headers), this)
|
||||||
|
this.b = new Bootstrap()
|
||||||
this.b.group(group)
|
this.b.group(group)
|
||||||
.channel(socketChannelClass)
|
.channel(socketChannelClass)
|
||||||
.handler(new ChannelInitializer({
|
.handler(new ChannelInitializer({
|
||||||
@ -123,6 +124,7 @@ export class NettyWebSocket extends Transport {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.b.connect(this._host, this._port).addListener(new ChannelFutureListener((future: any) => {
|
this.b.connect(this._host, this._port).addListener(new ChannelFutureListener((future: any) => {
|
||||||
|
try {
|
||||||
this.channel = future.sync().channel()
|
this.channel = future.sync().channel()
|
||||||
this.onconnection({})
|
this.onconnection({})
|
||||||
handler.handshakeFuture.addListener(new ChannelFutureListener((future: any) => {
|
handler.handshakeFuture.addListener(new ChannelFutureListener((future: any) => {
|
||||||
@ -135,6 +137,9 @@ export class NettyWebSocket extends Transport {
|
|||||||
// this.onerror({ error })
|
// this.onerror({ error })
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
} catch (error: any) {
|
||||||
|
this.onerror({ error })
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
doSend(text: string) {
|
doSend(text: string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user