Documentation for the Unreal C++ Library
Loading...
Searching...
No Matches
PVROFindServerTask.h
Go to the documentation of this file.
1// Copyright(c) 2023 PixoVR, LLC. All Rights Reserved.
2
3#pragma once
4
6#include "OnlineJsonSerializer.h"
7
9{
10 uint32 ModuleID;
11 uint32 OrgID;
13 FString ClientID;
14
15 BEGIN_ONLINE_JSON_SERIALIZER
20 END_ONLINE_JSON_SERIALIZER
21};
22
24{
25 FString IPAddress;
26 FString Port;
27 FString SessionID;
28 FString MapName;
30
31 BEGIN_ONLINE_JSON_SERIALIZER
37 END_ONLINE_JSON_SERIALIZER
38};
39
41{
42 FString Reply;
43 TArray<FPVROMPSessionInfo> CurrentSessions;
44
45 BEGIN_ONLINE_JSON_SERIALIZER
48 END_ONLINE_JSON_SERIALIZER
49};
50
58
60{
61protected:
62
63 FOnAsyncFindServersComplete FindServersCompleteDelegates;
64
65 void RequestSessions();
66 void OnRequestSessionResponseReceived(FHttpRequestPtr HTTPRequest, FHttpResponsePtr HTTPResponse, bool InWasSuccessful);
67
68public:
69
70 FPVROFindServerTask(class FPVROSubsystem* InSubsystem, const TSharedPtr<class FOnlineSessionSearch>& InSearchSettings, FOnAsyncFindServersComplete& InDelegates)
71 : FPVROFindServerTaskBase(InSubsystem, InSearchSettings)
72 , FindServersCompleteDelegates(InDelegates)
78 , Counter(0)
80 , PingInMs(0)
81 {
82 }
83
84 virtual FString ToString() const override;
85 virtual void Initialize() override;
86 virtual void Finalize() override;
87 virtual void Tick() override;
88 virtual void TriggerDelegates() override;
89 void GetHostAndPort(int32& Host, int32& Port, const FString& HostIP, const FString& HostPort);
98 uint32 PingInMs;
99};
EPVRORequestSessionsReply
virtual FString ToString() const override
virtual void Finalize() override
EPVRORequestSessionsReply bFoundSessions
FOnAsyncFindServersComplete FindServersCompleteDelegates
void OnRequestSessionResponseReceived(FHttpRequestPtr HTTPRequest, FHttpResponsePtr HTTPResponse, bool InWasSuccessful)
FPVROMPRequestServerInfo ServerInfos
virtual void Initialize() override
virtual void Tick() override
void GetHostAndPort(int32 &Host, int32 &Port, const FString &HostIP, const FString &HostPort)
FPVROFindServerTask(class FPVROSubsystem *InSubsystem, const TSharedPtr< class FOnlineSessionSearch > &InSearchSettings, FOnAsyncFindServersComplete &InDelegates)
virtual void TriggerDelegates() override
TArray< FPVROMPSessionInfo > CurrentSessions
BEGIN_ONLINE_JSON_SERIALIZER ONLINE_JSON_SERIALIZE("Reply", Reply)
ONLINE_JSON_SERIALIZE_ARRAY_SERIALIZABLE("CurrentSessions", CurrentSessions, FPVROMPSessionInfo)
ONLINE_JSON_SERIALIZE("MapName", MapName)
BEGIN_ONLINE_JSON_SERIALIZER ONLINE_JSON_SERIALIZE("IPAddress", IPAddress)
ONLINE_JSON_SERIALIZE("Port", Port)
ONLINE_JSON_SERIALIZE("SessionID", SessionID)
ONLINE_JSON_SERIALIZE("OwningUserName", OwningUserName)
BEGIN_ONLINE_JSON_SERIALIZER ONLINE_JSON_SERIALIZE("ModuleID", ModuleID)
ONLINE_JSON_SERIALIZE("ModuleVersion", ModuleVersion)
ONLINE_JSON_SERIALIZE("OrgID", OrgID)
ONLINE_JSON_SERIALIZE("ClientID", ClientID)