Commit 06cbef40 authored by Chunchi Che's avatar Chunchi Che

migrate BufferReader

parent fba2301f
Pipeline #20714 failed with stages
in 24 minutes and 58 seconds
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
const LITTLE_ENDIAN = true;
// @ts-ignore
import { BufferReader } from "rust-src";
/*
* MSG Draw
......@@ -11,7 +10,7 @@ const LITTLE_ENDIAN = true;
* @usage - 玩家抽卡内容
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, LITTLE_ENDIAN);
const reader = new BufferReader(data);
const player = reader.readUint8();
const count = reader.readUint8();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
const LITTLE_ENDIAN = true;
// @ts-ignore
import { BufferReader } from "rust-src";
/*
* Msg Hint
......@@ -14,7 +13,7 @@ const LITTLE_ENDIAN = true;
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, LITTLE_ENDIAN);
const reader = new BufferReader(data);
const hintCommand = reader.readUint8();
const hintPlayer = reader.readUint8();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
const LITTLE_ENDIAN = true;
// @ts-ignore
import { BufferReader } from "rust-src";
/*
* Msg New Phase
......@@ -12,7 +11,7 @@ const LITTLE_ENDIAN = true;
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, LITTLE_ENDIAN);
const reader = new BufferReader(data);
const phase = reader.readUint16();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
const LITTLE_ENDIAN = true;
// @ts-ignore
import { BufferReader } from "rust-src";
/*
* MSG New Turn
......@@ -12,7 +11,7 @@ const LITTLE_ENDIAN = true;
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, LITTLE_ENDIAN);
const reader = new BufferReader(data);
const player = reader.readUint8();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
// @ts-ignore
import { BufferReader } from "rust-src";
/*
* Msg Recover
......@@ -8,7 +9,7 @@ import { BufferReader } from "../../bufferIO";
* @param value - 回复的Hp数值
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, true);
const reader = new BufferReader(data);
const player = reader.readUint8();
const value = reader.readInt32();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
// @ts-ignore
import { BufferReader } from "rust-src";
import MsgSelectOption = ygopro.StocGameMessage.MsgSelectOption;
/*
......@@ -11,7 +12,7 @@ import MsgSelectOption = ygopro.StocGameMessage.MsgSelectOption;
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, true);
const reader = new BufferReader(data);
const player = reader.readUint8();
const count = reader.readUint8();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
// @ts-ignore
import { BufferReader } from "rust-src";
import MsgSelectPlace = ygopro.StocGameMessage.MsgSelectPlace;
/*
......@@ -11,7 +12,7 @@ import MsgSelectPlace = ygopro.StocGameMessage.MsgSelectPlace;
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, true);
const reader = new BufferReader(data);
const player = reader.readUint8();
let count = reader.readUint8();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
// @ts-ignore
import { BufferReader } from "rust-src";
import MsgSelectPosition = ygopro.StocGameMessage.MsgSelectPosition;
/*
......@@ -11,7 +12,7 @@ import MsgSelectPosition = ygopro.StocGameMessage.MsgSelectPosition;
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, true);
const reader = new BufferReader(data);
const player = reader.readUint8();
const code = reader.readUint32();
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReader } from "../../bufferIO";
// @ts-ignore
import { BufferReader } from "rust-src";
import MsgWin = ygopro.StocGameMessage.MsgWin;
/*
......@@ -9,7 +10,7 @@ import MsgWin = ygopro.StocGameMessage.MsgWin;
* @param winType - 结果类型
* */
export default (data: Uint8Array) => {
const reader = new BufferReader(data, true);
const reader = new BufferReader(data);
const player = reader.readUint8();
const winType = reader.readUint8();
......
import { ygopro } from "../../idl/ocgcore";
import { YgoProPacket, StocAdapter } from "../packet";
import { BufferReader } from "../bufferIO";
// @ts-ignore
import { BufferReader } from "rust-src";
/*
* STOC TimeLimit
......@@ -16,7 +17,7 @@ export default class TimeLimit implements StocAdapter {
}
upcast(): ygopro.YgoStocMsg {
const reader = new BufferReader(this.packet.exData, true);
const reader = new BufferReader(this.packet.exData);
const player = reader.readInt8();
const leftTime = reader.readUint16();
......
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