Quantcast
Channel: Photon Server — Photon Engine
Viewing all articles
Browse latest Browse all 1557

Can Not Connect to server

$
0
0
I am new to photon and unity and i am following some1's tutorial on how to setup the photon cloud and to create a lobby.

The code work for him yet mine can not connect and i get the followin messages in the console:

SwitchToProtocol: Udp PhotonNetwork.connected: False
UnityEngine.Debug:Log(Object)
PhotonNetwork:SwitchToProtocol(ConnectionProtocol) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1170)
PhotonNetwork:ConnectUsingSettings(String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1217)
GameManagerScript:Connect() (at Assets/Scripts/GameManagerScript.cs:11)
GameManagerScript:OnGUI() (at Assets/Scripts/GameManagerScript.cs:49)

Operation failed: OperationResponse 225: ReturnCode: 32760 (No match found). Parameters: {}
UnityEngine.Debug:LogWarning(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1528)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157)

I have checked the code and settings a millions times, the setup of everything ive done and redone many times yet still nothing happens.

This is my code, help me out please...

using UnityEngine;
using System.Collections;

public class GameManagerScript : Photon.MonoBehaviour {

public GameObject[] SpawnRed;

public int state = 0;

void Connect() {
PhotonNetwork.ConnectUsingSettings ("v 1.0"); //connect to server

}

void OnJoinedLobby() {
state = 1;
}//end of loby joined


void OnPhotonRandomJoinFailed() {
//Debug.Log("Failed to connect");
PhotonNetwork.CreateRoom(null);

}

void OnJoinedRoom() {
state = 2;
}//end of joined room

// Use this for initialization
void Start () {

}//end of start

// Update is called once per frame
void Update () {

}//end of update

void OnGUI() {

switch (state)
{
case 0:
//starting screen
if (GUI.Button(new Rect(10, 10, 100, 30), "Connect"))
{
Connect();

}//end of if

break;

case 1:
//connect to server
GUI.Label(new Rect(10, 10, 100, 30), "Connected");

if (GUI.Button(new Rect(10, 10, 100, 30), "Search")) {
PhotonNetwork.JoinRandomRoom();
}//end of search if
break;
case 2:
//Champion select
GUI.Label(new Rect(10, 40, 200, 30), "Select Your CHampion");
if (GUI.Button(new Rect(70, 10, 100, 30), "Tim")) {
Spawn(0, "Tim");

}//end of time function

break;
case 3:
//In Game

break;


}//end switch stsate

}//end of onGUI

void Spawn(int team, string character) {
state = 3;
Debug.Log("You are on Team... " + team + "and are playing as " + character);
}//end of spawn function


}//end of program

Viewing all articles
Browse latest Browse all 1557

Trending Articles