I am using Apache server to host my Unity game. I also have a php file on the server to write game data to a database.
I have a crossdomain.xml file at the root of the server which contains the following:
I am also running 'sockpol --all' on the server.
When I call 'ret = Security.PrefetchSocketPolicy("server ip", 843);' it returns false and when the hspost = WWW(gamedataurl) call is made it returns the error 'Rejected because no crossdomain.xml policy file was found'.
I know the code is correct because when I run it using a local server it writes to the database correctly. It is only when I place the php file on the server and try to access it remotely that it doesn't work. I have spent many hours trying to resolve this issue without any success. Any help would be greatly appreciated.
There are a few comments to make.
answered Jul 19, 2011 at 06:52 PM
Graham Dunnett ♦♦
Thanks for the swift replies. I have already tried that Jahroy, both UTF-8 and ASCII but no luck. Your advice should be helpful in narrowing down the problem Graham, no that I know sockpol and Security.PrefetchSocketPolicy are not relevant for what I'm trying to achieve. I have previously tried fetching the xml file directly through the browser and that works no problem. I will look through the log files to see if that will shed any light on the problem. I will need to look into whether or not Apache can serve xml files. Perhaps you can suggest a Windows server which will definitely serve the xml file and therefore work with Unity webplayer out of the box? Thanks again guys, your feedback is much appreciated...,Thanks Jahroy and Graham, I appreciate your swift replies. I have tried encoding the xml file in both UTF-8 and ANSI and neither made any difference unfortunately. It is good to know that 'Security.PrefetchSocketPolicy' is not need for what I'm trying to achieve Graham, could help me narrow down the problem. I have also tried checking if it is delivered directly and it is...I will need to look into configuring Apache to serve XML files. Perhaps you could suggest another Windows server which will definitely work in this way?... Thanks again guys...
answered Jul 19, 2011 at 07:34 PM