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 ABraut · Jun 07, 2013 at 11:02 PM · webplayerplayerprefs

PlayerPrefs in web player are not the same

According to the script reference, "There is one preference file per Web player URL and the file size is limited to 1 megabyte." I understood this to mean that there was one file on the server. I think it should actually say "There is one preference file per Web player URL on each client and the file size is limited to 1 megabyte." I think I just wasted a whole bunch of time on something I can't use. The playerprefs are doing exactly what I want them to, but use a different dataset on every machine that accesses the page. That is completely useless for my project.

Is there a way to save playerprefs on the server, so that I can have a usable login and high score system that is the same for all users? If not, how can I accomplish that without learning three new languages to use a real SQL database? I can get things to work in C#, but I don't know or have time to learn all the SQL, Java, and/or PHP it appears I would need.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Coderdood · Jun 08, 2013 at 04:57 AM

Question 1

Is there a way to save playerprefs on the server, so that I can have a usable login and high score system that is the same for all users?

No. You can think of a Unity webplayer game as just being data that is downloaded by each player and instead of being installed and played as a standalone exe runs in the web browser.

Question 2

If not, how can I accomplish that without learning three new languages to use a real SQL database? I can get things to work in C#, but I don't know or have time to learn all the SQL, Java, and/or PHP it appears I would need.

No matter what route you take you are going to have learn something new to do this. You don't have to learn SQL, Java, and PHP but you -will- have to learn something.

If you don't care about a usable login system then you can probably get it done without learning too much more just by searching for high score systems on google. There is even an example here.

A usable login system is -definitely- going to take real database / web development skills though, especially if you want any sort of security. As its a very complicated subject to make a good login system you might seek help at a more generic resource like stack exchange where some web development specialists might be found.

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 ABraut · Jun 08, 2013 at 06:09 AM 0
Share

I was able to get what I needed, for now, with the PlayerPref, but (see above). Security is not a big issue at this point. The central, persistent data storage is my biggest concern for now, but if the project continues (the right people like what they see) it will need a real SQL database.

I have a good SQL reference (text book) that I think I can get what little I need done. I'm not so concerned about that end. $$anonymous$$y problem is that I have never been able to get the one thing (Unity or VS C#) to talk to the other (SQL database). All the documentation I've found has involved a bunch of middle-ground (PHP, CGI, whatever) that I'm completely clueless about.

If I could just get my foot in the door, making Unity C# give direct SQL commands to the server, I think I could scratch, claw, stand, walk, then run with it. I just can't seem to find that key part.

avatar image Coderdood · Jun 08, 2013 at 07:02 AM 0
Share

As explained in this answer - and I attempted, poorly, to explain above:

"Unity works just like Java/Flash or any other browser plugin in this regard. It is run on the client machine - not the server and can therefore only physically have access to the client file system. $$anonymous$$ost plugins (including the Unity plugin) restricts this access though - to prevent malicious content from accessing private user data or wreaking havoc on the drives of unsuspecting web surfers. So you have direct access to neither."

The Unity web player never executes code on the server - so to your application the server does not exist and there is no way to do anything on the server without writing code outside of Unity.

This includes persistent data storage on the server.

avatar image
0

Answer by Lukas H · Jun 08, 2013 at 07:36 AM

If you want something simple to store your data you should check out Player io

No system admin skills required, I believe you don't even know sql to get data from the database.

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

Answer by JeffScm · Jun 22, 2014 at 01:44 AM

Take a look on Parse.com

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

Follow this Question

Answers Answers and Comments

17 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

Related Questions

I am having trouble getting a web build to save out an .upp file from my code 0 Answers

How To Add PlayerPrefs Scores? 1 Answer

Number of played games 1 Answer

Get PlayerPrefs file path directly at runtime? 0 Answers

I can't save my money? :< 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