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

[Released] Time to add an Account System to your Game

Discussion in 'Assets and Asset Store' started by Anisoropos, Jun 10, 2014.

  1. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Greetings fellow Developers,


    a few months ago, I went through the trouble of setting up an online account system for the game my team was developing at the time.

    Using C#, PHP and MySQL I managed to make all of its features work like a charm

    • Registration
    • Login
    • Account Activation via Email
    • Password Reset
    • Data Validation
    • In-Game Account Management and even
    • the ability to easily store and retrieve any game-related information (instances of custom C# classes)

    Although it's not the hardest thing I've done, it was 15 days of cross-language programming that resulted in a couple of headaches.. In retrospect, if I had the option to [Buy such a Thing] I would have gladly payed 50$ to save me that hassle.

    But I didn't, so instead I spent a couple of weeks and made it work for any project automatically - It's an account system, you never know when it's gonna come in handy again :)


    Now it's as simple as

    1. Uploading a bunch of provided PHP files to your web server (there's a lot of free of them out there if you don't have one - most of them provide databases as well),
    2. Filling in your server's and database's details in our custom Unity Editor Window
    3. Customizing your database by adding any account-related fields you want the user to fill in upon registration.
    4. Hitting Setup - That's it!

    Which means you're up and running without so much as viewing a single line of code!

    After setting it up, you can easily integrate it into your project using the demo scene by simply changing its appearence to suit your needs - or you can dive in the well-documented code to find that all our features (Registration, Login, .. ) are implemented by intuitive, single-line C# commands.


    You can get it now for just 15$ here.

    You can try out the demo scene we provide here.

    You can watch the setup process here:

    .


    And here's a glimpse of the demo we provide to help you get started:

    .


    I'm also at your disposal via PM in the Unity Forums, through Facebook or email at mr.kon.vas@gmail.com for any questions / comments / suggestions.

    Hope I get the chance to help you get your projects online :)


    Yours,
    Konstantinos
     
    Last edited: Dec 24, 2015
  2. cyangamer

    cyangamer

    Joined:
    Feb 17, 2010
    Posts:
    230
    This sounds really useful. Makes me wonder why this hasn't gotten more attention. :)

    Has this been tested on many different sites? It almost seems too easy for there to be a one-size-fits-all, but then again, I haven't worked too closely with MySQL databases.

    Also, given your last bullet point, do you mean that things like high scores, character stats lookups could also be hosted with this system?
     
  3. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    your demo returns "PHP Error" when registering with invalid data (like age). You should validate data sent first.
     
  4. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    I wonder the same.. if you're offering free advertisement advice I might include you in the credits ;)

    Since Online Account System is not designed to work with a specific MySQL database - I see no reason why it wouldn't work with any given database / hosting site.

    But in the off chance a technical issue arises, I'm always available for hot-fixes / troubleshooting..!


    Any C# Serializable class (pretty much any class without pointers / references to other objects) can be stored as a MySQL field automatically with this Asset.

    The demo shows an example of how to store player scores / stats. :)


    This is a very nice suggestion - I'm definitely adding data validation to my next version.

    Thanks for pointing that out imtrobin..!

    PS: Note that the full PHP/MySQL error appears in the Debug.Log, making debugging such issues relatively easy!
     
    Last edited: Jun 27, 2014
  5. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    V1.1 Is out..!

    Online Account System now offers the following additional features:


    • Now supports from Unity 3.5 Upwards

    • Tested on many free and paid as well as custom hosting services - the asset works like a charm.
    • Minor Fixes:
      • Clarified some things in the Custom Info class comments
      • Fixed a couple of unintuitive Debug.Logs.
    • Workflow / Conveniences:
      • You can now access your custom C# classes directly from accountInfo.customInfo instead of creating a temporary variable - which makes changing it a breeze
      • There is no need to manually serialize / deserialize customInfo - it's now serialized just before Upload and de-serialized on Download
    • Registration:
      • Checks wether mail could be sent, outputs a user-friendly error otherwise
      • If a field is supposed to be a non-character type (like integer, float, double) but we ask the user to type its value, we now validate that value.
      • The custom info is instantiated during registration so that users don't have null custom info fields when they first log in.
    • Demo:
      • Improved user-level messages (for successful registration, invalid credentials, invalid field value, ..)
     
  6. wilkens

    wilkens

    Joined:
    Feb 3, 2014
    Posts:
    6
    Hi friend

    I'm new on server side things so I got some questions for you. First I cannot figure where to get database hostname, database port, username password and name. I've purchased basic plan from atspace. Please help me configure by answering those simple questions

    Thanks!
     
  7. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hello Wilkens,

    all the database related information can be found on the Database manager of your hosting service. For atspace, it's here.

    I've also attached a screenshot so you know what you're looking for..! :)

    Screenshot 2014-09-18 20.36.50.png

    You can reply here for any further assistance / comments..!

    Yours,
    Konstantinos
     
  8. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Awesome asset. I have no php experience, but I'd like to let users register from a web browser instead of through the Unity build. If it's not too much trouble, can you write a simple example? Username/email/password are the only fields I need for registration and I can figure out visual formatting etc -- just need the functionality. Thanks!
     
    Last edited: Oct 25, 2014
  9. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hey, I'll have a look when I can and see if I can put something together. But I'm a bit busy so I can't promise anything..! :)
     
  10. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    705
    Watching for future buy list.
     
  11. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Thanks! I'll keep an eye on the thread :)

    edit: ended up figuring it out myself
     
    Last edited: Dec 13, 2014
  12. CrunchingKoalas

    CrunchingKoalas

    Joined:
    Mar 29, 2011
    Posts:
    51
    Hey there,

    The system looks super nice - does it work on mobile? iOS, Android, Windows Phone?

    Cheers,
    Tom
     
  13. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hey Tom thanks for your kind words,

    first off I wish you and this beautiful (and i Mean it) community a healthy, happy & productive new year..! :)

    Concerning your question, Online Account System needs just a small fix to work with Android, which I've been emailing to all my clients.

    This fix, along with a few more things, is included in the new v1.2 that's being reviewed as we speak and should be live next week.

    Finally, as always, part of what you're purchasing is my complete support should you run into any problems - perhaps with iOS or Windows Phone ;)

    Yours,
    Konstantinos
     
  14. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    V1.2 is out..!

    Online Account System now offers the following additional features:

    • Added FAQ / Known Issues documentation

    • Android Compatibility:
      • The asset is now fully compatible with Android (and easily modifiable but untested to work with iOS / windowsPhone)

    • Demo:
      • Further Improved user-level messages (Waiting for response, handling unexpected errors, ..)

    • Bug Fixes:
      • Fixed a bug where Check Field didn't work properly with boolean variables

    • Code:
      • Added Check Field to account management as well
     
  15. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Hey very interested with your project... I have a couple questions.

    1. Do you know of a way this could be setup to run through an online paying system like paypal?

    2. Is there anything in your system that checks for multiple simultaneous logins and suspend accounts?
     
  16. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hello Licarel,

    Given a system which can confirm that a user paid a specific amount of money, you can use Online Account System to keep track of their account balance - also if they purchase a voucher with a specific ID, you can also use our Asset to store that information.

    There's a couple dirty workarounds which can be used while developing, but I don't suggest using them in a released version..!

    Thanks for taking an interest in our Asset :D
     
  17. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    V1.3 is out..!

    Online Account System now offers the following additional features:

    • Security just got beefed up - now featuring the SHA512 hashing algorithm instead of SHA1

    • Implemented iOS / WindowsPhone compatibility (Android was already fixed in v1.2)
      • The asset should now be fully compatible with iOS / WindowsPhone

    • Fixed a bug which occured when the server-side scripts where uploaded to a sub-folder of the server

    • Reworked some of the PHP code for clarity - mutual info now resides in a single PHP file instead of being spread all over the place :}

    • Minor fixes concerning the reset password HTML file
     
  18. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    V1.4 is out..!

    Online Account System now offers the following additional features:

    • Upgraded PHP scripts to use mysqli (Improved MySQL) instructions instead of the soon-to-be-deprecated mysql ones.

    • Reworked the architecture of the PHP files to a more intuitive one, handling database connections, credential management & queries in seperate files. This makes it easier for developers to extend the back-end of this asset.
     
    hopeful likes this.
  19. RCostaDesigner

    RCostaDesigner

    Joined:
    Mar 7, 2014
    Posts:
    3
    I'm getting this error every time i try!!

    error: cannot connect - Access denied for user 'myUser'@'MyIp' (using password: YES)
     
  20. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hello Maxalula,

    and thanks for purchasing Online Account System :)

    I'll try my best to help you solve this issue, although I need a bit more info:
    • Are you using an online or a local server?
    • Have you followed the step-by-step video tutorial?
    • Have you managed to connect to that database through any other application?
    Yours,
    Konstantinos
     
  21. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    V1.5 is out..!

    Online Account System now offers the following additional features:

    • Upgraded the provided demo to use Unity's Canvas UI - it now serves as the perfect starting point to integrate Online Account System's on-the-fly UI generation to your games.

      Here it is in action:

     
  22. instruct9r

    instruct9r

    Joined:
    Aug 1, 2012
    Posts:
    148
    Looks nice. I have a question though.
    I might need to use it for interactive preview. But i woud need to save objects position.

    1: In the SetUp, does the "Field Type" support Vector3 ? If not are you planning to add it?
    2: Coud you give me a list of all "Field Types" available? There doesn't seem to be any place, where i can see what types of data can be added.
    3: From the features: "Automatically generated UI". Can that be turned off? So i can make my own UI's and not bother, deleting all the stuff that this tool will create?

    4: I suppose, that every user will have it's own Database right? So if logged with different users, only their information will be loaded...

    thanks
     
  23. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hello @instruct9r, thanks for taking an interest in Online Account System :)

    Concerning your questions:

    1, 2) We provide two types of information storing: Account related and Game related. Positions would be stored in the latter.

    Account info is stored in mysql fields and is visible at the database itself. Its types are MySQL types (BOOL, INT, FLOAT, DOUBLE, VARCHAR, LONGTEXT).

    For game related info on the other hand (like storing object positions) we provide a class in which you add any C# type of variable (Vectors, Arrays, even your own custom classes - as long as they're serializable).

    3) That's an unusual request, but sure you can. When you get your hands on our demo scene, it's clear which part of the code generates the UI - if you have another way of doing things feel free to write up your own code. Keep in mind the reason we generate the UI automatically though is so that there's always a match between the registration form the user sees and the fields that MySQL expects during registration. So if you do write your own solution, you'd have to abide to that constraint - otherwise MySQL will have missing / extra fields during registraiton and will throw errors.

    4) That's not how databases work, but yes only their information is loaded. There is one database for all the users, but each user has her own entry in the database. When she successfully logs in, Online Account System returns her account's id. You then use that id in your code to download her info and her info alone.

    I hope I cleared some things up for you!

    Let me know if you want more specific details on something :)

    Yours,
    Konstantinos
    Tall Guy Productions
     
  24. Deleted User

    Deleted User

    Guest

    Great assets, thanks! Only one - demo doesn't work, can you fix this? :)
     
  25. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hey @Rice_nyan thanks for the kind words. Do you mean the demo unity scene included in the asset or the online demo page?
     
  26. Deleted User

    Deleted User

    Guest

    Oh, sorry, I tried right now ( I am told about online demo), working perfect, so, then, I just say good job :D
     
    Anisoropos likes this.
  27. ElectroSphere

    ElectroSphere

    Joined:
    Nov 17, 2012
    Posts:
    50
    Hello,

    I started today with your asset by importing the package from the assetstore, but I have two problems (not sure if they are linked) :

    1) Two errors on the console : http://www.hostingpics.net/viewer.php?id=448692bug1.png

    2) I can't open properly the setup panel located in Window/Online Account System. Well ,it opens but it has a tiny size (it's like 2x10 px), I took a screenshot so you can see more clearly : http://www.hostingpics.net/viewer.php?id=952325bug2.png When I click on that small rectangle, I can drag it around, so I'm guessing it was supposed to be the setup panel from your account system.

    FYI I am using Unity 5.6.0f3, WebGL mode

    I did not sink in the Documentation yet, but I think I better fix those errors first before taking any steps further.
    Do you have any solution about this ?
     
  28. ElectroSphere

    ElectroSphere

    Joined:
    Nov 17, 2012
    Posts:
    50
    UPDATE : After reloading my project, it seems the setup panel appeared correctly, so problem fixed. :)
     
    Anisoropos and hopeful like this.
  29. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Alright thanks for getting back to this thread with an update @ElectroSphere - if you run into any more trouble just reach out to me again!
     
    ElectroSphere likes this.
  30. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    888
    Hi,

    some questions to you asset.

    1) Is it possible to use HTTPS protocol to communicate with the server from unity safely?

    2) Did you encrypt the strings are hard coded in unity?
    Eg.: Database names, host names, php locations, etc..

    3) Is it possible to send binary files to the database as well?

    4) Would it be possible to encrypt large data binary blocks before send?
    Otherwise its easy to hack the data flow with solarwinds wireshark and manipulate game stats in xml like ppl reading emails on the fly.

    5) I'd like to register game AddOns also.
    The user brought an AddOn and installed. The main game sends the addon-serial to the server
    and receive the state OK (serial found and marked as used by userID: and Email) or similar.
    Would it be possible to handles something like this or customize it?

    6) There are any safe mechanism to:
    * Prevent multi registrations,
    * Prevent multi log ins.
    * Prevent fast logging or flooding.
    * Database over loading. exceeding MB size,
    * Restore user database on delete.
    * Email notifications on errors happen on any user account.
    * Contact the support through your asset to verify the userID email and support password?
    * Creating backups like cron jobs at a predefined time.
    * Block login because of maintaining the server.
    * Block users.
    * Stats see how many user currently online or logged in.
    * Generally displaying some stats about the users?

    Thank you. :)
     
    Last edited: Jun 19, 2017
  31. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hey, let me reverse this - thank you for these valid points, all of which would be required for a production-ready implementation, mostly concerning security.

    Online Account System is not sold as a production-ready implementation ; it's lightning fast to setup and integrate, has a flexible architecture, a lot of under-the-hood functionality and a solid documentation.

    That being said, security is something I've only recently started working on since I'm now developing an online game used as a case study for this asset's evolution, and can't offer a time frame of when any of these will make it into the asset itself.

    Nope

    All databse names, passwords, email accounts etc are stored in your PlayerPrefs and never make it into the exe.

    An exception to this is the php locations ; and these are not encrypted.

    As VARCHAR / LONGTEXT.

    Not implemented.

    Retrieving / Updating accounts is done via C#, yes - generic functionality with custom mysql fields is in place.


    Yes, username is a default field required to be unique. So is email, when used.

    Implemented in the development branch, not part of a release yet. Would be willing to share advice on how to implement this.

    Haven't looked into that.

    Not sure this would be in the scope of the system.



    No, but you can hook this up.

    Support password? The user can follow a link provided by the asset to reset their password.

    Not part of the current scope.

    Interesting ; not as distinct functionality somewhere, no.

    Not out of the box ; during setup you'd add a "blocked" flag to the account and check against that when loging in.

    Implemented in the development branch, not part of a release yet. Would be willing to share advice on how to implement this.

    Not part of the current scope ; if you'd like high scores, average login sessions etc you'd have to add those fields and track them manually.
     
  32. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    888
    Thanks for the answers.

    >>>All databse names, passwords, email accounts etc are stored in your PlayerPrefs and never make it into the exe.
    >>>An exception to this is the php locations ; and these are not encrypted.

    Oh perhaps I miss understood something.

    I thought the "game company" can use your asset, to give game user the ability to login to the "company server" and save his game data on the companies server.

    The game company creates the unity build, and fills all server side data strings in Setup Credatials info.
    Then If the games try to log in, it must use any hard coded server info out of the executable.

    On serializing class setup Credentials Info members like
    public string sv_databaseLocation = "www.milliondollarhomepage.com"
    public string sv_databaseHostname = "database"
    public string sv_databaseUsername = "database"
    public string sv_databasePort = "4839"

    My intend was to have the Setup Credatials info crypted.
    By an LZF compression or crypt with a key.
    https://forum.unity3d.com/threads/lzf-compression-and-decompression-for-unity.152579/

    Perhaps I'm total wrong what you asset does :)
     
    Last edited: Jun 21, 2017
  33. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    The game company can use Online Account System to store the user's data on their servers.

    To increase security, all sensitive information (database password, database hostname, etc..) are all stored on the server side ; the only thing that remains on the .exe is the location of the required php scripts (ie. register.php, login.php, etc.).

    For convenience, these are also stored in the PlayerPrefs in the editor so that you don't have to type them in if you need to relaunch setup for some reason (ie. resetting the database, changing the out-bound email address, etc..) ; but they nevery make it into production.

    Hope this answers your question :)
     
  34. chiwengchiew

    chiwengchiew

    Joined:
    Jan 19, 2016
    Posts:
    2
    I may be setting some things wrong, or my web server hosting service may be blocking some stuff,
    -or I just don't know how to access the home director properly.

    As seen in the screenshot, all the required PHP scripts are located in a folder called unity_php in the current directory:

    upload_2017-8-26_3-23-32.png

    Yet, it fails to connect. My domain is exorium.net

    I've tried:
    exorium.net/home/unity_php/
    exorium.net/home/exorium0/unity_php/
    and way more other things to solve my sanity

    but with no luck.

    upload_2017-8-26_3-40-45.png
     
  35. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hello! Have you tried without the 'home' part of the address (exorium.net/unity_php)?
     
  36. ketopa

    ketopa

    Joined:
    Mar 9, 2018
    Posts:
    1
    Hello guys!

    I have been wandering arond with an error when start the installing the database, after the first check about the server and the database, give me this error:
    AS_Setup: PHP/MySQL Error:
    Connect Error (1045) Access denied for user ''@'localhost' (using password: NO)
    UnityEngine.Debug:LogError(Object)
    AS_Methods:Log(String, LogType, String) (at Assets/Online Account System/C# Scripts/Helper/AS_Helper.cs:180)
    AS_Setup:Log(LogType, String) (at Assets/Online Account System/C# Scripts/Setup/AS_Setup.cs:249)
    AS_Setup:InitializeDatabase(AS_MySQLField[]) (at Assets/Online Account System/C# Scripts/Setup/AS_Setup.cs:148)
    AS_SetupWindow:InitializeDatabase() (at Assets/Online Account System/C# Scripts/Setup/AS_SetupWindow.cs:268)
    AS_SetupWindow:FieldsGUI() (at Assets/Online Account System/C# Scripts/Setup/AS_SetupWindow.cs:193)
    AS_SetupWindow:OnGUI() (at Assets/Online Account System/C# Scripts/Setup/AS_SetupWindow.cs:60)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Im already check mi DB, also set on the scripts in my host the credentials (and in local too), chaged the db user password but still having this issue, . . . even I change tha DB to other that allow foering conections, but still nothing

    Any Clue?
     
  37. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hi ketopa! Thanks for purchasing Online Account System :)

    Can you set the databse hostname to the full hostname of the database (ie. not localhost) and try again?

    PS: Ideally let's follow-up via email because it's easier for me to monitor (support email mr.kon.vas@gmail.com)
     
  38. SuperDanOsbourne

    SuperDanOsbourne

    Joined:
    Oct 3, 2017
    Posts:
    46
    Hi, I just bought the asset and I'm trying to set it up. It took me a while button to initialize, I get an error "please check your credentials..."
    from console: Connect Error (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known

    Edit: Ok, I didn't notice an error in the username so now...
    I no longer get the credentials warning but I get no "success" window and when I check the console I get:
    AS_Setup: PHP/MySQL Error:
    Connect Error (2002) Permission denied
     
    Last edited: Jan 11, 2021
  39. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hi SuperDanOsbourne, if you can forward this to mr.kon.vas@gmail.com I'll be happy to help you further. In the meantime check your credentials.php on your server and make sure your passwords and usernames are uploaded correctly (some special characters get changed for security reasons).
     
    SuperDanOsbourne likes this.
  40. marck_ozz

    marck_ozz

    Joined:
    Nov 30, 2018
    Posts:
    107
    Hello @Anisoropos , can this asset be modified for paid users?
     
  41. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Hi! Not sure what you mean, you do have the full source code upon purchasing the asset so you can modify it as you like. The possibilities are endless - and this is also why, while I will try to answer a few questions regarding changes you want to make, support is limited to using the asset "as-is".
     
  42. marck_ozz

    marck_ozz

    Joined:
    Nov 30, 2018
    Posts:
    107
    Thanks for the answer

    Ok I got it.

    What I mean was if with this code was able to implement a payment system in order to have paying users instead of free users, what I trying to implement is a suscription system for my users. But that answered my question, I´ll keep searching on that.
     
    Anisoropos likes this.