Can Not Connect to server

Options
Kraziion
Kraziion
edited December 2016 in Photon Server
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

Comments

  • chvetsov
    Options
    you are connected to server and it returns you "No match found". this means that you tried to join randomly and server failed to find a game. and this is logical, because you probably did not create one
  • Kraziion
    Options
    When i first click the connect button i get the connection is FALSE, yet it jump into the next state where i can press button SEARCH, the next error comes when i press that button where is says is can not join room. If there is no existing room then the OnJoinFailed function is supposed to create a room.
  • chvetsov
    Options
    so, it looks like it connects, but you failed to create game, right?

    please, check server logs