Commit 66b1e942 authored by Chunchi Che's avatar Chunchi Che

add GameMsg Draw adapter

parent 58f5178e
Pipeline #18010 passed with stages
in 5 minutes and 56 seconds
...@@ -16,10 +16,14 @@ export default (data: Uint8Array) => { ...@@ -16,10 +16,14 @@ export default (data: Uint8Array) => {
const player = reader.readUint8(); const player = reader.readUint8();
const count = reader.readUint8(); const count = reader.readUint8();
let hands: number[] = []; let cards: number[] = [];
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
hands.push(reader.readUint32()); cards.push(reader.readUint32());
} }
// TODO return new ygopro.StocGameMessage.MsgDraw({
player,
count,
cards,
});
}; };
...@@ -7,6 +7,7 @@ import { ygopro } from "../../../idl/ocgcore"; ...@@ -7,6 +7,7 @@ import { ygopro } from "../../../idl/ocgcore";
import { YgoProPacket, StocAdapter } from "../../packet"; import { YgoProPacket, StocAdapter } from "../../packet";
import * as GAME_MSG from "../../protoDecl"; import * as GAME_MSG from "../../protoDecl";
import MsgStartAdapter from "./start"; import MsgStartAdapter from "./start";
import MsgDrawAdapter from "./draw";
/* /*
* STOC GameMsg * STOC GameMsg
...@@ -38,7 +39,7 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -38,7 +39,7 @@ export default class GameMsgAdapter implements StocAdapter {
break; break;
} }
case GAME_MSG.MSG_DRAW: { case GAME_MSG.MSG_DRAW: {
// TODO gameMsg.draw = MsgDrawAdapter(gameData);
break; break;
} }
......
...@@ -10,6 +10,12 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -10,6 +10,12 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "draw": {
// TODO
console.log(msg.draw);
break;
}
default: { default: {
console.log("Unhandled GameMsg=" + msg.gameMsg); console.log("Unhandled GameMsg=" + msg.gameMsg);
......
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