Players not joining/creating rooms. WebGL, wss, PUN2
Options
Hello.
I'm quite fresh. Need help.
Players pass the connecting and stay in matchmaking state. Everything works fine in localhost.
PhotonServerSettings:
https://ibb.co/sypJMHg
I add WebSocket folder in Assets/Plugins.
Unity 2019.4.1f1 LTS
Please, help
I'm quite fresh. Need help.
Players pass the connecting and stay in matchmaking state. Everything works fine in localhost.
using UnityEngine; using Photon.Pun; using Photon.Realtime; using Hashtable = ExitGames.Client.Photon.Hashtable; using System.Collections.Generic; using ExitGames.Client.Photon; public class LobbyManager : MonoBehaviourPunCallbacks private ConnectionProtocol TransportProtocol; public void ConnectedPlay() { this.TransportProtocol = ConnectionProtocol.WebSocketSecure; if (!PhotonNetwork.IsConnected) PhotonNetwork.ConnectUsingSettings(); } public override void OnConnectedToMaster() { PhotonNetwork.AutomaticallySyncScene = true; FindMatch(); } public void FindMatch() { PhotonNetwork.JoinRandomRoom(); } public override void OnJoinRandomFailed(short returnCode, string message) { Debug.Log("creating room"); MakeRoom(); } void MakeRoom() { int randomRoomName = Random.Range(0, 5000); RoomOptions roomOptions = new RoomOptions() { IsVisible = true, IsOpen = true, MaxPlayers = 2 }; Hashtable RoomCustomProps = new Hashtable(); RoomCustomProps.Add("P1Health", 0); RoomCustomProps.Add("P2Health", 0); roomOptions.CustomRoomProperties = RoomCustomProps; PhotonNetwork.CreateRoom("RoomName_" + randomRoomName, roomOptions); Debug.Log("room created - waiting for player"); }
PhotonServerSettings:
https://ibb.co/sypJMHg
I add WebSocket folder in Assets/Plugins.
Unity 2019.4.1f1 LTS
Please, help
0
Comments
-
add.
When I play in Unity editor, console shows that room is created, when I play build uploaded to itch.io on the same PC I can join the room from Unity editor. But when I try to find a match on my other PC game stays in matchmaking loop even if I created room via Unity editor.0 -
Ok. I made it work... Mod can delete the post. xD
1 -
Please tell us the solution, really stuck here T-T
0