Commit 9aeaa05d authored by nanahira's avatar nanahira

larger looplimit

parent 55afc8da
...@@ -8,7 +8,7 @@ import net from "net"; ...@@ -8,7 +8,7 @@ import net from "net";
class Handler { class Handler {
handler: (buffer: Buffer, info: any, datas: Buffer[], params: any) => Promise<boolean>; private handler: (buffer: Buffer, info: any, datas: Buffer[], params: any) => Promise<boolean>;
synchronous: boolean; synchronous: boolean;
constructor(handler: (buffer: Buffer, info: any, datas: Buffer[], params: any) => Promise<boolean>, synchronous: boolean) { constructor(handler: (buffer: Buffer, info: any, datas: Buffer[], params: any) => Promise<boolean>, synchronous: boolean) {
this.handler = handler; this.handler = handler;
...@@ -46,14 +46,32 @@ export interface HandleResult { ...@@ -46,14 +46,32 @@ export interface HandleResult {
feedback: Feedback; feedback: Feedback;
} }
export interface Constants {
TYPES: Record<string, number>;
RACES: Record<string, number>;
ATTRIBUTES: Record<string, number>;
LINK_MARKERS: Record<string, number>;
DUEL_STAGE: Record<string, number>;
COLORS: Record<string, number>;
TIMING: Record<string, string>;
NETWORK: Record<string, string>;
NETPLAYER: Record<string, string>;
CTOS: Record<string, string>;
STOC: Record<string, string>;
PLAYERCHANGE: Record<string, string>;
ERRMSG: Record<string, string>;
MODE: Record<string, string>;
MSG: Record<string, string>;
}
export class YGOProMessagesHelper { export class YGOProMessagesHelper {
handlers: HandlerList; handlers: HandlerList;
structs: Map<string, Struct>; structs: Map<string, Struct>;
structs_declaration: any; structs_declaration: Record<string, Struct>;
typedefs: any; typedefs: Record<string, string>;
proto_structs: any; proto_structs: Record<'CTOS' | 'STOC', Record<string, string>>;
constants: any; constants: Constants;
singleHandleLimit: number; singleHandleLimit: number;
constructor(singleHandleLimit?: number) { constructor(singleHandleLimit?: number) {
......
...@@ -8,7 +8,7 @@ loadJSON = require('load-json-file').sync ...@@ -8,7 +8,7 @@ loadJSON = require('load-json-file').sync
@i18ns = loadJSON './data/i18n.json' @i18ns = loadJSON './data/i18n.json'
YGOProMessagesHelper = require("./YGOProMessages.js").YGOProMessagesHelper # 为 SRVPro2 准备的库,这里拿这个库只用来测试,SRVPro1 对异步支持不是特别完善,因此不会有很多异步优化 YGOProMessagesHelper = require("./YGOProMessages.js").YGOProMessagesHelper # 为 SRVPro2 准备的库,这里拿这个库只用来测试,SRVPro1 对异步支持不是特别完善,因此不会有很多异步优化
@helper = new YGOProMessagesHelper() @helper = new YGOProMessagesHelper(9000)
@structs = @helper.structs @structs = @helper.structs
@structs_declaration = @helper.structs_declaration @structs_declaration = @helper.structs_declaration
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
YGOProMessagesHelper = require("./YGOProMessages.js").YGOProMessagesHelper; // 为 SRVPro2 准备的库,这里拿这个库只用来测试,SRVPro1 对异步支持不是特别完善,因此不会有很多异步优化 YGOProMessagesHelper = require("./YGOProMessages.js").YGOProMessagesHelper; // 为 SRVPro2 准备的库,这里拿这个库只用来测试,SRVPro1 对异步支持不是特别完善,因此不会有很多异步优化
this.helper = new YGOProMessagesHelper(); this.helper = new YGOProMessagesHelper(9000);
this.structs = this.helper.structs; this.structs = this.helper.structs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment