- Home /
Unable to get high scores
I have created a server side high score table using the Unify tutorial http://www.unifycommunity.com/wiki/index.php?title=Server_Side_Highscores
This works great in my editor, but when I build it hangs on loading scores. As it is in the WebPlayer I cannot see error messages, but it looks the same as when the editor could not find my crossdomain.xml file.
The crossdomain.xml is in the root of the server and to make sure the game is in the root too.
If the editor can use it I would have thought the build version would find it too.
Is there a way to turn on debug mode on web builds to see if there is errors?
You can see the problem here. This is no where near finished.
Answer by MartinCA · Jan 01, 2012 at 05:03 AM
For web player debugging, refer to this article - http://unity3d.com/support/documentation/Manual/Web%20Player%20Debugging.html. Do note that for Win7/Vista, the UnityWebPlayer log files are located in OSDrive:/Users/UserName/AppData/Temp/UnityWebPlayer/log
And for a side note - the method depicted here for handling highscores is very unsafe. While it is a good tutorial to get started on working with Unity and remote web servers, it is not something I would use for a production build. The scores are managed on the client side, and the user can easily spoof the scores by sending a fake submit request. Hashing the request has no effect here since it too is done on the client side in JavaScript - which is a plain text script anyone can view and see the hashing algorithm.
The best practice would be to do all the score logic on the server side through remoting - but on small scope projects that is only feasible for UI games / applications. You probably don't have the resources to run a dedicated session server to keep track of all the game states :)
The second option would be to encrypt the score value in the Unity player before transmitting it, and decrypting it on the server side. That method still works on the client side, that is true, but disassembling a Unity project or deciphering your encryption protocol will take more time than simply clicking "View Source" on a web page. And to add a little more security to that, obfuscate the scores when stored in your application memory to make it more difficult to simply memedit the player.
Remember, as a general rule of thumb - ANYTHING on the client side is visible to the user. The question you should ask yourself is what method is the most cost efficient, and for the most part, adding some basic encryption to the client side will suffice.
Btw, I tried to run your game, but it doesn't work. The play button doesn't do anything and the highscore table displays loading all the time.
I know I went a bit off-topic with that, so excuse me for the long read and good luck with your game :)
Happy new year!
Hey there and thanks for the answer and Happy New Year to you too.
I have had a look at the debug site before posting the question but I dont have a log folder on Windows 7, its not where its stated on the wiki.
Yeah the problem is that the game wont pull down the high scores and sits at Loading Scores. But this is only on WebPlayer, when I compile to standalone or run in editor its fine. Also a bit concerned about you saying the "Play" button is not working as its working for me.
I am just a uni student having ideas and trying to make them work and if they make a fun game thats even better. Plus its all good practice for Global Game Jam in a few weeks.
This turned out not to be a Unity problem but a webhosting one. Becuase my webhost truncated the www of the web address this then stopped it from finding the crossdomain.xml
Your answer
![](https://koobas.hobune.stream/wayback/20220613062538im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Crossdomain policy trouble 1 Answer
Yet another case of Unity Web Player Crossdomain.xml troubles 5 Answers
WWW doesn't work on localhost eventhough crossdomain.xml exists 1 Answer
What is most efficient way to store 'high scores' in game in unity? 1 Answer
Server High Scores - crossdomain.xml 1 Answer