Commit ece99eb0 authored by Chunchi Che's avatar Chunchi Che

add CtosHsToObserver and CtosHsToDuelList support

parent 9f7c37a8
Pipeline #22939 failed with stages
in 9 minutes and 48 seconds
neos-protobuf @ d6c01dd8
Subproject commit 30f4ea7acd79b9cb18a358548520ca939e22dc5f Subproject commit d6c01dd88fd72f22c432a52ba74eee9ece267499
This diff is collapsed.
...@@ -5,9 +5,9 @@ import { CTOS_HS_NOT_READY } from "../protoDecl"; ...@@ -5,9 +5,9 @@ import { CTOS_HS_NOT_READY } from "../protoDecl";
/* /*
* CTOS HsReady * CTOS HsReady
* *
* @usage - 告诉ygopro服务端当前玩家准备完毕 * @usage - 告诉ygopro服务端当前玩家取消准备
* */ * */
export default class CtosHsReady extends YgoProPacket { export default class CtosHsNotReady extends YgoProPacket {
constructor(_: ygopro.YgoCtosMsg) { constructor(_: ygopro.YgoCtosMsg) {
super(1, CTOS_HS_NOT_READY, new Uint8Array(0)); super(1, CTOS_HS_NOT_READY, new Uint8Array(0));
} }
......
import { ygopro } from "../../idl/ocgcore";
import { YgoProPacket } from "../packet";
import { CTOS_HS_TO_DUEL_LIST } from "../protoDecl";
/*
* CTOS HsReady
*
* @usage - 告诉ygopro服务端当前玩家进入决斗者行列
* */
export default class CtosHsToDuelList extends YgoProPacket {
constructor(_: ygopro.YgoCtosMsg) {
super(1, CTOS_HS_TO_DUEL_LIST, new Uint8Array(0));
}
}
import { ygopro } from "../../idl/ocgcore";
import { YgoProPacket } from "../packet";
import { CTOS_HS_TO_OBSERVER } from "../protoDecl";
/*
* CTOS HsReady
*
* @usage - 告诉ygopro服务端当前玩家进入观战者行列
* */
export default class CtosHsToObserver extends YgoProPacket {
constructor(_: ygopro.YgoCtosMsg) {
super(1, CTOS_HS_TO_OBSERVER, new Uint8Array(0));
}
}
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
export const CTOS_PLAYER_INFO = 16; export const CTOS_PLAYER_INFO = 16;
export const CTOS_JOIN_GAME = 18; export const CTOS_JOIN_GAME = 18;
export const CTOS_UPDATE_DECK = 2; export const CTOS_UPDATE_DECK = 2;
export const CTOS_HS_TO_DUEL_LIST = 32;
export const CTOS_HS_TO_OBSERVER = 33;
export const CTOS_HS_READY = 34; export const CTOS_HS_READY = 34;
export const CTOS_HS_NOT_READY = 35; export const CTOS_HS_NOT_READY = 35;
export const CTOS_HS_START = 37; export const CTOS_HS_START = 37;
......
...@@ -12,6 +12,8 @@ import HandResult from "./ocgAdapter/ctos/ctosHandResult"; ...@@ -12,6 +12,8 @@ import HandResult from "./ocgAdapter/ctos/ctosHandResult";
import HsNotReadyAdapter from "./ocgAdapter/ctos/ctosHsNotReady"; import HsNotReadyAdapter from "./ocgAdapter/ctos/ctosHsNotReady";
import HsReadyAdapter from "./ocgAdapter/ctos/ctosHsReady"; import HsReadyAdapter from "./ocgAdapter/ctos/ctosHsReady";
import HsStartAdapter from "./ocgAdapter/ctos/ctosHsStart"; import HsStartAdapter from "./ocgAdapter/ctos/ctosHsStart";
import HsToDuelListAdapter from "./ocgAdapter/ctos/ctosHsToDuelList";
import HsToObserverAdapter from "./ocgAdapter/ctos/ctosHsToObserver";
import JoinGameAdapter from "./ocgAdapter/ctos/ctosJoinGame"; import JoinGameAdapter from "./ocgAdapter/ctos/ctosJoinGame";
import PlayerInfoAdapter from "./ocgAdapter/ctos/ctosPlayerInfo"; import PlayerInfoAdapter from "./ocgAdapter/ctos/ctosPlayerInfo";
import Surrender from "./ocgAdapter/ctos/ctosSurrender"; import Surrender from "./ocgAdapter/ctos/ctosSurrender";
...@@ -52,6 +54,24 @@ export function sendHsNotReady() { ...@@ -52,6 +54,24 @@ export function sendHsNotReady() {
socketMiddleWare({ cmd: socketCmd.SEND, payload }); socketMiddleWare({ cmd: socketCmd.SEND, payload });
} }
export function sendHsToObserver() {
const hasToObserver = new ygopro.YgoCtosMsg({
ctos_hs_to_observer: new ygopro.CtosHsToObserver({}),
});
const payload = new HsToObserverAdapter(hasToObserver).serialize();
socketMiddleWare({ cmd: socketCmd.SEND, payload });
}
export function sendHsToDuelList() {
const hasToDuelList = new ygopro.YgoCtosMsg({
ctos_hs_to_duel_list: new ygopro.CtosHsToDuelList({}),
});
const payload = new HsToDuelListAdapter(hasToDuelList).serialize();
socketMiddleWare({ cmd: socketCmd.SEND, payload });
}
export function sendHsStart() { export function sendHsStart() {
const hasStart = new ygopro.YgoCtosMsg({ const hasStart = new ygopro.YgoCtosMsg({
ctos_hs_start: new ygopro.CtosHsStart({}), ctos_hs_start: new ygopro.CtosHsStart({}),
......
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