PICO Unreal Platform SDK
Pico_Networking.h
1// Copyright® 2015-2023 PICO Technology Co., Ltd. All rights reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UObject/NoExportTypes.h"
7#include "PPF_Platform.h"
8#include "OnlineSubsystemPico.h"
9#include "Pico_Networking.generated.h"
10
11
12DECLARE_LOG_CATEGORY_EXTERN(PicoNetworking, Log, All);
28class ONLINESUBSYSTEMPICO_API FPicoNetworkingInterface
29{
30private:
31
32 FOnlineSubsystemPico& PicoSubsystem;
33
34public:
35 FPicoNetworkingInterface(FOnlineSubsystemPico& InSubsystem);
37
38
39public:
40
50 bool SendPacket(const FString& UserId, TArray<uint8> BinaryArray);
51
64 bool SendPacket(const FString& UserId, TArray<uint8> BinaryArray, bool bReliable);
65
74 bool SendPacketToCurrentRoom(TArray<uint8> BinaryArray);
75
87 bool SendPacketToCurrentRoom(TArray<uint8> BinaryArray, bool bReliable);
88
98 bool ReadPacket(TArray<uint8>& OutBinaries, FString& OutSendId);
99
100};
101
117UCLASS()
118class ONLINESUBSYSTEMPICO_API UOnlinePicoNetworkingFunction : public UBlueprintFunctionLibrary
119{
120 GENERATED_BODY()
121
122public:
123
124
138 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
139 static bool SendPacket(UObject* WorldContextObject, const FString& UserId, TArray<uint8> BinaryArray, bool bReliable);
140
153 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
154 static bool SendPacketToCurrentRoom(UObject* WorldContextObject, TArray<uint8> BinaryArray, bool bReliable);
155
166 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
167 static bool ReadPacket(UObject* WorldContextObject, TArray<uint8>& OutBinaries, FString& SendUserID);
168
169};
170
PicoNetworkingInterface class.
Definition: Pico_Networking.h:29
bool SendPacketToCurrentRoom(TArray< uint8 > BinaryArray, bool bReliable)
Sends messages to other users in the room. The maximum messaging frequency is 1000/s.
bool SendPacketToCurrentRoom(TArray< uint8 > BinaryArray)
Sends messages to other users in the room. The maximum messaging frequency is 1000/s.
bool ReadPacket(TArray< uint8 > &OutBinaries, FString &OutSendId)
Reads the messages from other users in the room.
bool SendPacket(const FString &UserId, TArray< uint8 > BinaryArray)
Sends messages to a specified user. The maximum messaging frequency is 1000/s.
bool SendPacket(const FString &UserId, TArray< uint8 > BinaryArray, bool bReliable)
Sends messages to a specified user. The maximum messaging frequency is 1000/s.
OnlinePicoNetworking Blueprint Function class.
Definition: Pico_Networking.h:119