Commit ce224354 authored by chechunchi's avatar chechunchi

penetrate MsgPosChange and add service

parent edb27b66
Pipeline #19646 passed with stages
in 7 minutes and 9 seconds
......@@ -33,5 +33,22 @@
"repeatedType": "uint32"
}
]
},
"53": {
"protoType": "pos_change",
"fields": [
{
"fieldName": "card_info",
"fieldType": "CardInfo"
},
{
"fieldName": "pre_position",
"fieldType": "CardPosition"
},
{
"fieldName": "cur_position",
"fieldType": "CardPosition"
}
]
}
}
......@@ -3,6 +3,7 @@
import PenetrateData from "./penetrate.json";
import { BufferReader } from "../../bufferIO";
import { ygopro } from "../../../idl/ocgcore";
import { numberToCardPosition } from "../../util";
type Constructor<T = any> = new (...args: any[]) => T;
......@@ -11,10 +12,13 @@ const ReadFieldHandlerMap: Map<string, readFieldHandler> = new Map([
["uint16", (reader) => reader.readUint16()],
["uint32", (reader) => reader.readUint32()],
["CardLocation", (reader) => reader.readCardLocation()],
["CardInfo", (reader) => reader.readCardInfo()],
["CardPosition", (reader) => numberToCardPosition(reader.readUint8())],
]);
const MsgConstructorMap: Map<string, Constructor> = new Map([
["move", ygopro.StocGameMessage.MsgMove as Constructor],
["shuffle_hand", ygopro.StocGameMessage.MsgShuffleHand],
["pos_change", ygopro.StocGameMessage.MsgPosChange],
]);
export interface penetrateType {
......
import { ygopro } from "../../api/ocgcore/idl/ocgcore";
import { AppDispatch } from "../../store";
import MsgPosChange = ygopro.StocGameMessage.MsgPosChange;
export default (posChange: MsgPosChange, dispatch: AppDispatch) => {
console.log(posChange);
};
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