warp command

This commit is contained in:
Brandon Thomas
2021-03-12 21:00:51 -05:00
parent 73d31fc83f
commit c69a1a3ef5
3 changed files with 39 additions and 0 deletions
@@ -48,3 +48,23 @@ FSpawnRequest UProtocolLibrary::DecodeSpawnPayload(const FString& payload)
return request; return request;
} }
FWarpRequest UProtocolLibrary::DecodeWarpPayload(const FString& payload)
{
FString input = payload;
FString username = TEXT("");
FString level = TEXT("");
FString Left, Right;
if (input.Split(TEXT("|"), &Left, &Right)) {
username = Left;
level = Right;
}
FWarpRequest request = FWarpRequest();
request.Username = username.TrimStartAndEnd();
request.LevelName = level.TrimStartAndEnd();
return request;
}
@@ -25,4 +25,8 @@ public:
// Decode Spawn instructions // Decode Spawn instructions
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions") UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
static FSpawnRequest DecodeSpawnPayload(const FString& payload); static FSpawnRequest DecodeSpawnPayload(const FString& payload);
// Decode Warp instructions
UFUNCTION(BlueprintPure, Category = "EventCenterHelperFunctions")
static FWarpRequest DecodeWarpPayload(const FString& payload);
}; };
@@ -39,3 +39,18 @@ public:
FString Model; FString Model;
}; };
/**
* Warp instructions
*/
USTRUCT(BlueprintType)
struct EVENTCENTERPLUGIN_API FWarpRequest {
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
FString Username;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
FString LevelName;
};