
HauntedDawg
Members-
Posts
476 -
Joined
-
Last visited
-
Days Won
7
Content Type
Profiles
Forums
Events
Everything posted by HauntedDawg
-
To be honest, Majority (95%) of the time, when ever i modify a script, or write a script. I never have parse errors. Never have missing curly brackets. So, your page still displays, but the SQL query might be wrong, or a div tag is not closing, or lets say an attribute without the closing quote (EG: class="something). I do have to say, it's not about success, but productivity. Not having to go and find the little issue in your script is nice, make's development faster. When there is an issue (as stated above), usually it's quicker to find, as it's part of something being echo'ed out. Jus sayin!
-
Sorry, but I have never claimed to be the best around here, all i have claimed is that I am efficient at programming, in essence meaning that I can program at a fast pace along with neat and tidyness. And 60% of the time, the script alway's work's withy minor faults. I don't have to do huge amount's of research. Maybe once in awhile. I don't have to be asking questions. I've seen NWE code when it came out, ever since have not seen it. Haven't coded for it, but the point I'm getting at is that, if someone approached me and asked me for a module for NWE, I wouldn't need to tell them "give me 2 days to learn the engine" type of thing. But... meh.
-
I want to know if there is demand for modules, was thinking of getting back into it, but not if there is no demand. By demand, i mean that yes, you are looking for new and improved modules, wether it be a re-code of an old module, to customized modules for any type of game engine? Place your answer in the poll, if it is not in the poll, state in a post otherwise. Thanks for reading!
-
Rule of thumb: When ever having issues with a query (such as you specified not returning results). It's a lot quicker testing the query directly into phpmyadmin (or any other db tool you use) until you get what you want, then you put that query into php! PS: finally climbed off your high horse now that you require help? Glad to see that! Thank you for finally asking something that is simple!
-
Help me decide on what free mod to make (poll)
HauntedDawg replied to Blade Maker's topic in Services
http://makewebgames.io/showthread.php/32837-mccode-v2-Scratch-Card-Mod-10 I think i should get back into module development for mccrap and nwe. -
Cheaper is worse. VPS is ultimately the best for a small sized game.
-
I am glad that you agree! Some people on MWG are so stuck with MCCode's, that they will try and bring you down for using "tooo much" graphics. Good job!
-
20k row's was to test, where as I highly doubt the OP has over 20k users! Previous company I worked for had 9.6million entries into the logs table, 600k of user data. Had to cross reference those. Now, as for the OP. If he used any of our methods here, he would notice no change at all, because.. as I said, i doubt he has over 20k users.
-
Would you ****ing quit posting **** that does not concern the OP's issue? Telling them to move host? *** is wrong with you? Are you going to tell him to move host again when the next host is worse? Rather fix the ****! FFS! Stating that you "promise" the issue won't be resolved by the changes as said. Clearly show's your incompetence.
-
Limit 1, would result in 1 entry being returned. @Alan, 3 sql queries? Uhm, no, please. $draw = mysql_query('SELECT `usr`.`userid`, `usr`.`username` FROM `users` `usr` LEFT JOIN `userstatistics` `draw` ON `usr`.`userid` = `draw`.`userid` WHERE `draw`.`draw` != 0 AND `draw`.`userid` => FLOOR(1 + RAND() * (SELECT MAX(`userid`) FROM `users`)) LIMIT 1'); $draw = mysql_fetch_assoc($draw); echo 'Winner is: '.$draw['userid'].' :: '.$draw['username']; Tested on a dummy table with 20k rows into the users, and 15k into the userstatistics, results returned within 0.0012 seconds.
-
To replicate the issue: Click on login before the browser is finished loading, this then does not kick in the javascript it seems.
-
Yes, we have the jquery ".unload()" function for this. $(window).unload(function() { alert('Handler for .unload() called.'); }); Google Analytics use the same concept for tracking of users, when closing a tab, it sends a request to Google Analytics to kill your session and that's where they get the "Time on site" from. PS: Just read up that sometimes jquery unload does not get called, so let's rather use onbeforeunload: window.onbeforeunload = function() { alert('Bye Bye'); }; You can google "javascript trigger event when closing browser"
-
Unfortunately, MCCode's has taught some bad practice coding around here. I too was prune to it, I too added all columns into the users table. I see it still happening today, and that's some website's which don't even know about gaming at all! Anyways, your idea of moving the columns to a new table sounds right. It should speed it up a bit, it will be a tedious task, and you should do it in a development environment, than on live site. Glad to have been of assistance, you can PM me any script, and i'll do my best to make it more efficient for you :).
-
Unfortunately, we can not push data to the users browser, we could if you were using node.js, but at this point, it's not "stable" and requires quite a bit of work to install it onto your server. The only best method i suggest, is a 5second interval? And make sure if they go inactive, that it makes the interval longer, as you don't want unnecessary requests to the server.
-
Firstly, you could ".unbind()" every other function before doing yours as such: $("#imessage").unbind().bind Or, just use the .keypress(function(event) as such: $("#imessage").keypress(function(event) { Another alternative would be to have a javascript variable, such as "submittedOnce", when clicking enter, set this to true. When your script is finished loading, set it to false. Make sure when clicking enter, that it performs a check to make sure it is false before going ahead. Something along these lines: msgsSubmittedOnce = false; $(document).ready(function() { //Do other code here $("#imessage").bind('keypress', function(event) { if(!msgsSubmittedOnce) { msgsSubmittedOnce = true; // Do your script execution here // in your success function, you would have: // msgsSubmittedOnce = false; } }); // other code here }); It all depends how you implement it, the process flow you follow. And on closer inspection to your script: When i press enter, it firsts updates the messages, then submits my message, then updates again. Completely Redundant. You should always play the script out in your head, as such: When hitting enter, submit the message, show the updated messages. Then you convert that to code. Not sure why you followed the route you have got. There are many things that are making it slow.
-
If you have firebug installed, make sure that it's not double posting, then triple, then quadruple. I have noticed when using "bind" jquery function, that if done incorrectly, what can happen is: Press enter once, sends php once. Press enter again, sends php twice. Press again, sends php 3 times. If that is not the case, the only way further is to actually have a live demo of it.
-
Ok, Re-looking at your script. It's doing too much than what is needed. When pressing enter, your submitting the message. Once it has been succesfully sent, you then retrieve the messages, adding another call to the server. What you should do, is when submitting your message, use that same request to send back the message data to the chat bypassing the second call to the server.
-
I am not sure if you even understand what the issue is here. You keep referring him to his database. The database alone is fast and should have no impact on the amount of users he has in there. Indexing can be beneficial, but to what extent? If you don't know how to do it properly, leave it, or you could make it result in being slower. The issue here seem's to be the way php is handling the db queries. @Smokey, 264 columns or 264 users in your users table? 264 columns is quite a lot if you ask me. So each time, it has to pull 264 columns, and knowing how MCCode uses the * for every mysql query, that could be one of your issues. Your best bet right now, would be to put a slow query logging system onto your mysql class. I could assist you further, but that would require further access. Until then, we are going to be throwing guesses back and forth.
-
Leave the jquery lib on googles server, it's alot faster than your's will ever be, it's also in cloud, so that an added bonus. You say that once you press the enter key it takes 47 seconds? That is your php script that's taking so long. If jquery was not loaded by the time you press the enter key, nothing will happen. But since you say it is actually triggering, by the time you have pressed enter, jquery has already loaded. Thus sending the request to your php script, and it is awaiting a response from your php to show the message.
-
It's working now for me.
-
Do you not own this forum?
-
Yes, that could be set like that. But, best sure to re-write the query string: Optimally, here we would look for the best and fastest solution for a unix time stamp to be stored. You can change the laston field to an INT, as it is faster than the date_* columns in mysql. We can let php do the dirty work with time(): $db->query('UPDATE `users` SET `laston` = '.time().', `lastip` = "'.$IP.'" WHERE `user_id` = '.$userid, $c); Or we can use your method: $db->query('UPDATE `users` SET `laston` = UNIX_TIMESTAMP(), `lastip` = "'.$IP.'" WHERE `user_id` = '.$userid, $c); Post up your slow queries, and I will be glad to assist in making them more efficient.
-
$('#textarea').bind('keypress', function (event){ if(event.keyCode == 13){ alert('you pressed enter ^_^'); } }) Works perfect for me, and make sure your input element/textarea element has an ID of textarea.
-
When there is around 25 people online, do you notice a lot of waiting time? If your hitting max connections on 30 people, there must be some sort of loop? If your using mccodes v2, or a database class, it's quite easy to add tracking onto it. You should also ask your host to extract all the "slow_query" logs for your account. To better understand your issue, you going to need to track it, so until you've found the culprit, changing host is not going to work, as the next might be worse (as you said you've experienced).
-
And to quote him: No where is he trying to "freeload".