Customize NetworkingPeer


I just updated my PUN into version 1.17( previously my version is 1.15)and I found that is a lot of changes .
I want to ask that can i edit or modified the NetworkingPeer -OnEvent function ? because i found that is some comment indicate that this file is not public API.

Previously, in my game I will direct access NetworkingPeer to call OpRaiseEvent() but now NetworkingPeer is not longer public class and it's internal class.

If cannot isn't anyway that I can send hashtable or arraylist from master client to slave client after slave client join but before game start running.....Thanks if anyone can guide me through this....

PS: I intend to use our own Photon Server instead of Photon Cloud in the future, but still using PUN script to connect to server.


  • dreamora
    you can modify it but any update will require manual merge.

    Also what you want to do might potentially be doable through room properties in an automated way for example.

    Also instead of OpRaiseEvent you could just use the PhotonNetworkView.RPC path which is there to offer this kind of functionality 'Unity Networking' style :)
  • Thanks Dreamora...You are always so helpful within this forum and reply faster than Exit Game Staff..

    I also thinking to use room properties but crucial part is how can i reset room properties during each round and start next round game concurrently for both player ? (example the game has 5 round). I also i wish only master client change the room properties and both client share the same properties....

    If i using PhotonNetworkView.RPC isn't possible to sending hashtable or arraylist with random size?
  • dreamora
    RPC have no randomness limitation and alike.
    that would only be a problem if you used UnityNetworking and OnSerializeView where the data need to have constant size.

    Actually that 'crucial part' would exactly be the use case for room properties. When you change them they are broadcasted to all users in the room.
    The only thing i can't answer out of head is if you would get a callback fired when the room properties change while you are in the room.
    Photon on the client will hear about the update but PUN might not have it exposed (I know that in our project on an older version of PUN I had to expose it myself)