How to run calculations server-side

My extremely newby questions are related on how to handle properly calculations that should be done server side in order to avoid cheating client-side.

I'm just starting to get into client-server programming so my question should sound trivial to the most of you, I apologize.

I read documentation related to RPCs and figured them out to be methods to be invoked on one or more clients via network, being able to choose different ways to enroute them.

First question is: using RPCs puts the game in a safe shell from cheatings?

Secondarily, RPCs can just pass simple data types so, in order to handle higher complexity calculations like the map creation and map alteration what is the best way to proceed? I read about the Photon Server and I was wondering to know if that could be the solution I'm looking for.


  • You can not run anything on server when connected to Photon Cloud. Server is just for events exchange between clients. Logic should be run on clients (or possible on one of them). So it's hard to avoid cheating if you do not have at least one trusted client. There is nothing special about RPC.
    Photon Server can solve this since it lets you run custom code on server side.
    Same for calculations like map creation. You either do it on one of clients (usually on so called master client) or run Photon Server with server side logic.
  • Thanks for your prompt reply.
    Is the master client the one who starts the server or the one who creates the room? Or it is decided in another way?
  • Not sure what you mean by starting the server.
    Always there is one master client in the room and if current master leaves, other client takes over.
    Obviously, right after creation, the master is the only client in room - the creator itself.
  • Oh, rght. Because for what I've seen I first start the server and then create a room.
    Nevermind, I only meant the one who creates the room.
    Thanks for your kind help!