Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by Bryon_Dillon · Aug 09, 2014 at 02:54 AM · servermysqlsecurityauthoritative

Authoritative Server With MySQL

Hello, I've read that having your project connect to a MySQL server directly is un-secure, but I am wondering if it is still un-secure if you make the server enter the db connection info at server start (Like in a GUI) so that the connection info is not built directly into the game. I'm basically wanting to serve a game on my local machine, and use a local MySQL database. Basically what i'm wondering is if the clients dont have my database connection information, is there any way that they could get it just by being connected to my server?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by nesis · Aug 09, 2014 at 05:52 AM

A common way to address this is to write a server-side script (eg in php) that takes a form submitted to it, looks for key-value pairs, sanitises the values to protect against SQL injection and invalid data, and only then inserts or updates records in the database (or returns an error that your game should handle, eg invalid data like health being negative, etc).

You might also want to encrypt the data sent, to help prevent arbitrary form submissions not from your game. But I'd only do that if your game gets popular enough to make that a reasonable risk.

Comment
Add comment · 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 Bryon_Dillon · Aug 09, 2014 at 09:14 PM 0
Share

As I understand it (and I could be very wrong) the Authoritative server is used to verify that the data the client is sending is valid or not. So I guess my question is, wouldn't you rather have the clients sending their data to the server, the server verifying the data is valid, and then the server submitting the verified data to the database rather than having the clients modifying the database directly?

avatar image Bryon_Dillon · Aug 09, 2014 at 09:28 PM 0
Share

This is kind of how I visioned this working. alt text

nw.png (26.2 kB)

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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity Member subscription game More security? IDEAS? 0 Answers

Unity and a Server 1 Answer

Create single server for multi-platform game (pc, mobile, etc) 2 Answers

Can a person be both a client and a server? (and more) 0 Answers

Data save/update/exchange for an online mobile game 0 Answers


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