mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-25 01:14:20 +00:00
Ban/Kick Player
Adds BP nodes to the library to kick / ban player Since built in game sessions does not actually implement ban player, I also provide a very basic naive implementation with a custom game session that bans for the duration of the session. A real implementation would save out the net id and also perform the check in the game mode before spooling up a player for login.
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "GameFramework/GameSession.h"
|
||||
|
||||
//#include "UObjectIterator.h"
|
||||
|
||||
#include "AdvancedSessionsLibrary.generated.h"
|
||||
@@ -28,6 +31,17 @@ class UAdvancedSessionsLibrary : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
//********* Session Admin Functions *************//
|
||||
|
||||
// Kick a player from the currently active game session, only available on the server
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions", meta = (WorldContext = "WorldContextObject"))
|
||||
static bool KickPlayer(UObject* WorldContextObject, APlayerController* PlayerToKick, FText KickReason);
|
||||
|
||||
// Ban a player from the currently active game session, only available on the server
|
||||
// Note that the default gamesession class does not implement an actual ban list and just kicks when this is called
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions", meta = (WorldContext = "WorldContextObject"))
|
||||
static bool BanPlayer(UObject* WorldContextObject, APlayerController* PlayerToBan, FText BanReason);
|
||||
|
||||
//********* Session Search Functions *************//
|
||||
|
||||
// Adds or modifies session settings in an existing array depending on if they exist already or not
|
||||
|
||||
Reference in New Issue
Block a user