Modifying the code of Photon Unity plugin

I was wondering if Exit Games accept user code contributions to add features to the Photon Unity plugin. The problem with simply everyone hacking their own is that when new features are released and things are changed everyone will have to adapt their hacks to the new codebase.


  • Tobias
    We don't have a mechanism for such cooperation. I imagine it could become tricky to moderate changes which exclude each other or are special interest. Also, it's almost as much work verifying someone's code as it is to write a feature.

    If you got feedback, let us know and we might accept certain changes.
  • One of the features that's really important for me is redundant master clients. I need failover for master clients. So I can designate a primary and a secondary master client, if the primary master client disconnects, then the ownership of objects transfers from the primary to the secondary client in a transparent fashion. This way I can take down the server that runs a master client without kicking everyone out of a room or destroying all the objects that the master client owns. This is also useful for things like load balancing, so I can migrate master clients from one server to another if one server is getting overloaded.

    This requires changes to quite a few places in the photon unity networking code, so I'm wondering how I should go about it without having to redo it for every update.
  • dreamora
    That should practically never be possible to happen as new games are spawned on the GameServer thats less loaded so any new game is spawned on the other game server basically.
    Also with old games going off the list within 'meaningfull times' again, it will 'rebalance' itself continously.

    Keep in mind that loadbalancing is not designed for 'longtime running persistent games' or 'longtime games' at least not to my understanding but for 'fire off and take them down again' style games as with dedicated shooter servers etc where taking them off and starting them up again is a normal thing.
    In such a situation you have no need at all to transfer master clients, you would not even need any form of persistency on the client (which is the base to really have a stable MC transfer). If I were to add some basic persistency, then through a DB that stores stuff (if you run the master clients for the game rounds then from the master client, otherwise within Photon itself with new operations available to the MC only)

    As for how to go: you won't be able to overcome the need to backport changes, cause the PUN side is not 'extendable to not touch the base'. On the photon side you could go the same way as you would with lite based games and extend LoadBalancing but I personally think its easier to go with backporting there too beyond a given point as the architecture is significantly more complex than Lite for extending.