Documentation for the Unreal C++ Library
Loading...
Searching...
No Matches
PVROMultiplayerSessionInfo.h
Go to the documentation of this file.
1// Copyright(c) 2023 PixoVR, LLC. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "OnlineSubsystemTypes.h"
7#include "IPAddress.h"
8#include "PVROPackage.h"
9
10class FPVROSubsystem;
11
12#ifndef PVR_MP_SUBSYSTEM
13#define PVR_MP_SUBSYSTEM FName(TEXT("PIXOVR"))
14#endif
15
16// from OnlineSubsystemTypes.h
18
19#if ENGINE_MAJOR_VERSION < 5
20typedef TSharedPtr<const FUniqueNetId> FUniqueNetIdPtr;
21typedef TSharedPtr<const FUniqueNetIdPixoVR> FUniqueNetIdPixoVRPtr;
22#endif
23
24#ifndef PVRO_SUCCESS
25#define PVRO_SUCCESS 0
26#endif
27
28#ifndef PVRO_FAIL
29#define PVRO_FAIL (uint32)-1
30#endif
31
32#ifndef PVRO_IO_PENDING
33#define PVRO_IO_PENDING 997
34#endif
35
40{
41protected:
42
43#if ENGINE_MAJOR_VERSION == 4
46 {
47 }
48
50 FPVROSessionInfo& operator=(const FPVROSessionInfo& Src)
51 {
52 return *this;
53 }
54#endif
55
57
60
65 void Init(const FPVROSubsystem& Subsystem);
66
68 TSharedPtr<class FInternetAddr> HostAddr;
70 FUniqueNetIdPixoVR SessionId;
71
72public:
73
74 virtual ~FPVROSessionInfo() {}
75
76 bool operator==(const FPVROSessionInfo& Other) const
77 {
78 return false;
79 }
80
81 virtual const uint8* GetBytes() const override
82 {
83 return nullptr;
84 }
85
86 virtual int32 GetSize() const override
87 {
88 return sizeof(uint64) + sizeof(TSharedPtr<class FInternetAddr>);
89 }
90
91 virtual bool IsValid() const override
92 {
93 // LAN case
94 return HostAddr.IsValid() && HostAddr->IsValid();
95 }
96
97 virtual FString ToString() const override
98 {
99 return SessionId.ToString();
100 }
101
102 virtual FString ToDebugString() const override
103 {
104 return FString::Printf(TEXT("HostIP: %s SessionId: %s"),
105 HostAddr.IsValid() ? *HostAddr->ToString(true) : TEXT("INVALID"),
106 *SessionId.ToDebugString());
107 }
108
109 virtual const FUniqueNetId& GetSessionId() const override
110 {
111 return SessionId;
112 }
113};
TEMP_UNIQUENETIDSTRING_SUBCLASS(FUniqueNetIdPixoVR, FName(TEXT("PIXOVR")))
TSharedPtr< const FUniqueNetId > FUniqueNetIdPtr
#define PVR_MP_SUBSYSTEM
TSharedPtr< const FUniqueNetIdPixoVR > FUniqueNetIdPixoVRPtr
#define PACKAGE_SCOPE
Definition PVROPackage.h:12
virtual const uint8 * GetBytes() const override
virtual int32 GetSize() const override
virtual FString ToDebugString() const override
bool operator==(const FPVROSessionInfo &Other) const
virtual FString ToString() const override
virtual const FUniqueNetId & GetSessionId() const override
TSharedPtr< class FInternetAddr > HostAddr
virtual bool IsValid() const override
FUniqueNetIdPixoVR SessionId
void Init(const FPVROSubsystem &Subsystem)