Optimizing gameinstance

This commit is contained in:
martinluckyrobots
2025-04-09 15:18:16 +08:00
parent b3b61b6415
commit 17dc39a612
12 changed files with 76 additions and 4 deletions

View File

@ -5,6 +5,7 @@
#include "SocketIOClientComponent.h"
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
#include "Core/LuckyRobotsGameInstance.h"
#include "SIOJLibrary.h"
ALuckyRobotsGameState::ALuckyRobotsGameState()
{
@ -41,6 +42,7 @@ void ALuckyRobotsGameState::DoSocketOnGenericEvent(FString EventName, USIOJsonVa
{
if (ULuckyRobotsGameInstance* GameInstance = ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(this))
{
GameInstance->DoGetDispatch(EventName, EventData);
GameInstance->OnMessageDispatched.Broadcast(EventName);
GameInstance->GetMessageParse(USIOJLibrary::Conv_SIOJsonValueToString(EventData));
}
}