Refactor ProtoFactory
This commit is contained in:
parent
c537726f27
commit
4ef3575a13
@ -7,11 +7,11 @@ import Interface from "./commands/Interface";
|
|||||||
import HttpServer from "./http/HttpServer";
|
import HttpServer from "./http/HttpServer";
|
||||||
import SRServer from "./server/kcp/SRServer";
|
import SRServer from "./server/kcp/SRServer";
|
||||||
import Logger from "./util/Logger";
|
import Logger from "./util/Logger";
|
||||||
import ProtoFactory from "./ProtoFactory"
|
import ProtoFactory from "./util/ProtoFactory"
|
||||||
|
|
||||||
const c = new Logger("CrepeSR");
|
const c = new Logger("CrepeSR");
|
||||||
ProtoFactory.init();
|
|
||||||
c.log(`Starting CrepeSR...`);
|
c.log(`Starting CrepeSR...`);
|
||||||
|
ProtoFactory.init();
|
||||||
Interface.start();
|
Interface.start();
|
||||||
HttpServer.getInstance().start();
|
HttpServer.getInstance().start();
|
||||||
SRServer.getInstance().start();
|
SRServer.getInstance().start();
|
@ -1,12 +1,10 @@
|
|||||||
//ts-proto generated types required, import them here
|
//ts-proto generated types required, import them here
|
||||||
import * as types from "./data/proto/StarRail";
|
import * as types from "../data/proto/StarRail";
|
||||||
import protobufjs from "protobufjs";
|
import protobufjs from "protobufjs";
|
||||||
import {CmdID, PacketName} from "./server/kcp/Packet"
|
import { CmdID, PacketName } from "../server/kcp/Packet"
|
||||||
import Logger from "./util/Logger";
|
import Logger from "./Logger";
|
||||||
|
const c = new Logger("ProtoFactory");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var c = new Logger("ProtoFactory");
|
|
||||||
class MessageType<T> {
|
class MessageType<T> {
|
||||||
"encode": (arg0: T) => protobufjs.Writer;
|
"encode": (arg0: T) => protobufjs.Writer;
|
||||||
"fromPartial": (arg0: object) => T;
|
"fromPartial": (arg0: object) => T;
|
||||||
@ -58,13 +56,11 @@ export default class ProtoFactory{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.debug("Initialized with " + messageTypeMap.size + " types");
|
c.debug(`Initialized with " ${messageTypeMap.size} types`);
|
||||||
|
|
||||||
//c.log(this.getName(types.PlayerLoginScRsp))
|
//c.log(this.getName(types.PlayerLoginScRsp))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if you want a partial type
|
//if you want a partial type
|
||||||
send(types.PlayerLoginScRsp, types.PlayerLoginScRsp.fromPartial({
|
send(types.PlayerLoginScRsp, types.PlayerLoginScRsp.fromPartial({
|
||||||
basicInfo: {
|
basicInfo: {
|
Loading…
Reference in New Issue
Block a user