PICO Unreal Platform SDK
Pico_Networking.h
1/*******************************************************************************
2Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
3
4NOTICE:All information contained herein is, and remains the property of
5PICO Technology Co., Ltd. The intellectual and technical concepts
6contained herein are proprietary to PICO Technology Co., Ltd. and may be
7covered by patents, patents in process, and are protected by trade secret or
8copyright law. Dissemination of this information or reproduction of this
9material is strictly forbidden unless prior written permission is obtained from
10PICO Technology Co., Ltd.
11*******************************************************************************/
12// This plugin incorporates portions of the Unreal® Engine. Unreal® is a trademark or registered trademark of Epic Games, Inc.In the United States of America and elsewhere.
13// Unreal® Engine, Copyright 1998 – 2022, Epic Games, Inc.All rights reserved.
14
15#pragma once
16
17#include "CoreMinimal.h"
18#include "UObject/NoExportTypes.h"
19#include "PPF_Platform.h"
20#include "OnlineSubsystemPico.h"
21#include "Pico_Networking.generated.h"
22
23
24DECLARE_LOG_CATEGORY_EXTERN(PicoNetworking, Log, All);
40class ONLINESUBSYSTEMPICO_API FPicoNetworkingInterface
41{
42private:
43
44 FOnlineSubsystemPico& PicoSubsystem;
45
46public:
47 FPicoNetworkingInterface(FOnlineSubsystemPico& InSubsystem);
49
50
51public:
52
62 bool SendPacket(const FString& UserId, TArray<uint8> BinaryArray);
63
76 bool SendPacket(const FString& UserId, TArray<uint8> BinaryArray, bool bReliable);
77
86 bool SendPacketToCurrentRoom(TArray<uint8> BinaryArray);
87
99 bool SendPacketToCurrentRoom(TArray<uint8> BinaryArray, bool bReliable);
100
110 bool ReadPacket(TArray<uint8>& OutBinaries, FString& OutSendId);
111
112};
113
129UCLASS()
130class ONLINESUBSYSTEMPICO_API UOnlinePicoNetworkingFunction : public UBlueprintFunctionLibrary
131{
132 GENERATED_BODY()
133
134public:
135
136
150 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
151 static bool SendPacket(UObject* WorldContextObject, const FString& UserId, TArray<uint8> BinaryArray, bool bReliable);
152
165 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
166 static bool SendPacketToCurrentRoom(UObject* WorldContextObject, TArray<uint8> BinaryArray, bool bReliable);
167
178 UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"), Category = "OnlinePico|Networking")
179 static bool ReadPacket(UObject* WorldContextObject, TArray<uint8>& OutBinaries, FString& SendUserID);
180
181};
182
PicoNetworkingInterface class.
Definition: Pico_Networking.h:41
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:131