Commit f8597fc0 authored by chechunchi's avatar chechunchi

handle shuffle_set_card

parent 5f4753b4
Pipeline #22307 passed with stages
in 15 minutes and 51 seconds
...@@ -64,3 +64,4 @@ export const MSG_ANNOUNCE_CARD = 142; ...@@ -64,3 +64,4 @@ export const MSG_ANNOUNCE_CARD = 142;
export const MSG_ANNOUNCE_NUMBER = 143; export const MSG_ANNOUNCE_NUMBER = 143;
export const MSG_TOSS_COIN = 130; export const MSG_TOSS_COIN = 130;
export const MSG_TOSS_DICE = 131; export const MSG_TOSS_DICE = 131;
export const MSG_SHUFFLE_SET_CARD = 36;
...@@ -33,6 +33,7 @@ import MsgSelectPositionAdapter from "./selectPosition"; ...@@ -33,6 +33,7 @@ import MsgSelectPositionAdapter from "./selectPosition";
import MsgSelectSum from "./selectSum"; import MsgSelectSum from "./selectSum";
import MsgSelectTributeAdapter from "./selectTribute"; import MsgSelectTributeAdapter from "./selectTribute";
import MsgSelectUnselectCardAdapter from "./selectUnselectCard"; import MsgSelectUnselectCardAdapter from "./selectUnselectCard";
import MsgShuffleSetCard from "./shuffle_set_card";
import MsgSortCard from "./sortCard"; import MsgSortCard from "./sortCard";
import MsgStartAdapter from "./start"; import MsgStartAdapter from "./start";
import MsgTossAdapter from "./toss"; import MsgTossAdapter from "./toss";
...@@ -238,6 +239,11 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -238,6 +239,11 @@ export default class GameMsgAdapter implements StocAdapter {
break; break;
} }
case GAME_MSG.MSG_SHUFFLE_SET_CARD: {
gameMsg.shuffle_set_card = MsgShuffleSetCard(gameData);
break;
}
default: { default: {
gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({ gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({
command: func, command: func,
......
import { ygopro } from "@/api/ocgcore/idl/ocgcore";
import { BufferReaderExt } from "../../bufferIO";
import { numberToCardZone } from "../../util";
import MsgShuffleSetCard = ygopro.StocGameMessage.MsgShuffleSetCard;
/*
* Msg Shuffle Set Card
* @param - TODO
*
* @usage - 盖卡切洗
* */
export default (data: Uint8Array) => {
const reader = new BufferReaderExt(data);
const zone = numberToCardZone(reader.inner.readUint8());
const count = reader.inner.readUint8();
const from_locations = [];
const to_locations = [];
for (let i = 0; i < count; i++) {
from_locations.push(reader.readCardLocation());
}
for (let i = 0; i < count; i++) {
to_locations.push(reader.readCardLocation());
}
return new MsgShuffleSetCard({
zone,
from_locations,
to_locations,
});
};
...@@ -35,6 +35,7 @@ import onMsgSelectUnselectCard from "./selectUnselectCard"; ...@@ -35,6 +35,7 @@ import onMsgSelectUnselectCard from "./selectUnselectCard";
import onMsgSelectYesNo from "./selectYesNo"; import onMsgSelectYesNo from "./selectYesNo";
import onMsgSet from "./set"; import onMsgSet from "./set";
import onMsgShuffleHand from "./shuffleHand"; import onMsgShuffleHand from "./shuffleHand";
import onMsgShuffleSetCard from "./shuffleSetCard";
import onMsgSortCard from "./sortCard"; import onMsgSortCard from "./sortCard";
import onMsgSpSummoned from "./spSummoned"; import onMsgSpSummoned from "./spSummoned";
import onMsgSpSummoning from "./spSummoning"; import onMsgSpSummoning from "./spSummoning";
...@@ -309,6 +310,11 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -309,6 +310,11 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "shuffle_set_card": {
onMsgShuffleSetCard(msg.shuffle_set_card);
break;
}
case "unimplemented": { case "unimplemented": {
onUnimplemented(msg.unimplemented); onUnimplemented(msg.unimplemented);
......
import { ygopro } from "@/api";
import MsgShuffleSetCard = ygopro.StocGameMessage.MsgShuffleSetCard;
export default (shuffleSetCard: MsgShuffleSetCard) => {
console.log(shuffleSetCard);
};
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