- Home /
Unity Photon Login help
So I was following tutorials from "http://www.youtube.com/user/cjrgaming" when I got stuck at his "Intro To Photon 3.0 - Creating our client" video http://www.youtube.com/watch?v=RRdjwKWprzE where whenever I click the "Connect" button in the "Login" Scene the status just stays at disconnected. I've looked over the video and started over from scratch more than 6six during the last 5days but still doesn't seem to work. I think the problem might be this line in the code I'll provide. Due to it having a green wavy line under it in Visual Studo
[code]PhotonPeer peer = new PhotonPeer(_photonServer, false);[/code]
Whole code
[code]using UnityEngine; using System.Collections; using System; using ExitGames.Client.Photon;
public class Login : MonoBehaviour { private PhotonServer _photonServer; private bool connected = false; // Use this for initialization void Start() { Application.runInBackground = true; _photonServer = new PhotonServer(); }
// Update is called once per frame
void Update()
{
try
{
if (connected)
{
_photonServer.Update();
}
}
catch (Exception e)
{
Debug.Log(e);
}
}
public void OnApplicationQuit()
{
try
{
_photonServer.Disconnect();
}
catch (Exception e)
{
Debug.Log(e);
}
}
public void OnGUI()
{
if (GUI.Button(new Rect(100, 60, 100, 30), "Connect"))
{
PhotonPeer peer = new PhotonPeer(_photonServer, false);
_photonServer.Initialize(peer, "local host:5055", "PhotonIntro");
connected = true;
}
GUI.Label(new Rect(100, 100, 200, 300), _photonServer.Status);
}
} [/code]
Answer by tobiass · Oct 11, 2012 at 08:20 AM
Your server address is wrong. "local host:5055" must be "localhost:5055". An error like this should log out some hint what went wrong to the console. If it doesn't, check your IPhotonPeerListener.DebugReturn() implementation. It should log.