Commit 118f787d authored by Chunchi Che's avatar Chunchi Che

update small

parent cdce7caf
...@@ -29,17 +29,17 @@ export default function JoinRoom() { ...@@ -29,17 +29,17 @@ export default function JoinRoom() {
<p> <p>
<input <input
type="text" type="text"
title="passwd" title="ip"
value={passWd} value={ip}
onChange={handlePasswdChange} onChange={handleIpChange}
></input> ></input>
</p> </p>
<p> <p>
<input <input
type="text" type="text"
title="ip" title="passwd"
value={ip} value={passWd}
onChange={handleIpChange} onChange={handlePasswdChange}
></input> ></input>
</p> </p>
<button> <button>
......
...@@ -29,6 +29,8 @@ export default function WaitRoom() { ...@@ -29,6 +29,8 @@ export default function WaitRoom() {
) { ) {
const wsCurrent = ws.current; const wsCurrent = ws.current;
wsCurrent.binaryType = "arraybuffer";
const playerInfo = new ygopro.YgoCtosMsg({ const playerInfo = new ygopro.YgoCtosMsg({
ctos_player_info: new ygopro.CtosPlayerInfo({ ctos_player_info: new ygopro.CtosPlayerInfo({
name: player name: player
...@@ -54,7 +56,8 @@ export default function WaitRoom() { ...@@ -54,7 +56,8 @@ export default function WaitRoom() {
}; };
ws.current.onmessage = e => { ws.current.onmessage = e => {
console.log("websocket read message: " + e.data); const pb: ygopro.YgoStocMsg = ygopro.YgoStocMsg.deserializeBinary(e.data);
console.log("websocket read message: " + pb);
}; };
const wsCurrent = ws.current; const wsCurrent = ws.current;
...@@ -69,8 +72,8 @@ export default function WaitRoom() { ...@@ -69,8 +72,8 @@ export default function WaitRoom() {
return ( return (
<div> <div>
<p>player: {params.player}</p> <p>player: {params.player}</p>
<p>passwd: {params.passWd}</p>
<p>ip: {params.ip}</p> <p>ip: {params.ip}</p>
<p>passwd: {params.passWd}</p>
</div> </div>
); );
} }
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