Upgrade to Unity 2018.2 and Photon 1.9.1

Options
Hey guys,

In the project we are working, we have a set of avatars with photon views (that are created at runtime when a new user connects).

Before, when any user disconnected Photon automatically cleaned up the user avatar (as in destroyed the game object) in all the clients; now this behavior is not happening anymore when we upgraded to Unity 2018.2 and latest photon 1.9.1.

Is this expected?. We checked and we moved all of our RPCs to PunRPCs and cleared up and reloaded all the RPC list in the photon settings. Any idea what can be happening?.

As of now, we are deleting manually when a user disconnects its avatar. Seems to us that the "isGeneratedAtRuntime" flag could not be working?

Comments

  • hallJuan
    hallJuan
    edited July 2018
    Options
    Ok Guys, I have an update. On top of the unity clients, we also have a .net client that connects to the same room that the unity clients are in. This .net client just shows the list of unity clients in the room.

    If we _do not_ connect the .net client. all the avatars get destroyed when they exit the room. BUT if we connect the .net client as the master server then this behavior happens.

    If one of the unity clients is the master server, this behavior doesnt happen. Could it be that the .net Photon is not compatible with the PUN package?. Any ideas?
  • hallJuan
    Options
    Ok guys,

    Another update:
    We started the marco polo demo and made it join a specific room "MyRoom" and connected the .net client game and when the .net client game is master client and one of the marco polo clients disconnects, it doesnt remove the game objects in unity. If the .net client is not the master client it works correctly.

    Any ideas?, we are starting to think that this might be a problem in photon.
  • Hi @hallJuan,

    thank you for the report and sorry for the late response.

    I'm currently investigating this behaviour and can at least confirm, that the same happens to me. I'll let you know when I have further information about the issue.
  • [Deleted User]
    edited August 2018
    Options
    Hi @hallJuan,

    the problem seems to be, that the RoomOptions, made by the DotNet Client, are not applied correctly on the Unity Client. This is an issue in PUN and will get fixed with the next update. However you can apply this fix on your own, to continue working. Therefore you have to apply two minor updates to PUN's source code.

    The first one is inside NetworkingPeer class on line 1250*: here you have to change the second parameter of the Room constructor in order to apply the cached options, the client has received. After modifying this line should look like this: Room current = new Room(this.enterRoomParamsCache.RoomName, this.enterRoomParamsCache.RoomOptions);

    The second one is inside the Room class on line 238*: here you have to set the autoCleanUpField to the value which is stored in the RoomOptions parameter. After modifying this line should look like this: this.autoCleanUpField = options.CleanupCacheOnLeave;

    Above mentioned lines marked with a * are the actual lines in the source code of PUN version 1.91. They might differ in other PUN versions.
  • hallJuan
    Options
    Hello @Christian_Simon ,

    Thanks for the reply! (at last someone! :p) Anyways, we implemented a workaround and now we cleanup manually the scene. Still, we will be trying this fix and we are glad you guys managed to reproduce it! :).

    Thanks a lot and looking forward for the next update ;-)
    Juan