diff --git a/TestForAIGC/Content/NewWidgetBlueprint.uasset b/TestForAIGC/Content/NewWidgetBlueprint.uasset deleted file mode 100644 index 190a41f..0000000 Binary files a/TestForAIGC/Content/NewWidgetBlueprint.uasset and /dev/null differ diff --git a/TestForAIGC/Content/q.uasset b/TestForAIGC/Content/q.uasset deleted file mode 100644 index 526ab22..0000000 Binary files a/TestForAIGC/Content/q.uasset and /dev/null differ diff --git a/TestForAIGC/Plugins/AIGC/Source/AIGC/Definations.cpp b/TestForAIGC/Plugins/AIGC/Source/AIGC/Definations.cpp index ffe7412..10e06c9 100644 --- a/TestForAIGC/Plugins/AIGC/Source/AIGC/Definations.cpp +++ b/TestForAIGC/Plugins/AIGC/Source/AIGC/Definations.cpp @@ -1,5 +1,6 @@ #include "Definations.h" -FString FNetCommand::CharacterList = TEXT("CharacterList"); +FString FNetCommand::RequestCharacterInfos = TEXT("RequestCharacterInfos"); +FString FNetCommand::RequestCharacterNames = TEXT("RequestCharacterNames"); FString FNetCommand::AddCharacter = TEXT("AddCharacter"); FString FNetCommand::AiChatGenerate = TEXT("AiChatGenerate"); \ No newline at end of file diff --git a/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/AIGCWindow.cpp b/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/AIGCWindow.cpp index 975a809..39e3510 100644 --- a/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/AIGCWindow.cpp +++ b/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/AIGCWindow.cpp @@ -122,12 +122,12 @@ EActiveTimerReturnType SAIGCWindow::OnPostPaint(double X, float Arg) } else { - WebSocketManager->SendData(FNetCommand::CharacterList, TEXT("")); + WebSocketManager->SendData(FNetCommand::RequestCharacterNames, TEXT("")); } WebSocketManager->OnConnectDelegate.AddLambda([this, WebSocketManager](bool bSuccess) { GenerateButton->SetEnabled(bSuccess); - WebSocketManager->SendData(FNetCommand::CharacterList, TEXT("")); + WebSocketManager->SendData(FNetCommand::RequestCharacterNames, TEXT("")); }); WebSocketManager->OnDataReceiveDelaget.AddRaw(this, &SAIGCWindow::HandleReceiveData); @@ -168,7 +168,7 @@ void SAIGCWindow::OnAIGenerateClicked() void SAIGCWindow::HandleReceiveData(FNetProtocol protocol) { - if (protocol.cmd == FNetCommand::CharacterList) + if (protocol.cmd == FNetCommand::RequestCharacterNames) { //解析json角色信息 diff --git a/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/CharacterWindow.cpp b/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/CharacterWindow.cpp index 32879c4..09d7de0 100644 --- a/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/CharacterWindow.cpp +++ b/TestForAIGC/Plugins/AIGC/Source/AIGC/Private/Widget/CharacterWindow.cpp @@ -128,12 +128,12 @@ EActiveTimerReturnType SCharacterWindow::OnPostPaint(double X, float Arg) } else { - WebSocketManager->SendData(FNetCommand::CharacterList, TEXT("")); + WebSocketManager->SendData(FNetCommand::RequestCharacterInfos, TEXT("")); } WebSocketManager->OnDataReceiveDelaget.AddRaw(this, &SCharacterWindow::HandleReceiveData); WebSocketManager->OnConnectDelegate.AddLambda([this, WebSocketManager](bool bSuccess) { - WebSocketManager->SendData(FNetCommand::CharacterList, TEXT("")); + WebSocketManager->SendData(FNetCommand::RequestCharacterInfos, TEXT("")); }); } return EActiveTimerReturnType::Stop; @@ -141,7 +141,7 @@ EActiveTimerReturnType SCharacterWindow::OnPostPaint(double X, float Arg) void SCharacterWindow::HandleReceiveData(FNetProtocol protocol) { - if (protocol.cmd == FNetCommand::CharacterList) + if (protocol.cmd == FNetCommand::RequestCharacterInfos) { //解析json角色信息 diff --git a/TestForAIGC/Plugins/AIGC/Source/AIGC/Public/Definations.h b/TestForAIGC/Plugins/AIGC/Source/AIGC/Public/Definations.h index 1b54054..12a7e90 100644 --- a/TestForAIGC/Plugins/AIGC/Source/AIGC/Public/Definations.h +++ b/TestForAIGC/Plugins/AIGC/Source/AIGC/Public/Definations.h @@ -85,7 +85,8 @@ USTRUCT() struct FNetCommand { GENERATED_BODY() - static FString CharacterList; + static FString RequestCharacterInfos; + static FString RequestCharacterNames; static FString AddCharacter; static FString AiChatGenerate; };