Search Unity

Account System

Discussion in 'Multiplayer' started by tookydo, Jan 12, 2015.

  1. tookydo

    tookydo

    Joined:
    Jul 15, 2014
    Posts:
    75
    I am almost to the point where I am going to put up my game on my website. My problem is that I don't know how I would create a system like how you buy minecraft. Anybody can download the game, but you basically purchase an account for the game. How would I create something in my website (weebly) that I can purchase an account and then go into the game and be able to use that account to play the game?

    Any help would be great!
     
    TokyoDan likes this.
  2. Neoshiftr

    Neoshiftr

    Joined:
    Dec 5, 2012
    Posts:
    67
    You would need to make a SQL Database holding all accounts with an additional field saying that an account is premium or not. Then you need a payment processor which sets that variable to true or 1 when payment was successful.
     
    AlanGreyjoy likes this.
  3. BoysWhoCry

    BoysWhoCry

    Joined:
    Jan 19, 2015
    Posts:
    12
    You would need to set up Paypal IPN, and set it to where you can read the data from IPN then store the account in a SQL database with and int called "Bought" then have set to 1 if bought then set to 0 if not. Then in your game read the data from database with a php api and a .js in your game using WWW forms.
     
  4. ExtremePowers

    ExtremePowers

    Joined:
    Sep 27, 2013
    Posts:
    28
    I have a question on this topic: How to prevent people from using the same account as for example their friend?
     
  5. iamsteele

    iamsteele

    Joined:
    Mar 25, 2014
    Posts:
    29
    You may want to look into using Steamworks platform for selling access to your game, as they have an SDK and account management system all built into one, plus the fact that they help with exposure and advertising. my 2 cents.

    Also, whenever somebody logs in, have a field set to true for "connected" and set the IP address as the "connected_from"... on logout, set it to false, and allow people to log in from the same IP address in the case of disconnects, and have the game periodically (every 1 to 15 minutes) update the logged in status. On login, if the last updated connected time was over 15 minutes, set it to 0.

    This method will prevent people from logging in from multiple networks, or different houses in general. In order to make it impossible to log multiple computers in, you would need to establish a passcode generated on every login (like a session ID in PHP) that stays open and on login any other open passcodes are overwritten and thus are forced closed, so that the second your passcard is revoked (the socket), the game should shut down, if you are attempting to login multiple computers under the same IP address.
     
  6. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Check if player has already logged in while trying to log in.
     
  7. Moonstorm

    Moonstorm

    Joined:
    Jul 26, 2012
    Posts:
    23
    First, just have a simple login system and see how many people are buying your game. Don't over-optimize your solution now just yet.
     
    AlanGreyjoy likes this.
  8. AlanGreyjoy

    AlanGreyjoy

    Joined:
    Jul 25, 2014
    Posts:
    192
    When users buy your game, have them register with a login and password. This is stored to a MySQL database. (You can use a Wordpress site to make this more easy for you) Then use paypal ipn and create a field in your users database called boughtGame and set it to 1 when they do.

    Then once you have that, make a launcher for your game, have a login.php script that will check your database for username and pass and if the they bought the game. If logged in, then have the launcher run the game.exe

    Done.