Unity Editor version 2022 or later.
Install Netick 2 before installing this package. https://github.com/NetickNetworking/NetickForUnity
Multiple protocols listen port logic
firstProtocol = 7777;
secondProtocol = 7777 + 1;
thirdProtocol = 7777 + 2;
Example:
- UDP Starts on 7777
- WebSocket Starts on 7778
- RelayUDP Starts on 7779
RELAY_SDK_INSTALLED
to scripting define symbols, and ensure Relay SDK has been installedCreateAllocation
and GetJoinCode
for Host and supply to the Allocation
variable. JoinAllocationAsync
and supply it to the public variable.NetworkConnectionRequest
Data (byte[]
) is fixed size (of 200).
This decision is made to avoid GC at runtime. You may need to use request.DataLength
or resize the Array by your own to use it accurately.
public override void OnConnectRequest(NetworkSandbox sandbox, NetworkConnectionRequest request)
{
}