Offline mode creating room fails

Options
gshape
gshape ✭✭
Hello,

My game has 2 game modes - "Online Coop" and "Offline single player".

While doing testing, I found a weird problem and hope somebody can help. :)

Test case that caused error:
1. Play "Offline single player" mode (which set PhotonNetwork.offlineMode = true) and created a room
2. Leave this mode (which disconnects from Photon if there is any connection)
3. Play "Online Coop" mode (which connected with Photon, then create a new room)
4. Leave this mode (which disconnects from Photon if there is any connection)
5. Play "Offline single player" mode (which set PhotonNetwork.offlineMode = true) and created a room. Then problem occurs!
I got an error "Cannot send op: 252 Not connected. PeerState: Disconnected". However, room is still created and game still moving on!
I have already set PhotonNetwork.offlineMode = true before creating a new room. Any idea please?

Below is the error logged:
Cannot send op: 252 Not connected. PeerState: Disconnected
UnityEngine.Debug:LogError(Object)
PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:170)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:802)
ExitGames.Client.Photon.EnetPeer:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean, EgMessageType)
ExitGames.Client.Photon.PeerBase:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean)
ExitGames.Client.Photon.PhotonPeer:OpCustom(Byte, Dictionary`2, Boolean, Byte)
LoadbalancingPeer:OpSetPropertiesOfRoom(Hashtable, Boolean, Byte) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:269)
LoadbalancingPeer:OpSetCustomPropertiesOfRoom(Hashtable, Boolean, Byte) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:252)
Room:SetCustomProperties(Hashtable) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/Room.cs:220)
PhotonHandler:SetSceneInProps() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:134)
PhotonHandler:OnCreatedRoom() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:124)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1616)
PhotonNetwork:CreateRoom(String, Boolean, Boolean, Int32, Hashtable, String[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1161)
PhotonNetwork:CreateRoom(String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1108)
ControllerMainMenu:StartMission() (at Assets/Scripts/Controllers/ControllerMainMenu.cs:546)
EventDelegate:Execute() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:225)
EventDelegate:Execute(List`1) (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:292)
UIButton:OnClick() (at Assets/NGUI/Scripts/Interaction/UIButton.cs:120)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:764)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1423)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1054)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1124)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:907)


Many thanks for your help!

Cheers,
gshape

Comments

  • Tobias
    Options
    Sorry for the late reply.
    I updated PUN to v1.25 and hopefully this issue is gone with that update.
    If not, can you send me some reproduction case to check it in detail?
  • Qrion
    Options
    Have the same issue in version 1.25.3. Was this resolved?
  • Tobias
    Options
    Obviously not.
    In the end, I didn't want to change the offline mode too much, because I couldn't do a full refactoring (time-wise).

    Let me know your reproduction steps and I will take a look.
  • Ernie
    Options
    Sorry, but was this ever fixed? I have the same issue. If user goes from offlinemode, to online, and then back to offline, it doesnt seem to clear him from the room. I get the error message:
    CreateRoom failed. In offline mode you still have to leave a room to enter another.
  • Tobias
    Options
    Which version of PUN do you use?
    When you disconnect or leave, you clear the current room. This is for online and offlinemode.
    The error explains it: You need to leave a room before you can create/join another. Even in offline mode (it should be very similar to being online).

    Clear him from which room?