Commit 9494c3c6 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 5b108161 160c8f96
......@@ -27,6 +27,20 @@ class Handler {
class YGOProMessagesHelper {
constructor() {
this.handlers = {
STOC: [{},
{},
{},
{},
{},
],
CTOS: [{},
{},
{},
{},
{},
]
}
this.initDatas();
this.initStructs();
}
......@@ -39,6 +53,7 @@ class YGOProMessagesHelper {
}
initStructs() {
this.structs = {};
for (let name in this.structs_declaration ) {
const declaration = this.structs_declaration [name];
let result = Struct();
......@@ -232,20 +247,4 @@ class YGOProMessagesHelper {
}
YGOProMessagesHelper.prototype.structs = {}
YGOProMessagesHelper.prototype.handlers = {
STOC: [{},
{},
{},
{},
{},
],
CTOS: [{},
{},
{},
{},
{},
]
}
module.exports = YGOProMessagesHelper;
This diff is collapsed.
This diff is collapsed.
......@@ -18,7 +18,7 @@ YGOProMessageHelper = require("./YGOProMessages.js") # 为 SRVPro2 准备的库
translateHandler = (handler) ->
return (buffer, info, datas, params)->
await return handler(buffer, info, params.client, params.server, datas)
await return await handler(buffer, info, params.client, params.server, datas)
@stoc_follow = (proto, synchronous, callback)->
@helper.addHandler("STOC_#{proto}", translateHandler(callback), synchronous, 1)
......
......@@ -30,7 +30,7 @@
translateHandler = function(handler) {
return async function(buffer, info, datas, params) {
return handler(buffer, info, params.client, params.server, datas);
return (await handler(buffer, info, params.client, params.server, datas));
};
};
......
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