Search Unity

Looking for Dedicated Login Server recommendations.

Discussion in 'Connected Games' started by Onsterion, Feb 20, 2018.

  1. Onsterion

    Onsterion

    Joined:
    Feb 21, 2014
    Posts:
    211
    Hi,

    I am currently trying to do a MMORPG in Unity (for the moment in a hobbyist way), and is normal in any kind of this games you have a:


    1- GameDBServer
    2- GameServer
    3- LoginDBServer
    4- LoginServer


    For the moment i have all in the GameServer Machine for testing (A normal clasic way with a custom NetworkManager) but i decided to separate this adding the dedicated Login Server, so i need separatelly other machine or other dedicated process for respond and process login request then send success or fail respond and then connect the user with the GameServer.

    First way in my mind WCF server and getting a json respond with "Hey! success!? But i don't know if this the right way.




    Any have experience in MMOs and how to implemented to HLAPI?








    Regards.-
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    7,735
    There's lots of ways you can do it. I can't say I'm doing this the "right way", but in my game I use a Unity build as the login server using NetworkServerSimple (no network manager), and communication is done via UNET Messages with the client and other servers. I have the login server handle both user/character creation and logins.

    When a client logs in, the client sends a username/password using a simple encryption, the login server then asks the database server (another Unity instance) for the user's record matching that name. If the login server determines the username and password are correct, it asks the database server for that user's character record (if it exists), and then sets a randomly generated ulong as a login token. It sends the client the character record with the login token with some simple encryption again, and pushes it back to the database.

    The character record includes what game server (I call them zone servers) the client should connect to, and where in that game world they should spawn - basically where they were last time they logged off. So the client then connects to that game server, and the game server requests the character record matching the name the client provides from the database server. The game server then verifies that the login token it gets from the database matches the login token the client provides, and if so then the game server spawns in the ship the client will control (if they don't match then the game server just disconnects the client).
     
    Onsterion likes this.
  3. Onsterion

    Onsterion

    Joined:
    Feb 21, 2014
    Posts:
    211
    This is the second way in my mind xD
     
    Last edited: Feb 20, 2018
  4. YourWaifu

    YourWaifu

    Joined:
    Oct 4, 2015
    Posts:
    8
    Current Unity HLAPI is not targeting MMO, maybe in future will normal support
    (And in general on Unity it is extremely inconvenient to develop MMO, even AAA-Type game's)
    >WCF
    It is a bad idea
    It will be faster and more convenient to use classic RESTful API
    a's NancyFx, ASP.Core

    HLAPI Only UDP Channels
    For MMO(RPG?), great ideal solution is TCP\UDP socket
     
  5. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    411
  6. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    738
    Why would you need TCP for MMO, if you already have reliable UDP?
     
  7. YourWaifu

    YourWaifu

    Joined:
    Oct 4, 2015
    Posts:
    8
    Why do I need an axe if I have a chainsaw?
     
  8. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    738
    Your answer doesn't make sense. If you are willing to troll, please, change the forum. Thanks.
     
    Onsterion likes this.
  9. YourWaifu

    YourWaifu

    Joined:
    Oct 4, 2015
    Posts:
    8
    My answer contains the meaning you wanted to hear.
    I'm not gonna troll, i totally serious.
     
  10. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    738
    Your answer is totally useless, and doesn't meet the context of the topic.

    If you develop a real-time MMO or RPG you don't need TCP at all. First of all, a client doesn't want to wait for lost packets by RTT * 2. For instance. player position have to be unreliable. Imagine the situation with TCP if the 1st packet has been lost, but the 2nd is arrived, so it snaps the model to (2,0,0), and after some time the 1st lost packet is arrived with (1,0,0). It snaps him back to (1,0,0) and then snaps forward to 3rd packet (3,0,0).

    Using UDP with custom reliable layer aka RUDP for player health, inventory management, combat, chat messages is the best approach for developing real-time games.
     
    Last edited: Feb 26, 2018
    Onsterion likes this.
unityunity