Commit 31664f9f authored by Chunchi Che's avatar Chunchi Che

fix handle StocHsPlayerChange

parent 89b8c344
...@@ -62,10 +62,46 @@ export default function WaitRoom() { ...@@ -62,10 +62,46 @@ export default function WaitRoom() {
break; break;
} }
case "stoc_hs_player_change": { case "stoc_hs_player_change": {
// todo: rerange neos-protobuf, design better API for neos-ts const change = pb.stoc_hs_player_change;
const status = pb.stoc_hs_player_change.status;
switch (change.state) {
case ygopro.StocHsPlayerChange.State.UNKNOWN: {
console.log("Unknown HsPlayerChange State");
break;
}
case ygopro.StocHsPlayerChange.State.MOVE: {
console.log(
"Player " + change.pos + " moved to " + change.moved_pos
);
break;
}
case ygopro.StocHsPlayerChange.State.READY: {
console.log("Player " + change.pos + " has ready");
break;
}
case ygopro.StocHsPlayerChange.State.NO_READY: {
console.log("Player " + change.pos + " not ready");
break;
}
case ygopro.StocHsPlayerChange.State.LEAVE: {
console.log("Player " + change.pos + " has leave");
break;
}
case ygopro.StocHsPlayerChange.State.TO_OBSERVER: {
console.log("Player " + change.pos + " has moved to observer");
break;
}
default: {
break;
}
}
console.log("Hs player changed, status=" + status);
break; break;
} }
default: { default: {
......
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