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 "Kismet/BlueprintFunctionLibrary.h"
10#include "Pico_Networking.generated.h"
11
12
13DECLARE_LOG_CATEGORY_EXTERN(PicoNetworking, Log, All);
29class ONLINESUBSYSTEMPICO_API FPicoNetworkingInterface
30{
31private:
32
33 FOnlineSubsystemPico& PicoSubsystem;
34
35public:
36 FPicoNetworkingInterface(FOnlineSubsystemPico& InSubsystem);
38
39
40public:
41
51 bool SendPacket(const FString& UserId, TArray<uint8> BinaryArray);
52
65 bool SendPacket(const FString& UserId, TArray<uint8> BinaryArray, bool bReliable);
66
75 bool SendPacketToCurrentRoom(TArray<uint8> BinaryArray);
76
88 bool SendPacketToCurrentRoom(TArray<uint8> BinaryArray, bool bReliable);
89
99 bool ReadPacket(TArray<uint8>& OutBinaries, FString& OutSendId);
100
101};
102
118UCLASS()
119class ONLINESUBSYSTEMPICO_API UOnlinePicoNetworkingFunction : public UBlueprintFunctionLibrary
120{
121 GENERATED_BODY()
122
123public:
124
125
139 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
140 static bool SendPacket(UObject* WorldContextObject, const FString& UserId, TArray<uint8> BinaryArray, bool bReliable);
141
154 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
155 static bool SendPacketToCurrentRoom(UObject* WorldContextObject, TArray<uint8> BinaryArray, bool bReliable);
156
167 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
168 static bool ReadPacket(UObject* WorldContextObject, TArray<uint8>& OutBinaries, FString& SendUserID);
169
170};
171
PicoNetworkingInterface class.
Definition: Pico_Networking.h:30
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:120