Jump to content

Monkuar

Members
  • Posts

    987
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Monkuar

  1. You need to cast proper variables on those id's and check for integer/etc. mysql_real_escape_string wont help you from XSS. Also you need to have a primary key that is SET TO AUtO INcREMNET in that database, lol. (for new postS)
  2. When you say a persisten socket, does this mean the chat table is being queried like every second in essense?( For a chat room for example) or only when new data is available? Even if it does do it when new data is available a simple 10-20room chat room with all active users using socket.io wouldn't that just rape the server? How does MMO's do it with World/Trade chat? Thousands of active users just querying that table/refreshing it across all people, seems a bit overlord? Would this be why sometimes if u DC you lose data on ur character because it wasn't saved to Server? (Wouldn't this need to be updated like every second as well) for no data loss? How do these servers perform so good under these load, I dont get it :/ I'm am making a web based RPG, I got inventory system done with jquery/drag/drop/monster battle AI/loot functions to give loot based on char level/etc (when monster died) /etc/etc, but if I do PVP it will obviously be turned based, but not sure if I want to do comet/longpolling/simple 1-2sec ajax/socket.io.... I also looked into the server files for a Diablo 2 Private Server, they store all character data into a .d2cs file or something on the server, then that file get's written everytime a person finds a item or whatnot, (get's read and written from the client) which we don't got source code for, only David Brevik does. Also, does every windows programmed MMO/Multiplayer game have to use Winsock?
  3. I'm curious how a client or game connects to mysql and updates it. In Path of Exile, u have a item that lets you change the amount of sockets a item has. For instance, everytime when a user uses the item (They could have over 2000) on the item.... is it in essence 1 MYSQL UPDATE EACH time? (1 query)? Or how exactly does it register through the server or sustain lower optimization or performance? i know this sounds dumb, but I've always wondered this stuff. If that is true, wouldn't those queries and all the active users just rape the servers? I've looked into socket.io / etc is that kind of like the same thing as Winsocket? (Wouldn't this be even MORE server intensive with an active connection?) Just curious, I know you guys think I am clueless and have no idea what im talking about, but please... Also, im curious on why people say socket.io is better? If you have a chat system using socket.io and 5 active users. It's constantly refreshing and querying from the chat table to display all the data right? Wouldn't a simple ajax poll every 2-3 seconds would be fine? O_o I know this wouldn't really work for MMO's because it would be laggy data, but then in essence is that socket.io grabbing all the data from the chat table (querying it) every second? Wouldn't that just destroy the server @_@
  4. No it doesn't, because it just reads it as text. It spits out "5,2,1" instead of 1 rand of each. "5,2,1" is the same as array(5,2,1) but php thinks if you put in a variable array($temparray), $temparray = "5,2,1" it think's it's 1 word, it's not.
  5. $monsterdata['droparray'] = "5,2,1"; $item_id_loot = array($monsterdata['droparray']); echo 'Drop Array: '.$item_id_loot[array_rand($item_id_loot)].' This DOESN't work.... but this does: $item_id_loot = array(5,2,1); echo 'Drop Array: '.$item_id_loot[array_rand($item_id_loot)].' Why? Wat the.. Is it because it's set to Varchar in column? (mysql) Lawl, another php bug zz will report
  6. haha nice pun But seriously, my items and stuff are already in a row.. I'm just going to use the WHERE IN clause in my query, so I'm just generating these random id's to select what items they will get after the monster has died. These id's will be used in a where in CLAUSE (in mysql) to grab the item info/etc and insert their "NORMALIZED" data to their inventory/etc I'm going to have each mob have different loot, let's say Mob 2 will have a chance to get the items with the id of 2,3,5 so I just need to select a random of these to use in the where IN clause to grab all the data and insert it. (makes it very good for RNG based)
  7. Okay, so my monsters table has a column called "droparray" for example: 7,2,5 7,2,5 are the id's of the items they could POSSIBLE get when they kill the monster [intuitive eh?] I need a way to just select a random number from those 3 numbers (or any amount) AND a way to let's say if 7 was a unique item, have it a less % chance. Any ideas?
  8. Well, if u code for a living u could prob get the free classroom license lol Just say your a teacher
  9. Yeah, I could see why this game was developed/coded around 99 and 2001. Probably before that too, the origin of this game was "RYL" Risk Your Life, developed by a company called "GamaSoft". Game is a very fast-paced game, so I always wondered how they stored their equipment and inventory stuff. I guess they did it the worst way possible. Since Im creating my own rpg game. for my inventory system, it's very simple. just grab all user's items by user_id = 4 (me) and have a position column, [ 1 - 36 ] would tell each slot the user dragged the item to. Then just put those in a multi demi lovato array, and spit them out [ No pun Demi Lovato <3 ] This is what I do with my game. My only issue is that, I am not using a websocket or socket.io bcz it's not working on windows so I cant really test with it. I'm simply doing onclick ajax calls via jquery. I might do some comet, long polling for PVP battles, but not sure. I need to finish all my serverside stuff done first. now im working a Loot allocation system, which is weird because I don't want to waste queries by checking if a user owns a Health Potion already, to just increase the quantity of it, or just insert it into a new row, then update it when they go to their inventory page. These decisions and looking into how these older games stored info, makes my experience very interesting while making my game, I'm glad I did not do it this binary way. But maybe that was the Norm back then? In any event, thanks all for the replies, I feel like I am at closure now, great info lol. I was always curious about how they stored their stuff. Looks confusing as crap imo. Unless we got source code of their C File to decode it all? But still wouldn't really matter, Im never doing it this way, rather I just add a new row.. lol Btw, I'll be looking into that pack function, seems pretty close to what they did within their c file. Ty Kicken! (Plus it makes me feel kinda cool to do it that way, but i bet optimizations as in-compared to other functions are terrible scaled) Edit: mac_gyver You actually joined on my bday, ironically u got the best answer solved for this topic, lol !
  10. Yeah but I don't got time to edit/fiddle around some editing program, I just right click my files, notepad++ and go, no need to mess around with colorizing stuff. Notepad ++ is already colorized every language onclick from the language dropdown menu Plus PHPStorm is bloated :/ and costs $.. http://www.jetbrains.com/phpstorm/buy/index.jsp
  11. PHPStorm is a joke unless you like unreadable rainbow colors. Notepad ++ is clean and has plenty of plugins to support it. Been using it since I was like 15
  12. Even I am still here, don't leave out of just a frivolous ordeal, I've been hammered and verbally abused here as well. I aint leaving, lol. This place still has very smart PHPer's someone has to submit
  13. Been looking at the mysql patterns for this very old game that was made in 1999-2001 called "Return Of Warrior" (Downloaded some private server files and checked how they stored the equipments and items for players) Looked into their mysql column for users equipment and it was a binary code: (0xB62600000000B7260000000000000000000000000000B5040000BF230000). And the user only had a 1h Sword with 2-5 damage on it, etc. (Weird?) How is this data read and stored? Would i need the source code in c++ to read it out? And for users inventory it looks like this: So i'm just wondering, what kind of storing method was this and wouldn't be terrible for scaling and pulling data? For my game, I have a simple user_equip_items and user_misc_items (for potions/scrolls/enhancments/etc) and equips for gear. And then just calling them from the table.... How would all this work via the way the binarycode does above? (I've always wondered this) Btw, the game is coded in c I believe. AND to make this Question PHP Relevant!.... How would we read and store this binary data in PHP? (Example, getting a 2-5 dmg 1h sword from that equip field data lol) The real question is, were the developers very smart doing it this way? Or stupid? (serious question btw)
  14. Don't know if this is a very intuitive approach to this issue but it seems to work fine? //Unique Bosses/etc.... $randmobchance = mt_rand(0, 100); if ($randmobchance <= 5) //5% to Grab a Unique mob... { $spawnmobs = $db->query('SELECT * from nrpg_monsters WHERE level >= 1 AND zone = '.$zone_id.' AND grade="Unique" ORDER BY RAND() LIMIT 1') }else{ $spawnmobs = $db->query('SELECT * from nrpg_monsters WHERE level >= 1 AND zone = '.$zone_id.' AND grade!= "Unique" ORDER BY RAND() LIMIT 1') }
  15. View Counters OP lol

  16. Okay, I have a table called: "monsters" and it has 5 mobs. (rows) Only 1 is a Unique mob with a grade column set to "Unique". The following query will select a random mob (someone entered the dungeon for their specific zone (map)) SELECT * from nrpg_monsters WHERE level >= 1 AND zone = '.$zone_id.' ORDER BY RAND() LIMIT 1 But the problem is, By this logic query, the UNIQUE mob has the same chance to spawn as all the others, lol. How would I make, let's say the unique mob spawn < 10% with this query? his id is 5. The point im trying to make is, I use this info to insert it into a monster_active table, so users can actually kill their own mobs and level up/gain exp on my game.. I dont want users to have the same chance to spawn a unique mob as a Normal or Magic mob...
  17. Wow, exactly what I was looking for. That code is very easy to read as well. (I always get lost in foreaches, but this is very simple for me, thank you) I'll be making the lvl 19 lower than 6% chance though just because I want +20 to be end-game material. Marked as solved, didn't know you guys were still active here thank you a lot.
  18. Need a little help here for my game. Let's say you can upgrade items... I want users to upgrade to level 20. Let's say, +1 is 80% chance and to get it to +20 would be 2% chance. How would I go about this? I would also need variables to use, let's say crystals they need to use to increase the % of upgrading by XX %. Ty
  19. not a animal abuser..

  20. Loving the new boards

  21. yeah it probably depends I guess who is hosted with them or whatnot, but you have see, that guy got null routed for 24hours and was trying to get customer service to help him and get information from the attack and was denied plenty of times, that == horrible customer service i know and agree with you. your experience with them are probably great and they might be a good company but all companies have weaknesses and stuff. the point i was trying to make is that Nyphrex just cant come in here and say "Hey This hosting provider is great!" and say "It was Linode!" w/o any sauce or anytype of review or confirmation that he actually has sites hosted with them, which indeed makes his point completely useless, until I stepped in and gave him a full out negative review, just proving my point that he should atleast make an effort to explain "WHY" that host is good. (forgive my grammar...) Now, if that user had a "GURU" tag or something to show proof that he was reputable or known , then yeah I wouldn't of replied, but someone just cannot come in here say "OH this hosting company is great!" w/o any sauce or legitimate review/etc/etc...
  22. Linode? Overpopulated crowded as hell with 0 customer service? Sauce: http://www.lowendtalk.com/discussion/4706/why-linode-sucks-a-personal-rant/p1
  23. FileZilla is #1
  24. oops, I meant where the aces = 11 if the total value is less than 21 or whatever, that's the only feature i don't have working, it's 100% serverside and everything works, pikachu what u mean?
  25. i've created a blackjack game, can u add me to the list too? it just doesn't support jokers yet, but does work with a mysql db for security. (no sessions, purely serverside) pretty good too. dealer stands on 17's, hit stand/run/etc.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.