32 lines
2.7 KiB
Markdown
32 lines
2.7 KiB
Markdown
# Discord in the guild window via native C_Discord — what it needs (2026-11-29, Claude, task #44)
|
|
|
|
## What the 70334 client has
|
|
- `C_Discord` Lua API (Authorize, GetNumDiscordServers, GetServerLinkableChannels, GuildLink/GuildUnlink,
|
|
Get/SetGuildSetting, IsUserOAuthed, events DISCORD_LINK_UPDATE / DISCORD_GUILD_LOBBY_UPDATE / DISCORD_SERVER_LIST_UPDATE).
|
|
On LOCAL: IsEnabled=true, IsVoiceEnabled=true, IsUserOAuthed=nil, GetNumDiscordServers=nil.
|
|
- `Utils/discord_partner_sdk.dll` (Discord Social SDK) in both clients; it exports `discord::Client::Authorize(AuthorizationArgs, cb)`,
|
|
`GetTokenFromDevice`, Lobby/LobbyHandle/LobbyMemberHandle — the app (client) ID is passed at runtime, not baked as text.
|
|
- WowB side: `Ui/WowDiscordAuth.cpp` with `WowDiscordAuthStatusOp` (auth status comes back through a Battle.net op), a
|
|
`client_id=%s&scope=%s&token=%s&grant_type=%s&token_type=%s` token request, and game-server messages
|
|
`JamDiscordMessageInfo / JamDiscordPlayerInfo / JamDiscordUser` carrying `guildLobbyID` (UpdateGuildLobby).
|
|
|
|
## What that means
|
|
1. **Sign-in (Authorize)** runs against *Blizzard's* Discord application and finishes its token exchange through Battle.net.
|
|
We have no Battle.net (memory no-battlenet-identity), so stock Authorize can never complete.
|
|
2. **The guild↔channel link is a server-side Discord lobby.** The client only receives `guildLobbyID` from the game
|
|
server; creating the lobby and linking it to a Discord channel is done by the game backend with the application's
|
|
bot token (Discord "linked channels"). Turtle's server has no such feature.
|
|
|
|
## What a working version requires
|
|
| Part | Who | Notes |
|
|
|---|---|---|
|
|
| Own Discord application (app ID, linked-channels access) | **owner** registers at the Discord developer portal | linked channels may need Discord approval |
|
|
| Client uses our app ID + public-client (PKCE) sign-in, no Battle.net op | Backend hook in WowDiscordAuth path | RE of the auth op + Authorize args (Ghidra proj3) |
|
|
| Guild lobby create/link per guild, sends `guildLobbyID` | a small service on the VPS holding the bot token; gateway delivers the lobby ID packet | this is a NEW service, not Turtle server data — owner decision (rule: no invented server features) |
|
|
| Guild chat bridge | Social SDK lobby messages <-> CHAT_MSG_GUILD_DISCORD | client already renders GUILD_DISCORD chat |
|
|
|
|
## Recommendation
|
|
Decision needed from the owner before any code: (a) register an OctoWoW Discord application, and (b) accept a
|
|
VPS-side lobby service (outside the Turtle server). Without both, native C_Discord can show the UI but cannot sign in
|
|
or link. Cheaper alternative: keep a "Join our Discord" invite link in the guild window (no SDK).
|