Skip to content

Commit

Permalink
fix consolefuncs not working
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomityGuy committed Mar 3, 2024
1 parent 2a3efb0 commit d1d4c1c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions engine/source/discord/DiscordGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,21 @@ void onDisconnected(int errorCode, const char* message)

void onJoinGame(const char* joinSecret)
{
Con::executef(2, "Discord::joinGame", joinSecret);
char* buf = Con::getReturnBuffer(1024);
dSprintf(buf, 1024, "Discord::joinGame(\"%s\");", joinSecret);
Con::evaluatef(buf);
}

void onJoinRequest(const DiscordUser* request)
{
int reply = DISCORD_REPLY_IGNORE;
reply = atoi(Con::executef(2, "Discord::onJoinRequest", request->username));

char* buf = Con::getReturnBuffer(1024);
char escaped[128];
expandEscape(escaped, request->username);
dSprintf(buf, 1024, "Discord::onJoinRequest(\"%s\");", escaped);

reply = atoi(Con::evaluatef(buf));
Discord_Respond(request->userId, reply);
}

Expand Down

0 comments on commit d1d4c1c

Please sign in to comment.