Jump to content
MakeWebGames

Which Do You Recommend/Ajax


gmoore

Recommended Posts

Which Ajax demo (having not looked at anything Ajax in here) would you recommend for me to use as a basis for toggle buttons to change options on a template header? Example: Red Button/Blue Button/Green Button for default theme to save into a player preference field.

Thank you,

Greg

Link to comment
Share on other sites

No it does not use the token. $_POST["AJAX"]) && $_POST["AJAX"] == "CALLBACK" are sent with the ajax call to the index.php (line 357) if they are there, it will not include the usual stuff, but rather attempt run the registered function. See libs/ajax.php

I am still exploring the ajax functions, bet Alain can provide more details

Link to comment
Share on other sites

I don't care for basic things I would use Ajax for like preferences and such. I am just concern, for example, if I used it for map movement or something. But Alain I am sure knows what he was thinking. Probably nicely sitting in the documentation.

Greg

Link to comment
Share on other sites

I just hadn't looked at it until 2 hours ago. Soooooo. Was just wondering. I've used Ajax in .NET and jQuery. But these seems just as easy. So for a button to change a setting. No problem since I will only let you change your own setting. Just wondering if SOMEDAY I do a little game in it. Like Space Invaders. I would just keep state at the server level, so any Ajax coming in would be evaluated against that server state.

Actually I should just stop this dreaming, too much core work to do lol

Greg

Link to comment
Share on other sites

In NWE post form values are not covered by the token. Why? Because the game must have some ways to give back the values to the server, and how could you pre-calculate the CRC of it before getting it? The only solution would be to have a JS doing some sort of token, but we all know that JS is distributed to the browser as source code, and therefore you would just need to check what's going on to be able to reproduce the CRC of any value.

Therefore, the old sentence saying "never trust any user value" is still valid, simply the engine pre-check the GET value and let you fully check the POST one.

For a basic example, ajax_click_demo should do the trick I believe. And yes, I tried to make all this ajax / PHP integration as simple as possible.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...