connection works
This commit is contained in:
@@ -19,8 +19,8 @@ export default function TicTacToe() {
|
||||
joinMatchmaker,
|
||||
joinMatch,
|
||||
onMatchData,
|
||||
socket,
|
||||
sendMatchData
|
||||
onMatchmakerMatched,
|
||||
sendMatchData,
|
||||
} = useNakama();
|
||||
|
||||
// ------------------------------------------
|
||||
@@ -42,15 +42,14 @@ export default function TicTacToe() {
|
||||
}
|
||||
});
|
||||
|
||||
// When matchmaker finds a match
|
||||
socket!.onmatchmakermatched = async (matched) => {
|
||||
onMatchmakerMatched(async (matched) => {
|
||||
console.log("Matched:", matched);
|
||||
|
||||
const fullMatchId = matched.match_id;
|
||||
setMatchId(fullMatchId);
|
||||
|
||||
await joinMatch(fullMatchId);
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
// ------------------------------------------
|
||||
@@ -77,7 +76,7 @@ export default function TicTacToe() {
|
||||
{!matchId && (
|
||||
<>
|
||||
<input
|
||||
placeholder="username/device ID"
|
||||
placeholder="username"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user