A Broad Overview for Networking


I've recently started using PUN and the entire time I've had the suspician that I've been doing something wrong. You can imagine that this can get annoying rather quickly. I'm making a top down shooter (a bullet hell with fewer bullets) and everything I've done seems to work as well as I should expect. My fear is that I get much further down the road only to discover I should have done something differently.

I don't think I'd have any problems getting this up and running eventually but I'm worried about future hackers. How would I go about preventing people from abusing a progression system and just having enough points to level through it? Or, skipping leveling all together and just instantiating bullets? Using the cloud, I suppose the person that's tagged "it", or the player with the lowest ID, could be considered the "host". And then check to see (through the host) if they have enough points to buy something, or have bought something to use it, but is that enough? Is it too complicated?
Does using a PhotonView (observing a location) prevent "teleportation hacks", or can I only do that with additional logic to see if such a move was possible?

Sorry for the stream of questions, but I appreciate any feedback!


  • First off: You could implement extra server logic with the Server SDK but then you would have to host Photon for your players on some publicly available machine.
    Without the extra server logic you will have to assign the cheat-prevention tasks to some client.
    The MasterClient could be considered the host (replacement) and do this extra work, yes.

    Observing a location with a PhotonView won't help. The component just syncs what it observes and doesn't check it. When you observe a script instead, you could do "teleport" checks on all receiving clients and detect a cheater, of course.
    Buying items might be checked in a similar way: All clients (or just the master) will get updates like "my current points". Check for implausible changes in those per update. If someone sends his upgrade as "i bought X and paid y", any client can check this and detect cheats.

    How you resolve cheats is up to you. You could kick players (by event) or do silently ignore them. It's up to you.