When creating a room I can't set the roomOptions.

edited March 2017 in Native
I have a IOS Swift client with photon cloud.

When I do this in connectionReturn:

let roomOptions = EGMutableRoomOptions()
roomOptions.isVisible = false

NetworkLogic?.client.opJoinOrCreateRoom("roomID", roomOptions)

The room gets created with the property .isVisible = true. Am i creating and using the EGMutableRoomOptions object correctly?

Note: After the room gets created I can change the property .isVisible to false.



  • Hi @GreenRollingHills.

    I can not reproduce your issue. I have run 2 instances of demo_loadBalancing_swift from our latest Client SDK, without any modifications except for setting a valid app ID and the room created by one instance was visible by the other instance. Afterwards I have added your code from this post to func createRoom() and one client was no longer able to see room created by the other instance, so this works as expected.
    Note that it is
    roomOptions.IsVisible = false
    starting with an upper case I and not
    roomOptions.isVisible = false
    like in your post.
  • HI @Kaiserludi

    Thanks for your response. In my app when I try

    roomOptions.IsVisible = false

    with a capital I vs. lower case i my compiler gives me an error. It states "IsVisible has been renamed to isVisible". I am using Xcode 8.2.1 with Swift 3.0.2.

    Note: after I create the room I do:

    networkLogic?.client.currentlyJoinedRoom.isVisible = false

    and this works. Note the lower case i vs. uppercase I.

    So, I think my error is elsewhere. I'll keep looking and I'll try the demo again.
  • Hi @GreenRollingHills.

    I have just realized that you are using opJoinOrCreateRoom() and not opCreateRoom().
    Please be aware that in this case room options are only considered when you are actually creating a room, but ignored, when you just join an existing room.

    The reason behind this is that otherwise joining players may accidentally override the options that have been set by the creating player.

    So please assure that your client is actually creating the room and not just joining an existing room.

    I will have a look at the upper vs lower case issue. My guess is that Apples Xcode project updater just tries to be smarter than it actually is.
  • Update:
    OK - it seems like Swift 3 really treats all properties as if their names would start with a lower case character, even if those properties belong to an objC API which defines them as upper case. The same for member functions and basically everything else.
    I wonder what Swift does, when that objC API contains two identifiers of the same name that just differ in case...
Sign In or Register to comment.