Jump to content
MakeWebGames

KyleMassacre

Members
  • Posts

    2,921
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by KyleMassacre

  1. Here: http://api.jquery.com/jquery.ajax/
  2. Ahh gotcha. That makes more sense but I believe it would be less efficient that way. 1 row holding a quantity of 1000 of an item is less storage space than 1000 rows holding a quantity of 1 item. That is a lot of bits of data to store considering your structure looks like this: inv_id, item_id, userid, quantity. For arguments sake let's say 1 row hold 5 bits of data to hold an item with 5 in the quantity. That would only be 5 bits of data stored for that particular item. If the user had a quantity of 5 your way that would be 25 bits of data. Note that I am not an expert on how much storage it actually would be but a database is essentially a file and the more characters in the file the bigger the file is. Same concept
  3. Well for that you should look into Ajax. Now I am going to give my advice on why you probably don't need it. Judging by where you posted this and the screen shot you provided, it looks like you are using MCC. Now, unless you have modified your code to dynamically load your content inside a container of its own your pages refresh with every click of a link or button(for the most part, excluding some modules). If that's the case, why would you need this? If a user is online, chances are they are playing and clicking around etc. when they click your header will also refresh updating everything to be current. Now let's say your dead set on achieving the Ajax header. You are just adding additional server load by adding requests to hit queries at a certain interval in turn sucking up your bandwith. I mean chances are it's not a ton of bandwith but with several users it can add up. You can set a timeout checking to see if the page has focus or if it's blurred and trigger an event to help save some of them resources of the player is not actually viewing the game. But again why? When they come back again they will probably go ahead and click a link anyways, thus, setting their stats to their current state client side. I dont want it to sound like I'm hating on th idea because I currently adopted this same thing with the help from [MENTION=64684]Dayo[/MENTION] and implemented desktop notifications but it only runs if the document/window has focus and this is for an ecommerce type setting so if we are away doing something else the events won't fire.
  4. Maybe I am a bit confused but, to me it seems that your theory would yield the same result. Whether it be an insert or update, the query is being ran more than its supposed to
  5. [MENTION=71354]PharaohTools[/MENTION], thanks for the necromancy
  6. Probably because $db->fetch_single($qk) > 0. Let's break it down shall we? $qk = select count(npcid) from challenges beaten where userid = 1 and npcid = 9 $qk should return an integer. Now I assume you haven't beaten this bot before so it should return 0. So we have established in this that $qk = 0, now, if(0 > 0) { //execute this block } See, your logic has failed because 0 is not greater than 0. It is equal to 0. Now what I would suggest is to say if($qk == 0) or if(0 >= $qk) You got to remember that the alligator mouth wants to eat the bigger source of food Then he would receive an error for a column miscount but his queries are not even being reached because of his logic
  7. Well you did say you rewrote MCC to make it your own. What exactly did you rewrite? Apparently it wasn't enough to make it your own otherwise you would have come across the item_add() function or at least knew what the function was. This is is not about the money or paying for anything. I'll do it for free: item_add($userid,$r['item_number'],1); I just find it remarkable that you claim one thing but can't perform a simple insert query without the use of the function if it didn't exist. You don't have to lie to kick it here and I know you have been around for a while now. Don't worry I won't put you on blast until I need to.
  8. Wait, what???? How can you not do this ^^^ but you say this?: I mean seriously, this is some basic stuff especially if you did what you claimed to do and you would know that it is much easier to do than what you posted as an example line of code.
  9. You were right, I miss read. But you wouldnt need to "PING" anything if done right. When you send a request for data just submit a couple of parameters with the request like a userid and maybe an Authentication Key or API key if you will and check the headers for the key/value pair url --get --include 'http://yourdomain.com/somePage.php?action=someAction' \ -H 'userid: theUsersId' \ -H 'Authorization: Token token=someToken' \ -H 'Accept: application/json' Then you can create a logout feature and do something like: if let userid = json.stringForKey('userid') { let defaults = NSUserDefaults.StandardUserDefaults() defaults.setInteger(0, forKey: 'userid') defaults.setString('',forKey: 'Token'); } and just check to see if their token and userid are not 0 or nil
  10. Actually that is a lot of work :p. All you really need to do is create a global variable/constant when they login, something like this: //depending on the library used to return your json objects this would change if let userid = json.stringForKey('userid') { let defaults = NSUserDefaults.StandardUserDefaults() defaults.setInteger(userid, forKey: 'userid') // if their unique id is a string for some reason use defaults.setString() } You never want to store personal information on the device. Or an alternative is to use keychain.
  11. I wouldn't post anything u from Ravens script because there is really no telling who's script t is and it may be a licensed script
  12. That's a good idea. There are a couple ways I can think of to battle that. Maybe use some stuff for my NWE lotto found here: https://github.com/KyleMassacre/Weekly-Lotto to expand on it. Some notable things I did is: For starters to try to eliminate certain people from reaping all the wins is I took a percentage of the money spent on tickets and added to the game. This way if it's a single player just playing they will lose money. I also added a revolving lottery. What that is, is a lottery where one week someone may not win and the pot just stays the same. So if the pot is at 1,000 and no one wins then the pot stays at 1,000 the next week and adds as more people play. I also added a recent winners table which brings me to my other idea on how to prevent the same player from winning. You can search the recent players and return say... 4 rows: $db->query('select `userid` from `recent_winners` limit 0,3'); And just make sure their userid is not in the array
  13. I agree. [MENTION=50378]Guest[/MENTION] pretty much nailed it on the head. Obj-C and Swift are quite touchy and you really need to understand a lot of OOP. It's not like C# or JS type objective syntax, it has its own unique syntax that can be quite tiresome. The "!" Is what kills me 99.9% of the time with swift. But there are some familiar functions when developing for iOS like your standard conditional functions i.e if,else,else if, and switch. It also has a lot more data types that explicitly need to be defined or your method/object will fail much like C# unlike PHP where you have strings, and arrays. You have arrays, mutable arrays, dictionaries, mutable dictionaries, structs, and etc. Basically, there is a lot to learn in order to venture in this direction if you wish to make a native app not using a framework like guest has mentioned. Have fun ;)
  14. It's a bit tricky to port such things to swift/obj-c code. Also, if you don't have a Mac it can get quite pricey to develop for IOS. What you can do is use a HTML/JS based framework like phonegap for example. Or the extremely easy/lazy way is to use a nice mobile template and you can just point a webview to your site
  15. Thanks for the demo account lol. The test is too hard to read and doesn't seem to have any actual color scheme. The header doesn't match the content area and too many empty areas.
  16. Sorry, I updated my post. No one is going to be bothered to create an account and login though
  17. Nvm, noticed the post said in game. Why not post a screen shot so people don't have to register just to look at it
  18. Yes, I received your ticket and I am also looking into this. If you would like, you can just reply back to your ticket with the modules you want/need and when I get off work I can send them over through email
  19. Yes, this needs to be fixed because it seems like it more and more a problem. I have mentioned it to [MENTION=50433]ColdBlooded[/MENTION] so hopefully it gets resolved real soon
  20. Honestly you don't want that engine at all. It has been through so much and it needs to be completely rewritten and updated to be current. Every page is riddled with errors and I don't think that it's up to date with security. It almost seems as though it's not the orginal source because I couldn't imagine it being that bad
  21. I won't delete because it does have some helpful stuff that people who search may find and use the help but I will lock it
  22. More dynamic would be better so that you can set the types of alcohol to brew and all the settings for that type. Then you would only need like 3 of those functions. Also, this script can use some heavy optimizing. You call global variables where they are not even used, you stack queries on top of eachother that are updating the same table, and you flood the users table with more useless fields. You should create a separate table that hold all the stuff for the users brewing. You can create a table for that with fields such as an ID, userid, brew type, and time last brewed and use that info to determine if they can brew that type again. Basically what [MENTION=65371]sniko[/MENTION] said haha. I took too long to post and he got in while I was typing
  23. I believe you may be missing a curly brace
  24. Sites that do the pay per click thing I try to stay away from because I don't trust their services and plus I don't understand how they really work. I have always been afraid of dropping like $20 down on one of those and just seeing my funds diminish because of bots. Plus signups are only worth it if they stay otherwise you are paying for people to look at your site. I agree with some of what [MENTION=64603]Sim[/MENTION] wrote. In a way all the posts were relevant. I would safely assume that most people don't want to see a site any longer if it takes them a while for the page to load especially on a mobile device where they have a limited amount of bandwidth and battery power, and they just see the wheel spinning. What's the point of paying for someone to click a link just to get frustrated and navigate away? Firsts things first young padawan. If a site is loading up 56k speeds your about 15-20 years behind in tech and a landing page most likely has the least amount of resources being used so imagine the in game content. But yes, Facebook and Twitter are probably some of the best since you get the cheapest amount of advertising possible and its word of mouth. People can post/tweet away about your game driving their friends to your site. And I bet with some tweaking of their APIs you could even reward players for posting about your game by searching their tweets or posts for some content
  25. I don't know what you mean by "tricks" when the methods I stated were made exactly for this purpose. If you don't plan on changing your images around all the time then caching them for a few days may be a good idea for you. Also minifying your files is a good idea and you can check out some ways to do that like using something like this for an idea: http://www.phpclasses.org/package/4881-PHP-Compress-CSS-files-by-removing-unneeded-characters.html#information. There are also packages for CSS and JS
×
×
  • Create New...