OnPhotonCreateRoomFailed problem

Options
Hi, All! If i try to create room with same name twice, i'm waiting that OnPhotonCreateRoomFailed event to raise (as it is written in the documents), but nothing happened. Why?

Thanks!

Comments

  • vadim
    Options
    Does OnCreatedRoom method work for you when 1st client creates the room? What is in log when 2nd client tries to create the room?
    Do you handle messages proper way:
    public class MyClass: MonoBehaviour
    {
    public void OnPhotonJoinRoomFailed(object[] cause)
    {...}
    }
  • exp
    Options
    OnCreatedRoom work perfect. And i need to handle OnPhotonCreateRoomFailed(object[] cause) not OnPhotonJoinRoomFailed(object[] cause). I do not try 2nd client, im just try study Photon Cloud logic and event system first.
  • exp
    exp
    edited December 2015
    Options
    And one more... If i try create room and create another room with other name at the same time, i'm get error message in console, but event OnPhotonCreateRoomFailed still does not occur. That's my script:
    public class PhotonService : Photon.MonoBehaviour { System.Action onSuccesConnected; System.Action<DisconnectCause> onFailedConnected; System.Action onRoomCreated; System.Action<System.Object[]> onRoomCreateFailed; public void connect(System.Action succes_action, System.Action<DisconnectCause> failed_action) { if (!PhotonNetwork.connected) { PhotonNetwork.ConnectUsingSettings("1.0"); onSuccesConnected = succes_action; onFailedConnected = failed_action; } } public void createRoom(string name, RoomOptions roomOptions, TypedLobby typedLobby, System.Action succes_action, System.Action<System.Object[]> failed_action) { if (PhotonNetwork.connected) { bool res = PhotonNetwork.CreateRoom(name, roomOptions, typedLobby); onRoomCreated = succes_action; onRoomCreateFailed = failed_action; if (!res) { //THIS CODE WAS WRITEN TO AVOID MY PROBLEM with OnPhotonCreateRoomFailed System.Object[] f = new System.Object[2]; f[0] = 1; f[1] = "The room named '" + name + "' already exists"; onRoomCreateFailed(f); } } } //raised public void OnFailedToConnectToPhoton(DisconnectCause cause) { onFailedConnected(cause); } //raised public void OnConnectedToPhoton() { onSuccesConnected(); } //raised public void OnCreatedRoom() { onRoomCreated(); } //NOT RAISED when i try to create room with same name or create room with another name in same time/ I'm get error message in console, but OnPhotonCreateRoomFailed does not occure. public void OnPhotonCreateRoomFailed(object[] codeAndText) { onRoomCreateFailed(codeAndText); } public bool checkConnection() { return PhotonNetwork.connected; } }
  • vadim
    Options
    OnPhotonCreateRoomFailed usage is the same as for OnPhotonJoinRoomFailed.
    You cant't get room creation error with single client. First client should be in the room to keep it running and hold the name.
    What is the error in log when you create 2nd room with other name?
    Please log client state with PhotonNetwork.connectionStateDetailed after each operation to get an idea what happens.
  • exp
    Options
    Sorry, I figured out when i looked at the source code. Check the name of the room and the number of rooms in your own code is still relevant. I could be wrong, but I think that if there is an event OnPhotonCreateRoomFailed - it must react to such things :smiley: