Class PhotonPeer. Can't connect.
Options
I'm developing my own server, But can't connect to it from Unity, I am sure that the problem in client side script. It's says me "Connecting" and nothing changed.
using UnityEngine; using System.Collections; using ExitGames.Client.Photon; public class Con1 : MonoBehaviour, IPhotonPeerListener { public PhotonPeer photonPeer; void Start() { photonPeer = new PhotonPeer(this, ConnectionProtocol.Udp); photonPeer.Connect("localhost:5055", "SNOSGamesMmo"); } void OnApplicationQuit() { photonPeer.Disconnect(); } void Update() { Debug.Log(photonPeer.PeerState.ToString()); } public void DebugReturn(DebugLevel level, string message) { } public void OnEvent(EventData eventData) { } public void OnOperationResponse(OperationResponse operationResponse) { } public void OnStatusChanged(StatusCode statusCode) { } }
0
Comments
-
It looks like you do not call Service method. you should call it regularly in order to handle incomming and outgoing messages0
-
it is turned out that you do not have to call Service if you use PUN. it is done automaticly0
-
I understand. Now I have another question, how often to call the Service(), after all Update() is not the best place for it0
-
You should not call it at all, because it is done by framework (by PUN)0