Skip to content

Commit

Permalink
Test using instanceId as room
Browse files Browse the repository at this point in the history
  • Loading branch information
Ancocodet committed Apr 26, 2024
1 parent 2a05ed5 commit f742cef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ window.onload = () => {
console.log("Discord embedded frame detected");
let discordClient = new DiscordClient();
await discordClient.handleAuthentication();

aznopoly.init(discordClient.generateRoomToken())
game.scene.start('lobby')
}

if (debug !== null) {
Expand Down
7 changes: 7 additions & 0 deletions src/util/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ export class DiscordClient {
if (auth === null) {
throw new Error('Authentication failed');
}

console.log(this.discordSdk.instanceId)
console.log(this.discordSdk.instanceId.slice(3, 8))
}

public generateRoomToken() {
return this.discordSdk.instanceId.slice(3, 8)
}

async getChannelName() {
Expand Down

0 comments on commit f742cef

Please sign in to comment.