Be a Supporter!

Help: Php Highscore On Ng

  • 382 Views
  • 14 Replies
New Topic Respond to this Topic
H3
H3
  • Member since: Dec. 18, 2000
  • Offline.
Forum Stats
Member
Level 21
Blank Slate
Help: Php Highscore On Ng 2006-07-10 04:28:05 Reply

hi
I am trying to implement a high score feature, but am having difficulties getting it to work when uploaded to newgrounds. I'm sure it has something to do with the cross-domain policy thing. The highscore system is done with just php.

Should I be using
System.security.allowDomain("www.my_domain
.com");
or
System.security.LoadPolicyFile("www.my_dom
ain.com/crossdomain.xml");

and the crossdomain.xml file with
<?xml version="1.0"?>
<!-- http://www.my_domain.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="http://uploads.ungrounded.net" />
</cross-domain-policy>

What am I doing wrong?

I followed the Flash/PHP scoreboard and Cross-Domain Policies from AS:main

Shaun
Shaun
  • Member since: Jan. 1, 2002
  • Offline.
Forum Stats
Member
Level 42
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-10 05:53:34 Reply

Flash Forum
however, most people just say use version on other site for highscores..
i dont know if it is possible with newgrounds.
flash forum would be the place to ask however.


// Sig Makers // WWE Fans // Tumblr //

BBS Signature
NinoGrounds
NinoGrounds
  • Member since: Nov. 28, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to Help: Php Highscore On Ng 2006-07-10 07:18:20 Reply

I think you have got a few sites ready for putting a scoreboard.

H3
H3
  • Member since: Dec. 18, 2000
  • Offline.
Forum Stats
Member
Level 21
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-10 14:38:30 Reply

flash forum directed me here~
So it's not possible for highscore feature on NG?

I remember NG used to have a highscore page for some of its games

Craige
Craige
  • Member since: Jul. 17, 2004
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-10 14:50:58 Reply

At 7/10/06 02:38 PM, H3 wrote: flash forum directed me here~
So it's not possible for highscore feature on NG?

I remember NG used to have a highscore page for some of its games

The only time it would go here is when you are writing the PHP, but this is an AS question.

DearonElensar
DearonElensar
  • Member since: Jun. 10, 2002
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-10 16:31:45 Reply

Well it's about xml which is a programming thing so... and sorry i have no clue


BBS Signature
DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-10 16:34:23 Reply

Make sure in your public_html folder you have a file called crossdomain.xml

This should be the contents:
<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>

You do NOT need either of these:
System.security.allowDomain("www.my_domain
.com");
or
System.security.LoadPolicyFile("www.my_dom
ain.com/crossdomain.xml");


BBS Signature
JeremysFilms
JeremysFilms
  • Member since: Feb. 18, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-10 16:35:13 Reply

At 7/10/06 02:38 PM, H3 wrote: flash forum directed me here~
So it's not possible for highscore feature on NG?

I remember NG used to have a highscore page for some of its games

This belongs in the flash forum, yet I'll still answer you.

I don't understand why people are stating taht highscore boards can't work on NG when there are clearly many games that use this feature.

You just need to put the cross-domain xml policy in the root directory of your site that allows uploads.ungrounded.net. Then you need to put the System.security.allowDomain function in the flash file marked to allow the site that the php file to be connected to are hosted.

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-10 16:36:20 Reply

Oh yeah, guys, this DOES belong in the programming forum.

The problem lied within his XML file.


BBS Signature
H3
H3
  • Member since: Dec. 18, 2000
  • Offline.
Forum Stats
Member
Level 21
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-11 01:06:57 Reply

Thanks GamesCool!! that worked
oh and....
Not a shameless plug but check out the dice game I made - "BS: Dice Game". Had a blast implementing the AI but it's still pretty weak. I welcome any tips on improving it.

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-11 01:13:31 Reply

At 7/11/06 01:06 AM, H3 wrote: Thanks GamesCool!! that worked
oh and....
Not a shameless plug but check out the dice game I made - "BS: Dice Game". Had a blast implementing the AI but it's still pretty weak. I welcome any tips on improving it.

You're welcome!

Hey, I happend to see that game in the portal when is was under judgement (I didn't put two and two together from this topic though)

It looks very cool. I think it deserved a much better score.

But if I've learned one thing from my games, you CANNOT go by Newgrounds for how good your game is :)


BBS Signature
H3
H3
  • Member since: Dec. 18, 2000
  • Offline.
Forum Stats
Member
Level 21
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-11 17:14:28 Reply

One more question real quick.
I have a frame that loads the high score data.
With Mozilla Firefox, everything reloads everytime that frame is returned to and works fine
BUT In MSIE, it only loads the first time. It doesn't update everytime the frame is returned to.

Know what's the deal?

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-11 17:19:42 Reply

At 7/11/06 05:14 PM, H3 wrote: One more question real quick.
I have a frame that loads the high score data.
With Mozilla Firefox, everything reloads everytime that frame is returned to and works fine
BUT In MSIE, it only loads the first time. It doesn't update everytime the frame is returned to.

Know what's the deal?

I'm going to assume you mean within your Flash, when you go to the frame where it pulls the high scores, you arent getting the new scores in IE. I had this exact problem when I first started.

The solution is simple. When you use loadvars, you just need to use a cachebuster.

So, lets say the url you were loading from was like this:
url = "http://www.mysite.com/getscores.php";
you want that to become:
url = "http://www.mysite.com/getscores.php?cache
buster=" + new Date().getTime();

That should work.


BBS Signature
H3
H3
  • Member since: Dec. 18, 2000
  • Offline.
Forum Stats
Member
Level 21
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-12 03:53:01 Reply

Works now~
Thanks again!

henke37
henke37
  • Member since: Sep. 10, 2004
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Help: Php Highscore On Ng 2006-07-12 11:52:06 Reply

--coolpoints for useing that hack to get around caches.
Just send the proper cache controll headers.
Use the header function. One of the example shows how to fix your problem and restore your coolpoints.
And please do not ask about any errors about headers alredy sent if you care about cool points. That issue is very widely known, so search instead of posting.


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.