Jump to content
MakeWebGames

a_bertrand

Members
  • Posts

    3,655
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by a_bertrand

  1. As we saw from the last poll, you guys want to be able to use ajax inside NWE. However I can say that ajax is not all that fun to code, and some times it can get really messy. So instead of just throwing jQuery with the engine, and change some pages to just use it, I thought I would offer some easier access to it. That doesn't prevent you to do more complex things, simply it's some goodies which will be included with NWE (you don't like it, as always, you don't use it). First example would be a simple page which contains a part which should be updated (via ajax) every time you click on some button: <?php function PartUpdate() { echo Translate("Good you updated on %s",FormatDate()); } Ajax::RegisterFunction("PartUpdate","partToUpdate"); TableHeader("This part will be updated"); echo "<div id='partToUpdate'>"; echo Translate("Click the button to update via AJAX"); echo "</div>"; TableFooter(); ButtonArea(); Ajax::Button("Click Me","PartUpdate()"); EndButtonArea();   So how does that work? Well, you see there is a PartUpdate PHP function, which is then "registered" to the ajax framework. On top of that instead of the usual LinkButton you use the Ajax::Button function and you have to define a "div" or some other HTML area with an ID. Why? because it let the framework update this part via JS. On the PartUpdate function, you can basically have your normal PHP code, and all the output of the function (via echo) will be directly placed in the div you defined while calling the Ajax:RegisterFunction. Let's see now a module which would update every X sec: <?php function PartUpdate() { echo Translate("Good you updated on %s",FormatDate()); } Ajax::UpdateTimer("PartUpdate","partToUpdate"); TableHeader("This part will be updated"); echo "<div id='partToUpdate'>"; echo Translate("Will update every 5 sec via ajax"); echo "</div>"; TableFooter();   This time the example code is more or less like the previous one, where the major change is the usage of Ajax::UpdateTimer("PartUpdate","partToUpdate") instead of the Ajax::RegisterFunction also you don't need any button as the framework will set a timeout (with refresh rate of 5s by default). Last example, is a bit more interesting and let you pass back browser fields or other back to PHP:   <?php function PartUpdate ($a, $b) { echo Translate("Result: %d", $a + $b); } Ajax::RegisterFunction("PartUpdate", "partToUpdate"); TableHeader("This part will be updated"); echo "<div id='partToUpdate'>"; echo Translate("Result: %d", 0); echo "</div>"; echo "Value A: <input type='text' id='valuea' value='0'><br>"; echo "Value B: <input type='text' id='valueb' value='0'><br>"; TableFooter(); ButtonArea(); Ajax::Button('Click to sum', 'PartUpdate($(\'#valuea\').val(),$(\'#valueb\').val())'); EndButtonArea();   As you can see, we have now 2 fields (outside the div which change content) and we pass the value of the fields via JS inside the Button call. What the framework do, is basically recreate a JS signature which is similar to your PHP signature, which means you could call the PartUpdate inside JS and actually call the PHP function transparently. Isn't that cool? I will work also on further integration like "panels" or "windows" with content loaded via AJAX, if you have other ideas / wishes, please share and I shall see how to make it easier to use. Feedback / suggestions / constructive critics are welcome.
  2. - Fixed the location (check the module manager you should be able to get the new version from there) - The exploration works. Simply now you have to click on the image to actually explore.
  3. Why not check how others do it? http://mystikrpg.com/
  4. Ok will check it tomorrow. Wonder what I made there...
  5. An official game will come quiet certainly but I don't rush for it. I mean, better to have something good in a couple of months than having yet something totally boring. The story for an official game is ready, or the base of it, it needs modules to support it and it need content too. So still a bit of a road. I would say for a good official game, end autumn this year is a good time frame if not winter. If you wonder if we will release a package with the game content (of course without players info, just the game), then yes we plan to do so which should be at the end the official NWE package.
  6. Thanks rulerofzu, Currently NWE is slowly reaching the last mod requirements for one of the first planned game, therefore I can't wait to see it live ;) It's owner shall talk about it if he want to.
  7. Hi, The version 1.0.5 is available from your license area and as always can be downloaded as upgrade from 1.0.4 or as full zip. In this version: - An improved admin panel with a right side panel to jump from one area to the other - A small module called speed puzzle which can be used as either a bot captcha or a small little game. - Mines which let you harvest raw material (used later on for crafting) - Location module which let you have like towns, and move from town to town with NPC, shops, mines visible in towns. - Improved module manager which let you download / upgrade modules directly from the module. - Keys and table configuration also directly available from the module manager. What shall come after this release: - Start the work on the ajax / dynamic. - Crafting module. - Improvements over other existing modules. Cheers!
  8. I decided to go without sound, and the skip link appeared like... 50 sec after...
  9. It's not a question of server, it's a question of your "animation" which is too long to complete before you actually can skip it.
  10. Honestly, the loading of the page is annoying. Sure you tried to add some animation and whatever, but it's simply way too long before I can skip. Then once I'm on the home page (finally) there is NO INFO, I don't know what the game is, I have no clues what kind of thing it is, no way I register on such game. Sorry, left, not even tried.
  11. Ok lucky enough jquery is under MIT license and not only GPL otherwise it would not be possible to include it. Why? Because if you use a GPL software within your project your project must be under GPL as well which would be a show stopper for me. On the library level, sure 100Kb could be somewhat annoying, however it should be a one time per site loading or, you may even point to a copy located somewhere else with the hope the player already downloaded that one. JQuery has indeed be created for good reasons, as you said Spudinski, and it was both to create some sort of abstraction layer and remove the pain of such stupid browser compatibility, add a CSS selector to JS as well as easy up animations (what people think jquery is, where actually the framework does more than simply fade and movements). So does it make sense to use jQuery instead of recreating the wheel? Yes, however knowing how a wheel works is also important ;) finally, there could be some issues if you need to learn jQuery AND JS as you actually need to know both to really code with jQuery, or maybe jQuery does make the learning process easier... I don't know.
  12. It's a bit like a DIFF, and of course you could have such system or simply an if with yet another GetConfigValue access. Anyhow due to the result of the pool it's more or less clear you guys like the ajax idea, therefore I will check what to do in that direction.
  13. no illusions that should be right as it checks the number of results (rows) the query gives back.
  14. because it's not $_GET[''REMOTE_ADDR']; but $_SERVER!   $ip = $_SERVER['REMOTE_ADDR']; $checkuser2 = mysql_query("SELECT * FROM `grpgusers` WHERE `ip`='$ip'"); $ip_exist2 = mysql_num_rows($checkuser2); if($ip_exist2 > 0) { $message = "<div>Your IP is already being used by another account on MafiaHeros.</div>"; } if (isset($message)) { echo Message($message); }
  15. It can provice a smoother user experience or... actually be negative if not well implemented (which honestly is not all that easy at the end).
  16. Well actually I was also wondering if I shall use jQuery or not. Even if I don't like much jQuery syntax it does help by removing some of the JS pain. On the other side, a simply ajax call is not all that complex, and I could write it without the need of any 3rd party library. So, that could be a second step question, if Ajax is a wished feature for the engine.
  17. Hi, As the engine is growing, I was wondering how many of you would like to have some more "dynamic" kind of result, for example, having the jail time updating, or modules working with ajax and maybe some base ajax functionality offered by the engine itself. Now to make things a bit more clear, of course well done ajax website can bring a new dimension to the website, where poorly crafted one can actually make things just more complex for the user. On the other side, if you add ajax to the engine it may make things more complex to develop too. As the engine is ultimately not for myself (I'm mean I develop it but you guys will be the customers), you should choose what you would like to have. Ajax or not? Don't ask for "let it be configurable" as either a page has some understanding of AJAX some dynamic or it doesn't.
  18. I'm currently using myself an android (ICS) phone. Yet for the games, I don't play, it's more games for my kids, and certainly not online. So like sheep, and other small games.
  19. Not only it's on 2 lines, but on top of that the escaped variable is not used... it's the just tag stripped one.
  20. Not good=> $avatar2 = $_POST['avatar']; mysql_query("UPDATE users SET avatar = '$avatar2' WHERE username='$username'"); Bad=> $status=strip_tags($_POST['status']); $avail=mysql_real_escape_string($status); mysql_query("UPDATE users SET avail = '$status' WHERE username='$username'"); Etc... check yourself ;) NEVER EVER let GET, POSTS, COOKIE info go inside a query without some checks / escaping. That's why people today should use MySQLi instead of the old library.
  21. Spudinski: by posting on the forum you agree explicitly to the rules of the forum which are, off topic posts, or too offensive posts will be deleted for example. If you don't agree on the rules (as we stated MANY TIMES YET), you may simply leave and stop posting. As easy as that. Anyhow if you want a public answer of why one of your post has been deleted, for me posting an animated gif of a guy which vomit after someone else offer is more than offensive. I don't care if this is your opinion, you are simply not allowed to post whatever you want. BTW the same rule apply to everyone, to the staff as well ;) Also, instead of going crazy and posting 20x times the same thread all over scattered on the forum, post once and wait for an answer... as you see you got one, maybe not immediately at the second of your post, but at least you got one. You know, a forum is a community, when you live in a community you must accept some rules otherwise it will soon degenerate. Rules allows moderators to remove post like "buy the blue pills" or whatever it is, as well as other kind of contents, yet it would be even better if you guys do understand that hurting the feeling of somebody else without actually giving any real reason is not a good post and shall be deleted as well. Posts like "this is sh*t---------" (the minus as the post was too short) is not a good post nor an acceptable behavior unless it was a thread with an image and it was requested to identify it. So as much as you don't like when we post negative things on your thread, refrain / stop to post just negative things on other threads without an actual content.
  22. Well missing the screenshots.... on the mccodesmods.com
  23. For those starting with the NWE engine, I suggest you to check the module creation tutorial found on our wiki pages: http://www.nw-engine.com/wiki/index.php/Step_by_step_module_creation It shall guides you along the whole process of the module creation, by using the module wizard, and produce at the end a simple module which shows the list of all the users inside the game with tweaks and even links to other modules. I tried to be as complete as possible with this tutorial, however if some parts are not clear enough or you need more explanations let me know and I will try to help you further as well as try to improve the tutorial. Feedback, comments and requests are of course welcome ;)
      • 1
      • Like
  24. Ok should be fixed. Let me know if any of you discover other oddities.
  25. Ok don't worry, simply the dev engine is missing the function as there is no hook cache in it. You may fix yourself the problem by adding the following code in common.php:   function CleanHookCache() { }   I will release a new version today with the fix. Thanks for the report booher.
×
×
  • Create New...