Optimize gamemode and gamestate code

This commit is contained in:
martinluckyrobots
2025-04-01 11:04:11 +08:00
parent c35cf74b49
commit 8e1c017515
18 changed files with 234 additions and 18 deletions

View File

@ -6,6 +6,8 @@
#include "GameFramework/GameStateBase.h"
#include "LuckyRobotsGameState.generated.h"
class USocketIOClientComponent;
class USIOJsonValue;
/**
*
*/
@ -13,5 +15,21 @@ UCLASS()
class LUCKYROBOTS_API ALuckyRobotsGameState : public AGameStateBase
{
GENERATED_BODY()
protected:
ALuckyRobotsGameState();
virtual void BeginPlay() override;
public:
UPROPERTY(Category = Character, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
USocketIOClientComponent* SocketIOClientComponent;
public:
UFUNCTION(BlueprintCallable)
void DoSendMessage(FString SendValue);
UFUNCTION(BlueprintCallable)
void DoSocketOnConnect(FString SocketId, FString SessionId, bool IsReconnection);
UFUNCTION(BlueprintCallable)
void DoSocketOnGenericEvent(FString EventName, USIOJsonValue* EventData);
};