• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Damiiiii7 · Jun 30, 2018 at 01:46 PM · c#unity 5networkingserverdatabase

Remote database for leaderboard

Hi!

I am trying to implement a leaderboard for my game in Unity. I found a tutorial on youtube that explains how to do that if you have a server that is hosting a database, using the WWW class to GET or POST to certain scripts on the server.

My problem is that I can't really host that server 24/7, so I found a couple of services that offer free databases. One of them is https://mlab.com/ for mongoDB and i also found one with mySql. My question is how can I implement those things since there is no server kind of (hope i explained correctly).

Also, is there another way to do a leaderboard to see all players' scores? (with login an stuff). Maybe what I am trying to do is a lot more complicated than what I need.

Comment

People who like this

0 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image lowhearted · Jun 30, 2018 at 06:06 PM 0
Share

Is there another way, with logins? I would think that logins are the only way to do it anyways (as you'd need to save user scores onto a server, and the only way to match scores with the proper user would be to use some form of identification). If you plan on using steam, you could definitely try SteamWorks to grab a user's STEAM_ID (as a login), and upload them to the Steam Cloud, where you can use servers. I've personally never worked with servers (although I will soon), but hopefully this could lead you to the right direction.

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Tobychappell · Jun 30, 2018 at 08:30 PM

This is aimed at (with login an stuff)

I know this may not be the answer and probably over the top, if this is relevant, but one very important step in doing this is planning how to be GDPR compliant before writing a single line of code when creating a logging in system that may store identifiable information about someone. If it isn't going to store any identifiable information then I reckon you're okay if not then there are some things to consider :


Will they be logging in with an email account?

How will you protect the data transfer from client to server that contains sensitive information?

What if they forget their password?

How will they be able to prove they own that account?

How will you monitor the database for any breaches?

If your database gets breached, how will you notify all users?

How will they be able to access the Privacy Policy?

How will they be notified if the Privacy Policy gets updated?

That's just off the top of my head, there are people that know loads more about this than I do.

Comment

People who like this

0 Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Damiiiii7 · Jun 30, 2018 at 08:45 PM 0
Share

Yeah, i thought about all that stuff, but I am a beginner, and I am just doing this as a project. I know that there are a ton of security breaches such as sql injections or even somebody creating one million accounts just because he can. What i did for now only asks for a username and a password, and then registers the account.

Also, another option that I thought about is registering the highscores like in an old arcade machine. When the player dies, just ask for a name (not unique stuff) and register it in a table. Also, the table can have a limited number of entries, so it's less vulnerable to going to extreme dimensions.

avatar image Tobychappell Damiiiii7 · Jun 30, 2018 at 09:04 PM 0
Share

Ah right cool, wasn't trying to scare you off, just didn't want you getting bitten.


Your arcade option sounds good.


Are you familiar/experienced with connecting to a database?

avatar image

Answer by CardboardComputers · Jun 30, 2018 at 09:11 PM

Hello!

If you can't host your own server, you'll have to find someone to do it for you. As far as I know, that generally means you'll have to rent a server, since most people don't let you run their machines 24/7 for free.


However, for testing/development purposes, I would recommend you download something like WAMP or XAMPP onto your local machine (in fact, for most of the development, I would recommend not using a release server). These packages come with a webserver host, a PHP environment, and at least one database environment; in both of the above it's some form of SQL. Once you set all that up on your local machine, you can send requests (preferably POST for security reasons) to your PHP server to read/write your database.

If you're keeping a database, you probably don't really need to limit the size, especially if you're just keeping a score and a name.


I will say, I don't think there's a better way than a remote database to keep a persistent and consistent leaderboard.


In any case, you absolutely need a server of some kind in order to do database-related stuff, even if it's just on your local machine; again, if you can't keep one running and you need the database to stay running, consider renting a server for the release version. If you can find a free service, of course, that works too.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

135 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

This is giving an error for the other client and cannot hit other client. 1 Answer

How to use NetworkManager.ServerChangeScene ? 1 Answer

Getting server status and counting connected players from outside of the server with having the IP address 0 Answers

Netcode [Command] Issues .. no errors, just not working. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges