This repository has been archived by the owner on May 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mod event listener and updated plugin filters
- Loading branch information
Showing
42 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ | |
; /README.txt | ||
; /Extras/... | ||
; /Binaries/ThirdParty/*.dll | ||
/Img/... | ||
/Resources/... | ||
/README.md |
Binary file modified
BIN
+3 KB
(100%)
Source/ThirdParty/mod.io-sdk-v0.11.3-DEV/bin/visualc++/x64/modio.dll
Binary file not shown.
49 changes: 49 additions & 0 deletions
49
Source/modio/Private/BlueprintCallbackProxies/CallbackProxy_SetModEventListener.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2019 modio. All Rights Reserved. | ||
// Released under MIT. | ||
|
||
#include "BlueprintCallbackProxies/CallbackProxy_SetModEventListener.h" | ||
#include "ModioUE4Utility.h" | ||
#include "ModioSubsystem.h" | ||
#include "Engine/Engine.h" | ||
|
||
UCallbackProxy_SetModEventListener::UCallbackProxy_SetModEventListener(const FObjectInitializer &ObjectInitializer) | ||
: Super(ObjectInitializer) | ||
{ | ||
} | ||
|
||
UCallbackProxy_SetModEventListener *UCallbackProxy_SetModEventListener::SetModEventListener(UObject *WorldContext) | ||
{ | ||
UCallbackProxy_SetModEventListener *Proxy = NewObject<UCallbackProxy_SetModEventListener>(); | ||
Proxy->SetFlags(RF_StrongRefOnFrame); | ||
Proxy->WorldContextObject = WorldContext; | ||
return Proxy; | ||
} | ||
|
||
void UCallbackProxy_SetModEventListener::Activate() | ||
{ | ||
UWorld* World = GEngine->GetWorldFromContextObject( WorldContextObject, EGetWorldErrorMode::LogAndReturnNull ); | ||
FModioSubsystemPtr Modio = FModioSubsystem::Get( World ); | ||
if( Modio.IsValid() ) | ||
{ | ||
Modio->SetModEventListener( FModioModEventArrayDelegate::CreateUObject( this, &UCallbackProxy_SetModEventListener::OnModEventDelegate ) ); | ||
} | ||
else | ||
{ | ||
// @todonow: Make something more pretty than this | ||
FModioResponse Response; | ||
TArray<FModioModEvent> ModEvents; | ||
OnFailure.Broadcast( Response, ModEvents ); | ||
} | ||
} | ||
|
||
void UCallbackProxy_SetModEventListener::OnModEventDelegate(FModioResponse Response, const TArray<FModioModEvent> &ModEvents) | ||
{ | ||
if (Response.Code >= 200 && Response.Code < 300) | ||
{ | ||
OnSuccess.Broadcast(Response, ModEvents); | ||
} | ||
else | ||
{ | ||
OnFailure.Broadcast(Response, ModEvents); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Source/modio/Public/BlueprintCallbackProxies/CallbackProxy_SetModEventListener.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2019 modio. All Rights Reserved. | ||
// Released under MIT. | ||
|
||
#pragma once | ||
|
||
#include "Schemas/ModioModEvent.h" | ||
#include "ModioSubsystem.h" | ||
#include "Net/OnlineBlueprintCallProxyBase.h" | ||
#include "CallbackProxy_SetModEventListener.generated.h" | ||
|
||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( | ||
FOnModEventResult, | ||
FModioResponse, | ||
Response, | ||
const TArray<FModioModEvent> &, | ||
ModEvents); | ||
|
||
UCLASS() | ||
class MODIO_API UCallbackProxy_SetModEventListener : public UOnlineBlueprintCallProxyBase | ||
{ | ||
GENERATED_UCLASS_BODY() | ||
|
||
// The world context object in which this call is taking place | ||
UPROPERTY() | ||
UObject* WorldContextObject; | ||
|
||
UPROPERTY(BlueprintAssignable) | ||
FOnModEventResult OnSuccess; | ||
|
||
UPROPERTY(BlueprintAssignable) | ||
FOnModEventResult OnFailure; | ||
|
||
UFUNCTION(BlueprintCallable, Category = "mod.io", meta = (BlueprintInternalUseOnly = "true", DefaultToSelf="WorldContext")) | ||
static UCallbackProxy_SetModEventListener *SetModEventListener(UObject *WorldContext); | ||
|
||
virtual void Activate() override; | ||
|
||
virtual void OnModEventDelegate(FModioResponse Response, const TArray<FModioModEvent> &ModEvents); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.