mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
warp command
This commit is contained in:
@@ -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;
|
||||||
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user