Who even knows how this works anyway
This commit is contained in:
Binary file not shown.
@@ -61,7 +61,7 @@ static void JoinRequestHandler(const DiscordJoinRequest* request)
|
||||
jr.avatar = ANSI_TO_TCHAR(request->avatar);
|
||||
UE_LOG(Discord, Log, TEXT("Discord join request from %s - %s#%s"), *jr.userId, *jr.username, *jr.discriminator);
|
||||
if (self) {
|
||||
self->OnJoinRequest.Broadcast(jr.userId);
|
||||
self->OnJoinRequest.Broadcast(jr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,9 +149,9 @@ void UDiscordRpc::ClearPresence()
|
||||
Discord_ClearPresence();
|
||||
}
|
||||
|
||||
static void UDiscordRpc::Respond(const FString& userId)
|
||||
void UDiscordRpc::Respond(const FString& userId, int reply)
|
||||
{
|
||||
auto userid = StringCast<ANSICHAR>(*userId);
|
||||
UE_LOG(Discord, Log, TEXT("Responding %s to join request from %s"), 1, *userid)
|
||||
Discord_Respond((const char*)userid.Get(), 1);
|
||||
UE_LOG(Discord, Log, TEXT("Responding %s to join request from %s"), reply, *userId);
|
||||
FTCHARToUTF8 utf8_userid(*userId);
|
||||
Discord_Respond(utf8_userid.Get(), reply);
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@ DECLARE_LOG_CATEGORY_EXTERN(Discord, Log, All);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FDiscordConnected);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDiscordDisconnected, int, errorCode, const FString&, errorMessage);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDiscordErrored, int, errorCode, const FString&, errorMessage);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordRespond, const FString&, userId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordJoin, const FString&, joinSecret);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordSpectate, const FString&, spectateSecret);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordJoinRequest, const FDiscordJoinRequestData&, joinRequest);
|
||||
@@ -112,10 +111,10 @@ public:
|
||||
Category = "Discord")
|
||||
void ClearPresence();
|
||||
|
||||
UPROPERTY(BlueprintAssignable,
|
||||
UFUNCTION(BlueprintCallable,
|
||||
meta = (DisplayName = "Respond to join request", Keywords = "Discord rpc"),
|
||||
Category = "Discord")
|
||||
FDiscordRespond Respond;
|
||||
void Respond(const FString& userId, int reply);
|
||||
|
||||
UPROPERTY(BlueprintReadOnly,
|
||||
meta = (DisplayName = "Is Discord connected", Keywords = "Discord rpc"),
|
||||
|
Reference in New Issue
Block a user