So I’ve been working on a multiplayer game and I wanted to publish it to itch.io for people with Chromebooks to play as well (And any other systems) so I did some research and found out that you need to set the encryption type or connection type to “wss” but I am not using that version of the packages. I have:
- Unity Transport 2.6.0
- Netcode for GameObjects 2.7.0
- Unity Editor 6.2
I was using this initially to get clients and hosts connected:
// Host:
Allocation allocation = await RelayService.Instance.CreateAllocationAsync(3);
string joinCode = await RelayService.Instance.GetJoinCodeAsync(allocation.AllocationId);
NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(
allocation.RelayServer.IpV4,
(ushort)allocation.RelayServer.Port,
allocation.AllocationIdBytes,
allocation.Key,
allocation.ConnectionData,
allocation.ConnectionData,
true
);
joinCodeText.text = "Start " + joinCode;
NetworkManager.Singleton.StartHost();
// Client:
JoinAllocation joinAllocation = await RelayService.Instance.JoinAllocationAsync(joinCode);
NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(
joinAllocation.RelayServer.IpV4,
(ushort)joinAllocation.RelayServer.Port,
joinAllocation.AllocationIdBytes,
joinAllocation.Key,
joinAllocation.ConnectionData,
joinAllocation.HostConnectionData,
true
);
NetworkManager.Singleton.StartClient();
And I’ve seen many places telling me to use something like SetRelayServerData(Allocation, connectionType) but when I try to do so, I get an error that “No overload method takes those arguments”
I’ve also tried to downgrade Unity Trasnsport to a version that uses that method but I couldn’t find a way to do so? I also DID set Use Web Sockets and Use Encryption to True (Checked) in the Inspector.
If anyone can help me with this, I’d greatly appreciate it! Thanks in advance.