Jump to content
MakeWebGames

sniko

Members
  • Posts

    2,210
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by sniko

  1. I don't know why you flame McCodes procedures of doing things, as I remember most of you, excluding Spudinski, having developed for a McCodes game, or at least made a few systems for the engine. Programming/MakeWebGames isn't about flaming and not giving advice, it's about sharing ideas, giving support and advice. I support the patches that come out from the McCodes team, as not only does it make developers life easier, by providing them things that they'll have to do, but allowing you to see how 1 person/group solve a solution, and you adapting on it, if need be.
  2. Why not use the function nl2br?
  3. Hi guys, When my time frees up a little, with college, I will be doing a patch for this system. It will be free for customers who have bought the system prior to the patch, and included free for potential clients. + Able to choose the quantity for each item that is needed, without doing it manually. + Able to edit a crafting procedure. + System settings. + Able to choose multiple courses. + User interface update. Thank you for your interest and time -sniko (creator)
  4. Thanks for spotting those! ** Illusions ** sorry for editing this post but i had to change 12
  5. That made it clearer, many thanks!!
  6. Just an idea, but include a story in the game...
  7. @a_bertrand - Although I agree with you 100%, I think, in this day in age, we need to take things with a different approach, sure, use the normal methods, but expand on them, and make computing much faster and logical. Anyway, I thank you for your replies.
  8. @newttster - It frees the memory that's allocated to the query. As the query needs to be held somewhere in memory, as it's put to a variable. As I stated before, select what's needed, when needed, so in the instance of player profiles, more will be selected, but not from the globals.php file, from the players profile. In my view, it depends what you select, I.E not using the wildcard (*), only list the fields you need. @a_bertrand - Although I haven't done physical tests, I've done theory, in my computing class, and how memory can be used and preserved. As explained, McCodes uses the wildcard (*) in globals to select from numerous tables, using a LEFT JOIN. The aim of this post was to cut down the redundant columns being selected, and only selecting what's needed, when needed. What I mean by this, is that some columns rely on other systems to have a change in value, and if they never use that system, it will always be default, 0. Although you've said that using 10 - 40 columns and having little difference, there is difference. "Every little helps" #Tesco ;) @Spudinski - Yeah, I am aware that a table does take more memory than columns, but let's assume that you have a user base of 10,000+. Only using the courses columns `cdays`,`course` - both int(11) - 11 bytes of data - 11 x 10,000 = X. (Maths maybe wrong to calculate the used memory, but you get the drift) As I stated before, if a user doesn't use that system, it'll stay default, 0, which in the way the column is set up, will be 00000000000 (not just a single 0, as the rest of the int has to be filled, as it's set up int(11)). So, X is unused memory, which will be using resources, when you can cut it down. Now, I didn't know about the "All associated result memory is automatically freed at the end of the script's execution.", so thank you for spotting that out! @SomeRandomBastard - Ah, thank you, I'm am just used to putting in values, and pressing 'Go', and forgetting to change the charset I hope this clears some things up, but please state that if I am wrong, I am wrong, or I have a misconception.
  9.   Sorry, that should do it now, review step 6.
  10. Following on from Database Table Design   This will help save resources, as said in the article above; 1. Run this SQL http://codepad.org/ST5AIzuQ   2. Open up education.php 3. Find this query $db->query("UPDATE users SET course={$_GET['cstart']},cdays={$coud['crDAYS']},money=money-{$coud['crCOST']} WHERE userid=$userid"); 4. Replace with $db->query("INSERT INTO `users_courses` (`userid`,`course`,`cdays`) VALUES ({$userid}, {$_GET['cstart']}, {$coud['crDAYS']})");   5. Replace this snippet if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); print "You are currently doing the {$coud['crNAME']}, you have {$ir['cdays']} days remaining."; } 6. With $get = $db->query("SELECT `course`,`cdays` FROM `users_courses` WHERE `userid`={$userid}"); $r = $db->fetch_row($get); if($r['course'] > 0) { $cd=$db->query("SELECT `crNAME`,`crDAYS` FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); print "You are currently doing the {$coud['crNAME']}, you have {$r['cdays']} days remaining."; mysql_free_result($get); unset($r); }   7. Save education.php 8. Open cron_day.php 9. Find; $q=mysql_query("SELECT * FROM users WHERE cdays=0 AND course > 0"); 10. Replace with; $q=mysql_query("SELECT `course`,`cdays` FROM `users_courses` WHERE `cdays`=0 AND `course` > 0"); 11. Find; mysql_query("UPDATE users SET course=0 WHERE cdays=0"); 12. Replace with; mysql_query("DELETE FROM `users_courses` WHERE cdays=0");   And that's it... -sniko
  11. $_POST['fee'] = preg_match()("[^0-9]",'',$_POST['fee']); $_POST['fee'] = preg_match("[^0-9]",'',$_POST['fee']);
  12. Although this has been pointed out within the community numerous times, I thought I'd write an 'article' on it... Within McCodes Version 2 - Unsure with other versions, the database table designs are poor, in my opinion. Let me explain; Let's look at the most infamous table of them all, `users`. In one of the main files, which are called upon on every request a user makes on your site globals.php, everything (All columns) are selected - with a condition, a userid session, set when you log in - authenticate.php. So, In the base McCodes, it would select 68 columns, on every single request the user makes, just from the users table. You may think, but I need all those columns, and having a Left Join will simply do no help. So, let's take a little snippet from the `users` table. course cdays gang daysingang jobrank fedjail forumban fb_reason friend_count enemy_count boxes_opened As all of these are default 0, and rely on other systems for a change, why don't we create a new table for each (grouping relevant ones together) and having `userid` as the foreign key, to link. Here's my reasoning; As stated before, they rely on other systems for a change, so what happens if they don't use that specific system whilst playing, for example, they never get forum banned, or they don't donate so their friend or enemy count won't go up (pretty useless anyway, as you can use mysql_num_rows or count() with a specific condition) so this means that every time a user makes a request (Clicks a link on your game, to another page) a query to the database is made, which selects these 'redundant' columns, wasting space, and resources. So here's what I propose; We, developers, game owners, whoever, makes a table for these columns (grouping relevant ones together) to save resources and space, possibly resulting in saving money. Here's one for courses The SQL This will take out the two 'redundant' columns from the `users` table, resulting in only 66 columns being selected at each request from the `users` table. 1. Insert data into the new table `users_courses` when they start a new course 2. Select the data when needed 3. Use mysql_free_result once finished with selecting from the new table to free memory Now, if we did this, or better yet, it was set up like this, we'd be saving a lot of resources each request a user makes. Shame it wasn't set up like this, as it would take a while to implement, especially for games that have been edited, with new features/systems.   So, as a community, here's what I propose; Whenever we create a system, for McCodes, or not, we try our very best to not insert more columns into the `users` table, but create a new table, like the one I did for `users_courses`. I'm not telling you what to do, I'm advising you, as users, In my view, will get a better playing experience, from a faster response. Your views? -sniko Systems Courses
  13. I quite like the idea of doing it yourself, a sense of achievement. If you manage to do it all, and it works, as intended, great! If not, well, you tried, and learned, I bet! Anyway, I can see it being cool, and such, but I read somewhere about short tags not being supported in some browsers, or whatever, so, to be on the safe side, edit those.
  14. #content { width: 500px; height: 500px; overflow: scroll; } <div id='content'> something something something something </div> I'm not that good with CSS, but give that a shot
  15. Run me through the process.... Login > TOS - or - Login > White Screen - or - White Screen
  16. <?php session_start(); //some code $_SESSION['username'] = $inf->username; ?> I don't see why that wouldn't work... ? Make sure you have no syntax errors within the code
  17. $something = <value>; session_register("something"); -to- $_SESSION['something'] = <value>;
  18. hehe Bert, I didn't know all that technical stuff (not the customization) but I find the phone really handy, as I have an xbox, and Facebook, so it suits me well! I also love the interface, so that maybe why I'm drawn to Win 8.
  19. I have a Windows phone, and I think it's better than Andriod and iOS (+ all the others) and Windows 8 does look pretty cool. I think I'll be the first to buy it out of us three then :P
  20. sniko

    Game time

    Sounds like a cool idea! Is this a request or....?
  21. Check this video
  22. Here, try this version Hosted at codepad. Edit Thanks Djk, for spotting the link error
  23. It sure has potential. Here's my view; I feel that the icons (Guns and notification icons) are too big. I also get a sense of the template not flowing with other elements, they seem to be there, to take space, but you haven't thought of 1 style of the template, you've mixed a few styles. That's my view.
  24. Line 84, change to Points Cost: <input type='text' name='hPOINTS'' value='{$old['hPOINTS']}' /> To fix the bug found by Newbie
  25. Try; <a href='filename.php?action=userlevelform'>User Level Form</a><br />
×
×
  • Create New...