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 /
avatar image
0
Question by Venceremos · Sep 13, 2014 at 01:27 PM · webplayerloginsaveload

Unity Web Player Account System

I want to create a game on web platform. The game is not multiplayer, so there is no need to any server. But I want save player data for each player and I want them loggined to my game. I am not sure about how to do that. Is this following pattern is good?

  1. In Assets/Resources folder, create a text file (called users.txt in this case) which contains player username password ..etc. Read this file on start then compare player username and password with them if it matches one of them, then player can be logged in.

  2. After game play, save player data to a file by serializing player data with a consistent file name, after player relogged in, load this file.

Now. I know first method is not look safe but I want to know is this file (user.txt) a shared single file for each client. Do I need to check for the file if is in use..etc. When hundreds of users attempting to open the game via browser, are many file read operation occuring on one single file? How this process working? Can I find a technical guide or documantation for this process.

Thanks in advance and sorry for my bad English.

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
1
Best Answer

Answer by Sisso · Sep 13, 2014 at 01:39 PM

Shor answer:

Have a server or is better forget to use web or authentication

Long answer:

You can't simple keep changing the users.txt file in resource because every change will need a new build and deploy of binaries. Futher, your players will need to download/update the game each time.

You can remotly download the txt file from a server, but is hack it a kid stuff, even encripted, because the decript code (and its key) is running in client side. The best aproeach is auth in external server.

For persistent storage you can't write to files in web container. (http://docs.unity3d.com/Manual/SecuritySandbox.html)

Your only storage places are external servers, cookies and html5 sotrage data (http://www.w3schools.com/html/html5_webstorage.asp).

Even with external server you can have some problem to access different domain.

Because you didn't access files directly how the server/browser manager its access and paralelism is not your concern. But its very documented in any library, database or operational system that you woul desire to use.

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 Venceremos · Sep 13, 2014 at 01:48 PM 0
Share

O$$anonymous$$. I can implement a Server. I can write a web service too for authentication which I did before. But what about the game data. Is a web service good choice to use for save/load game data.

avatar image Sisso · Sep 15, 2014 at 04:01 PM 1
Share

Yes. I think that your cocern is only if your have save to much data, because the storage cost and upload time.

Take a look into https://parse.com/docs/unity_guide, they have a very good free plan.

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

How to save data to selected save slot 2 Answers

Question Regarding Don'tDestroyOnLoad Object 1 Answer

How to save and load the state of dialogue when changing scenes 1 Answer

How To Save and Automatically Load each Toggle CheckBox Value ? 1 Answer

WWW Error in Web Player 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