BUG? OnPhotonCreateRoomFailed not called.

carmine
carmine ✭✭
If I'm in a room and call createroom... (yes I know you can't do this) but what is happening is, it's not calling "OnPhotonCreateRoomFailed" it's just Debug.LogError.

You can duplicate this by calling LeaveRoom then right after calling CreateRoom (I think there is a slight delay when leaving a room).

Additionally, by doing Debug.Log (instead of raising an error.) I don't think I can catch this with a try/catch.

Line 1150 of PhotonNetwork.cs
public static void CreateRoom(string roomName, bool isVisible, bool isOpen, int maxPlayers, Hashtable customRoomProperties, string[] propsToListInLobby)
{
if (connectionStateDetailed == PeerState.Joining || connectionStateDetailed == PeerState.Joined || connectionStateDetailed == PeerState.ConnectedToGameserver)
{
Debug.LogError("CreateRoom aborted: You can only create a room while not currently connected/connecting to a room.");

Comments

  • I hope it return false.
    If so, you could check if CreateRoom fails right away or returns true.
  • Tobias wrote:
    I hope it return false.
    If so, you could check if CreateRoom fails right away or returns true.

    Nope... it's a "void" function.... no return value :(
  • Dang.
    Ok, then you're lost. I didn't expose the return values because Unity's Networking does neither but then again: It does several things differently, too.
    Do you think we need this out of principle or do you need it desperately? I would say: "By convention, it's disallowed in this situation" is ok for me.
  • I worked around it...can a future PUN call "OnPhotonCreateRoomFailed" instead of just Debug.Log?
  • Yes, should be possible. Good idea.