Commit 8839359e authored by Chunchi Che's avatar Chunchi Che

handle sibyl_name

parent e32be7ec
Pipeline #22624 passed with stages
in 14 minutes and 7 seconds
...@@ -69,3 +69,4 @@ export const MSG_FIELD_DISABLED = 56; ...@@ -69,3 +69,4 @@ export const MSG_FIELD_DISABLED = 56;
export const MSG_HAND_RES = 133; export const MSG_HAND_RES = 133;
export const MSG_SHUFFLE_HAND = 33; export const MSG_SHUFFLE_HAND = 33;
export const MSG_SHUFFLE_EXTRA = 39; export const MSG_SHUFFLE_EXTRA = 39;
export const MSG_SIBYL_NAME = 235;
...@@ -37,6 +37,7 @@ import MsgSelectTributeAdapter from "./selectTribute"; ...@@ -37,6 +37,7 @@ import MsgSelectTributeAdapter from "./selectTribute";
import MsgSelectUnselectCardAdapter from "./selectUnselectCard"; import MsgSelectUnselectCardAdapter from "./selectUnselectCard";
import MsgShuffleHandExtraAdapter from "./shuffleHandExtra"; import MsgShuffleHandExtraAdapter from "./shuffleHandExtra";
import MsgShuffleSetCard from "./shuffleSetCard"; import MsgShuffleSetCard from "./shuffleSetCard";
import MsgSibylNameAdapter from "./sibylName";
import MsgSortCard from "./sortCard"; import MsgSortCard from "./sortCard";
import MsgStartAdapter from "./start"; import MsgStartAdapter from "./start";
import MsgTossAdapter from "./toss"; import MsgTossAdapter from "./toss";
...@@ -273,6 +274,11 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -273,6 +274,11 @@ export default class GameMsgAdapter implements StocAdapter {
break; break;
} }
case GAME_MSG.MSG_SIBYL_NAME: {
gameMsg.sibyl_name = MsgSibylNameAdapter(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 MsgSibylName = ygopro.StocGameMessage.MsgSibylName;
const LEN = 100;
/*
* Msg Sibyl Name
* @param - TODO
*
* @usage - Replay模式获取对战双方的昵称
* */
export default (data: Uint8Array) => {
const decoder = new TextDecoder("utf-16");
let offset = 0;
const name_0 = decoder.decode(data.slice(offset, offset + LEN));
offset += LEN;
const name_0_tag = decoder.decode(data.slice(offset, offset + LEN));
offset += LEN;
const name_0_c = decoder.decode(data.slice(offset, offset + LEN));
offset += LEN;
const name_1 = decoder.decode(data.slice(offset, offset + LEN));
offset += LEN;
const name_1_tag = decoder.decode(data.slice(offset, offset + LEN));
offset += LEN;
const name_1_c = decoder.decode(data.slice(offset, offset + LEN));
return new MsgSibylName({
name_0,
name_0_tag,
name_0_c,
name_1,
name_1_tag,
name_1_c,
});
};
...@@ -41,6 +41,7 @@ import onMsgSet from "./set"; ...@@ -41,6 +41,7 @@ import onMsgSet from "./set";
import onMsgShuffleDeck from "./shuffleDeck"; import onMsgShuffleDeck from "./shuffleDeck";
import onMsgShuffleHandExtra from "./shuffleHandExtra"; import onMsgShuffleHandExtra from "./shuffleHandExtra";
import onMsgShuffleSetCard from "./shuffleSetCard"; import onMsgShuffleSetCard from "./shuffleSetCard";
import onMsgSibylName from "./sibylName";
import onMsgSortCard from "./sortCard"; import onMsgSortCard from "./sortCard";
import onMsgSpSummoned from "./spSummoned"; import onMsgSpSummoned from "./spSummoned";
import onMsgSpSummoning from "./spSummoning"; import onMsgSpSummoning from "./spSummoning";
...@@ -366,6 +367,11 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -366,6 +367,11 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "sibyl_name": {
onMsgSibylName(msg.sibyl_name);
break;
}
case "unimplemented": { case "unimplemented": {
onUnimplemented(msg.unimplemented); onUnimplemented(msg.unimplemented);
......
import { ygopro } from "@/api";
type MsgSibylName = ygopro.StocGameMessage.MsgSibylName;
export default (sibylName: MsgSibylName) => {
console.log(sibylName);
};
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