WWW and crossdomain

Hi all,

I post here because it seems to be more people aware of this kind of things, although it is not about a multiplayer game.

Actually my questions can seem simple for most of you, but I’m a total ignorant on this. I read all posts about crossdomain and similar things, but in most cases it seems that people are running all the stuff in it’s own server and that’s not my case.

I’m trying to retrive a simple string from a page with the WWW class, I tried to use the “Server Side Highscores” script from the wiki.

The problem, by the moment, is of course the “no crossdomain.xml policy was found”, but the situation is like this:

I’m developing a webgame that will be hosted in another place later. In that place, the guys will setup a database for a leaderboard. But the webplayer/editor and the DB are in different locations during the development process.

To run tests, I need to retrieve data from a page that the DB provides, they gave something like “http:thegameplace/data.asp”, and they placed a crossdomain.xml file at “http:thegameplace” like this:

<?xml version="1.0"?>

So my questions are:

1- Is there any problem with that “.asp” or that is irrelevant.
2- There is something to do inside the Unity scripts for that crossdomain to work?
3- Is in any way possible to run the tests in this situation? (me on one location and they in another)
4- There is something server related that I need to know?, like server type, ports, anything.
5- Can the tests run both in editor and webplayer?, intended that I place the webplayer in my own server, different of that with the DB.

Sorry but I’m totally lost with this, any help will be welcome.

the sandbox page in the manual

there is also a command to prefetch the policy manualy if the port is different then the default one.

This is the line of code that appels was talking about that manually grabs the file from the destination of your choice:
Security.PrefetchSocketPolicy(hostName, port);

I know that and tried to use it although I’m not sure if I did it correctly. My main concern is I don’t know if the problem is in my side or in the server side, so I’m stuck now.

Thanks anyway.

it shouldn’t be that hard to troubleshoot, if your crossdomain is on a webserver you’ll need to make sure it’s in the root of the webserver and fetch it at the webserver’s port ( 80 ). Just use the webserver’s ip and port in the prefetch command before opening the actual connection by using a boolean.
if(Security.PrefetchSocketPolicy(hostName, port)) {
your www code here
}

If you’re looking for a simple leaderboard solution, check out the dimeRocker Arcade. They will host your game and provide an API for leaderboards and other features.

Just download the dimeRocker Arcade Unity package and follow that API.