Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Use client build for dedicated server?

Discussion in 'Multiplayer' started by jtsmith1287, Aug 26, 2014.

?

Client build as server, or separate server build from client?

  1. Client only

    0 vote(s)
    0.0%
  2. Separate server logic

    100.0%
  1. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    I'm using Photon Server for my persistent logic, with a player database and and all that good stuff. I also run individual matches for a few players at a time, so would like to use a standalone unity build to handle the AI and navmesh and physics to report back to the clients. My question is whether I should use the user facing client build as the server, with the -executeMethod to trigger the "master client" code, or to create a specific build just for the server.

    The reason I ask this, and don't just make a unique server build, is the idea of synchronizing the assets. If I add a component in the user facing client, I'd have to then add that to the server and make sure both builds have identical assets. That and I'd then have two different projects to keep track of with revisions and all that. Seems like a nightmare with a group of developers (there's a few of us).

    And I am not just going with the client only idea, because that means all the authoritative logic would be stored somewhere on the client. I thought about using attributes to protect the code, but that doesn't keep someone from decompiling Unity, which I've heard is possible, and altering permissions and essentially hacking 100 of the game, posing a huge security risk for other players.

    Thoughts?

    I've also included a poll so I can get a clear idea what you guys are recommending at a glance. Also, if this doesn't make sense, please let me know and I'll try to refine the post. I'm not talking about authoritative or non authoritative. This would be an authoritative server either way, it's just whether or not to use the client, or build something separately. Thanks in advance. :)
     
  2. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    If you're building an authoritative server the least headache is making it a special case of the client. I'd only bother making a separate server project if it's more or less a number cruncher/matchmaker (no need to know the geometry of assets).
     
  3. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    So are you on the side of using the user facing client build to store authoritative logic? Also your profile pic is super creeping me out, haha.
     
  4. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    Yes. Having experimented a little, I find it worth it - less headache adding a special case over keeping two projects updated.

    Mission accomplished :)
     
  5. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    So what are your thoughts on security? I hear Unity is pretty easy to crack. I'm running an authoritative setup specifically to diminish cheating/hacking. Is having the server run the logic enough? Do you think that having 100% of the source code available a worthwhile risk?
     
  6. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    I haven't a clue about the security itself, but if only the server maintains state and approves all actions, there is no way the players can do anything. Authoritativeness and security are different issues :)

    There are ways to snoop on the traffic and all that, but there are a number of ways you can protect users from having their credentials stolen. I'm not the guy to ask about Unity-specific ways for that, but I could give lots of ideas for bigger systems, where user accounts are handled outside the game server :)

    But you want simple. So stick to Unity security and have a look around the forums. I'm certain I've seen a few threads discussing these issues more deeply.