Handle everything server-sided?

Hello!
Currently to spawn things and handle everything I do an RPC call and check if this is the master client then do my spawn and stuff.
However, I do not want this.
I was my "server" to do all this.
Now, I know there is no PhotonNetwork.isServer however can you guys implement this or please show me how to do this exactly?

Comments

  • Hi,

    Why don't you want do this on master client?
    Photon cloud can't run any logic on real server, Roughly, it only runs lobbies and helps clients exchange with messages inside rooms.
    You can switch to on-premise server to be able run custom code including logic on server: http://doc.exitgames.com/en/onpremise/c ... rver-intro
    But it takes more effort from developer.
  • Well, I don't want anything handled client-sided unfortunately.
    I want to handle things server-sided so many things cannot get hacked.
    Also, an example I have is this:
    I have an object and attached a script with this:
    [code2=csharp]void Update () {


    if (PhotonNetwork.isMasterClient) {

    timer -= Time.deltaTime;



    if (timer < 0) {
    PhotonNetwork.Instantiate(objectToSpawn, new Vector3(transform.position.x + Random.Range(0, spawnOffset.x), transform.position.y + Random.Range(0, spawnOffset.y), transform.position.z + Random.Range(0, spawnOffset.z)), Quaternion.identity, 0);
    timer = spawnTime;
    }





    }
    }[/code2]

    So, not every client will spawn the objectToSpawn, only the master client will.
    Let's say the master client is just a random player. If that player leaves the game, ALL the objectToSpawns also get removed for everyone. Which is not what I want at all.

    I was thinking of a way, and I was thinking if I can somehow ALWAYS connect myself as the masterclient and just stay there, that will basically be my server "technically" so I can always call mastercleint things. (which "technically" would be my server) Or is this a bad idea?
  • Agree, 'hacking' is good reason to not let logic run on client.

    Master client is not a random client. When room just created, the client which created the room is master until it's in room. If this client leaves, next client in room takes over. So just always create room yourself and do not forget to stop other clients when initial master leaves for some reason.
  • I'm just very confused and conflicted what I want to use my for multiplayer FPS.
    Do I want to use Unity's networking because they have isServer and can easily make an authoritative server, or should I try and make an authoritative server using photon.

    If you can give me some example code of if I make it so ONLY MYSELF can make a "room" then I will be the masterclient of each room and not allow anyone to become masterclient except for myself. Now if I do this, then how can I make it all handled on my side only? (Basically server-sided) Would I only send RPCs to the masterclient and how will the masterclient send everything to all the clients? If it' possible, can I see some example code and stuff please? If I get this down, I can start developing my game again.
    Thank you.
  • I took the time to research a lot about multiplayer games that have been created with photon. I noticed one called "Das Tal" which uses Photon's cloud and networking. I quote this from their dev's story about the game "Our game server is a fully authorative server"
    I was wondering, how in the world did they go about making it an authoritative server with photon??? I would LOVE to do the same thing, I am just confused? Can you please provide some information like text or video tutorial on how I can make my game with an authoritative server that handles basically everything and just sends to clients.
  • I was wondering, how in the world did they go about making it an authoritative server with photon??? I would LOVE to do the same thing, I am just confused? Can you please provide some information like text or video tutorial on how I can make my game with an authoritative server that handles basically everything and just sends to clients.
    Please read my first message about possible Photon development options and follow the link with info on Photon server.