LEAP Documentation 40220
Documentation for the LEAP project
BroadcastMessage.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "GameFramework/LocalMessage.h"
7#include "ProjectX.h"
8#include "BroadcastMessage.generated.h"
9
11
15UCLASS(Blueprintable)
16class PROJECTX_API UBroadcastMessage : public ULocalMessage
17{
18 GENERATED_UCLASS_BODY()
19
20//~ Begin ULocaLMessage Interface
21public:
22 virtual void ClientReceive(const FClientReceiveData& ClientData) const override;
23//~ End ULocalMessage Interface
24
25protected:
26 //NOTE: This object has no world context. Do not GetWorld() directly - instead call GetWorld() on a valid UObject that was passed.
27 UFUNCTION()
28 virtual void ReceiveMessage(AProjectXPlayerController* PlayerController, int32 Data, APlayerState* PlayerStateA, APlayerState* PlayerStateB, UObject* Object) const;
29
30 UFUNCTION(BlueprintImplementableEvent, Category = LocalMessage, meta = (DisplayName = "Receive Message", ScriptName = "ReceiveMessage"))
31 void K2_ReceiveMessage(AProjectXPlayerController* PlayerController, int32 Data, APlayerState* PlayerStateA, APlayerState* PlayerStateB, UObject* Object) const;
32
33public:
34 //Sends a local message to all connected clients. To send a message to a specific client, use SendServerMessage.
35 UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = LocalMessage, meta = (WorldContext = "WorldContextObject", CallableWithoutWorldContext))
36 static void BroadcastServerMessage(const UObject* WorldContextObject, TSubclassOf<class ULocalMessage> Message, const int32 Data, APlayerState* PlayerStateA, APlayerState* PlayerStateB, UObject* Object);
37 //Alternate version of BroadcastServerMessage. Used to send specific clients messages rather than sending one to all connected clients.
38 UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = LocalMessage, meta = (WorldContext = "WorldContextObject", CallableWithoutWorldContext))
39 static void SendServerMessage(APlayerController* PlayerController, TSubclassOf<class ULocalMessage> Message, const int32 Data, APlayerState* PlayerStateA, APlayerState* PlayerStateB, UObject* Object);
40};
Definition: ProjectXPlayerController.h:83
Definition: BroadcastMessage.h:17