mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
this works! command parsing for spawn and tts
This commit is contained in:
@@ -13,20 +13,38 @@ FTtsRequest UProtocolLibrary::DecodeTtsPayload(const FString& payload)
|
|||||||
if (input.Split(TEXT("|"), &Left, &input)) {
|
if (input.Split(TEXT("|"), &Left, &input)) {
|
||||||
username = Left;
|
username = Left;
|
||||||
|
|
||||||
if (input.Split(TEXT("|"), &Left, &Right)) {
|
if (input.Split(TEXT(" "), &Left, &Right)) {
|
||||||
voiceName = Left;
|
voiceName = Left;
|
||||||
text = Right;
|
text = Right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FTtsRequest request = FTtsRequest();
|
FTtsRequest request = FTtsRequest();
|
||||||
request.Username = username;
|
request.Username = username.TrimStartAndEnd();
|
||||||
request.VoiceName = voiceName;
|
request.VoiceName = voiceName.TrimStartAndEnd();
|
||||||
request.Text = text;
|
request.Text = text.TrimStartAndEnd();
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void UProtocolLibrary::DecodeTtsPayload()
|
FSpawnRequest UProtocolLibrary::DecodeSpawnPayload(const FString& payload)
|
||||||
{
|
{
|
||||||
}*/
|
FString input = payload;
|
||||||
|
|
||||||
|
FString username = TEXT("");
|
||||||
|
FString model = TEXT("");
|
||||||
|
|
||||||
|
FString Left, Right;
|
||||||
|
|
||||||
|
if (input.Split(TEXT("|"), &Left, &Right)) {
|
||||||
|
username = Left;
|
||||||
|
model = Right;
|
||||||
|
}
|
||||||
|
|
||||||
|
FSpawnRequest request = FSpawnRequest();
|
||||||
|
request.Username = username.TrimStartAndEnd();
|
||||||
|
request.Model = model.TrimStartAndEnd();
|
||||||
|
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,4 +18,8 @@ public:
|
|||||||
// Decode TTS instructions
|
// Decode TTS instructions
|
||||||
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
|
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
|
||||||
static FTtsRequest DecodeTtsPayload(const FString& payload);
|
static FTtsRequest DecodeTtsPayload(const FString& payload);
|
||||||
|
|
||||||
|
// Decode Spawn instructions
|
||||||
|
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
|
||||||
|
static FSpawnRequest DecodeSpawnPayload(const FString& payload);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
#include "ProtocolTypes.generated.h"
|
#include "ProtocolTypes.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Text to speech instructions.
|
||||||
|
*/
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
struct EVENTCENTERPLUGIN_API FTtsRequest {
|
struct EVENTCENTERPLUGIN_API FTtsRequest {
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
@@ -21,3 +24,18 @@ public:
|
|||||||
FString Text;
|
FString Text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spawn instructions
|
||||||
|
*/
|
||||||
|
USTRUCT(BlueprintType)
|
||||||
|
struct EVENTCENTERPLUGIN_API FSpawnRequest {
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString Username;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||||
|
FString Model;
|
||||||
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,18 @@ from aioredis.pubsub import Receiver
|
|||||||
from aioredis.abc import AbcChannel
|
from aioredis.abc import AbcChannel
|
||||||
|
|
||||||
CHANNELS = [
|
CHANNELS = [
|
||||||
|
# Text to speech
|
||||||
|
'tts',
|
||||||
|
'say',
|
||||||
'vocode',
|
'vocode',
|
||||||
|
|
||||||
|
# Object generation
|
||||||
'spawn',
|
'spawn',
|
||||||
|
|
||||||
|
# Teleport
|
||||||
|
'warp',
|
||||||
|
|
||||||
|
# Misc
|
||||||
'testing',
|
'testing',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user