Commented out functions in Photon PUN 2 2.30

Hi,

We had an issue with some photon provided libraries that were not build with enable bitcode for the iOS platform so we decided to update since apparently it was fixed in 2.22 (we were using 2.21). Problem is, we have no was of getting 2.22, we have to jump all the way up to 2.30 and this breaks our code even more.

Although I cannot find any notes on why they were commented out, it seems "SetOwnerInternal" and other functions in PhotonView were just removed or commented out. We still use SetOwnerInternal and there seems to be absolutely no way of going around it. Or at least no way that is documented. Because yes, documentation still lists SetOwnerInternal as available for the PhotonView class in version 2.30 while it is not...

Any help would be greatly appreciated.
Cyril

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Cyril,

    Thank you for choosing Photon and sorry you ran into this issue.

    PhotonView big changes happened in v2.28 (23. February 2021):
    Changed: PhotonView code to cache Owner and Controller, as well as storing the sceneViewId for objects which load with the scene. This is a bigger change and complex, so it may break some projects, despite the testing! Mail us, if you run into issues with ViewIDs, Ownership, etc: developer@photonengine.com.

    SetOwnerInternal was not meant to be made public.
    Why do you need it anyway?
    How do you use it?

    Maybe we can help you with an alternative.
    I believe Simple was using this method and managed to get rid of it.

    I have also updated API Reference to latest version to be in sync with latest package version's code.
  • If this is used in the "Simple" addon, please get the related release of it. It got updated for the newer versions but is released separately.
    https://github.com/emotitron/Simple_Addon_for_Pun2/releases
  • Hi JohnTube, hi Tobias,

    Thank you for your replies!

    I'm really sorry I am just replying to you now, I must have done something wrong in setting up the notification, I never got any telling me someone had replied to my post!

    In the meantime we found a (dirty) way of achieving what we want. We basically copied the 2.22 we had on another project and pasted it on the project with the faulty 2.21.
    JohnTube wrote: »
    Why do you need it anyway?
    How do you use it?

    I am not the one who wrote the code but we use to set up photon views manually, and as the function name implies set its owner when it becomes available.
    Tobias wrote: »
    If this is used in the "Simple" addon, please get the related release of it. It got updated for the newer versions but is released separately.

    I checked and they seem to be using
    photonView.OwnerActorNr
    
    and
    photonView.ControllerActorNr
    

    Is that the "right" way of doing this?

    I can totally understand it was never meant to be used but it is the lack of a documented solution to achieve the same thing without it that is alarming. Then again, I am not the one who chose to use it, maybe the solution would have been obvious for the developper who did.

    Again thank you so much for your replies and I am deeply sorry I am only seeing them now! When I have time I will try the "Simple" addon solution and if it does work, I will come back to this post and make it clear it is one solution.