OfflineRoom

Options
Hi,

I am currently trying to implement singleplayer with offlinemode.

The documentation here http://doc.exitgames.com/en/pun/current ... d-un#ompun
states that a "PhotonNetwork.room will, obviously, return null."

But when I get the room in offlinemode it looks like this:
Room: 'OfflineRoom' visible: True open: True max: 0 count: 0
customProps: {} 0

Is this intentional and the documentation is wrong?

Comments

  • Tobias
    Options
    This is obviously wrong. By now.
    The room you get in PUN 1.25 is however a "fake" room. You can't use its properties and it's a "new Room" every time you access it.
    In PUN 1.26 (coming soon) I changed this so you have one offline room and at least can use the custom properties of it more or less like online).

    Offline mode has quite some quirks. I hope it still works out for you. Some developers are already using it successfully, which is one reason why I have a hard time changing it.
  • paulusul
    Options
    So far I'm quite happy with it! :)

    The new way sounds a little better, the only reason I mentioned it was because it explicitly said otherwise in the documentation.

    Another thing I have experienced since then is that offlinemode in relation with the PhotonTargets.AllViaServer and AllBufferedViaServer obviously aren't working.
    Will they ever? or maybe it should also be mentioned in the documentation :)
  • Tobias
    Options
    Hm. Good point.
    I will have a look at allViaServer. I can easily execute the RPCs locally but I'm not entirely sure if I can solve this for every type of message (e.g. RaiseEvent) easily.
    Buffer obviously doesn't work but also doesn't have to. No other player will join late.
  • Tobias
    Options
    Can you try this and give me some feedback if that's what you want:

    In NetworkingPeer, find method RPC(..., target, ..)
    In it, find the code for AllViaServer and AllBufferedViaServer and add this to the end of the block (after opRaiseEvent()):
    [code2=csharp]if (PhotonNetwork.offlineMode)
    {
    this.ExecuteRPC(rpcEvent, this.mLocalActor);
    }[/code2]

    This is how I would try to fix the RPCs in offline mode.
    Does it work for you?
  • paulusul
    Options
    I'm going on vacation today, so sadly I won't have time to check it out :(

    Will look at it as soon as I get back!