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 MadRobot · Dec 25, 2012 at 05:16 PM · networkingmysqlphphighscore

Unity CrossDomain.xml Still Required? What is wrong?

I am trying to make a highscore system in Unity. Nothing I have found here on Unity Answers, or in the Unity Manual, Reference or Scripting API has an answer that I haven't tried.

I am getting several errors, neither consistently. The first is the 'crossdomain.xml' policy file not found error. The second is the return data is empty. I know the MySQL db is setup and populated with data as we have been able to test it out manually and retrieve our highscores.

Everything is located on the same server. This tells me I shouldn't need crossdomain.xml, but I have one anyway because it wasn't working without it. Still isn't.

crossdomain.xml looks like this. I edited it using Notepad and use Save As to ensure it's encoding is UTF-8.

 <?xml version="1.0" encoding="UTF-8"?>
 <cross-domain-policy>
 <allow-access-from domain="*"/>
 </cross-domain-policy>

The crossdomain.xml file is located on the root of the server, where it's supposed to be.

We use this C# code to make the request for the highscores.

 StartCoroutine (GetScore());

We use this C# code to execute the request.

 public IEnumerator GetScore() {
   int retrieveLimit = 10;
   int level = 1;
   WWWForm form = new WWWForm();
   form.AddField ("limit", retrieveLimit);
   form.AddField ("level", level);
   WWW www = new WWW("www.sampleserver.com/path/getHighscore.php", form);
   yield return www;
   // do stuff with www.text (shown below)
 }

getHighscore.php is located in a folder with the game. To pull highscores we are using this php code to talk to an MySQL db:

 $query = "SELECT * FROM ScoreTable WHERE level=$level ORDER BY score ASC LIMIT $limit";
 $result = mysql_query($query);

When we go to read the retrieved highscores, we find nothing. (C#)

 String s = www.text;
 Debug.Log ("found: " + s); // shows nothing

Or we get the 'crossdomain.xml' policy file not found error.

Can anyone please tell me what I am doing wrong? I've been working on this for several days. I've googled and searched everything I can find. I've scoured UnityAnswers, Unity Forums, the Unity Script Reference, the Unity Manual, and the Unity API Reference. I have downloaded 3 different HighScore packages from the Unity Asset Store and gone through their code. I have done and checked everything I could find. I can't find anything wrong. What's left to try?

Thanks

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

0 Replies

· Add your reply
  • Sort: 

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

8 People are following this question.

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

Related Questions

Unity and a Server 1 Answer

Retrieving data from a WWW php call? 1 Answer

Unity php functions 1 Answer

help to call noramlisd database to unity 0 Answers

A node in a childnode? 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