Commit 89983f5a authored by Chunchi Che's avatar Chunchi Che Committed by WANG HE

rerange ocgAdapter

parent eb4a85ab
import { ygopro } from "./idl/ocgcore";
const PACKET_MIN_LEN = 3;
const littleEndian: boolean = true;
const PACKET_MIN_LEN = 3;
const CtosPlayerInfo = 16;
class ygoProPacket {
export class ygoProPacket {
packetLen: number;
proto: number;
exData: Uint8Array;
......@@ -51,14 +47,3 @@ export class ygoArrayBuilder extends ygoProPacket {
}
}
}
export class playerInfoPacket extends ygoProPacket {
constructor(pb: ygopro.YgoCtosMsg) {
const encoder = new TextEncoder();
const player = pb.ctos_player_info.name;
const exData = encoder.encode(player);
super(exData.length + 1, CtosPlayerInfo, exData);
}
}
import { ygopro } from "../idl/ocgcore";
import { ygoProPacket } from "./packet";
const CtosPlayerInfo = 16;
export class playerInfoPacket extends ygoProPacket {
constructor(pb: ygopro.YgoCtosMsg) {
const encoder = new TextEncoder();
const player = pb.ctos_player_info.name;
const exData = encoder.encode(player);
super(exData.length + 1, CtosPlayerInfo, exData);
}
}
import { ygopro } from "./idl/ocgcore";
import socketMiddleWare, { socketCmd } from "../../middleware/socket";
import { IDeck } from "../Card";
import { playerInfoPacket } from "./ocgAdapter";
import { playerInfoPacket } from "./ocgAdapter/playerInfo";
export function sendUpdateDeck(deck: IDeck) {
const updateDeck = new ygopro.YgoCtosMsg({
......
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