Jump to content

cembry90

Members
  • Posts

    9
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by cembry90

  1. Thanks for the help. Sending mail seems to be a solution.
  2. Wow dude, that's SO much easier than the heartache I was getting over MySQL. Thank you. Edit: Wait... What? You can't use .additem in SOAP.. Well, I can't at least. Chris
  3. If you're using Windows and TortoiseSVN and have the context menu enabled, save the content of a patch as a xxx.patch file, xxx being any name you wish to give it. Then, place that file in your Mangos source folder, right click it, go to the 'TortoiseSVN' context item and select 'Apply patch...'
  4. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [b][color=red]Introduction [/color][/b] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Hello. I was wondering how to add items (vote coins - for example) to a player's inventory, using PHP and MySQL. I know this is possible, but I have had no luck finding a simpler solution than the one I have. My solution (so far) is as follows. It is sloppy, but works flawlessly. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [b][color=red]Method [/color][/b] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 1. [b]Execute a MySQL "SELECT" query[/b] on the characters.character_inventory table that reads the values for characters.character_inventory.item and sorts them descending. This gives the script the last added item. (1 MySQL "SELECT" statement) 2. [b]Execute another PHP for() loop[/b] that does multiple MySQL "SELECT" queries on the characters.character_inventory table, this time only selecting the values for characters.character_inventory.bag that are not equal to a result that we found before to get all of the character's bags . Bags are returned as '0', and up to four others, by characters.character_inventory.bag (4 MySQL "SELECT" statements) 3. [b]Execute up to five PHP for() loops[/b] that each do MySQL "SELECT" queries to find the first available bag slot for a character, by the bag number found in (2). The loop starts with the first bag, and the first slot (up to the maximum slotted bag, 36) and loops until it reaches the last slot of the final bag. (Up to 180 MySQL "SELECT" statements). 4. [b]Executes two MySQL "INSERT INTO" queries[/b], one that adds an entry to characters.character_inventory and another that adds an entry to characters.item_instance (2 MySQL "INSERT INTO" statements) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [b][color=red]Examples [/color][/b] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [b]These elements.....[/b] • Character GUID = 31 • The last entry added to characters.item_instance was given a GUID of 100 • The character has four bags, as well as their inventory. ID's are: 0, 1001, 1002, 1003, and 1004. • The character has no slots open in their default bag; the second bag has room. • The item to be added to the character has an ID of 10000 in the mangos.item_template table. [b]result in this output.[/b] 1. [10000] 2. [0] [1001] [1002] [1003] [1004] 3. [12] 4. [(adds the item to the database's tables)] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [b][color=red]Problem [/color][/b] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The only problem I foresee would be rare, but might still pose a problem once I attain a higher population than 10 players. The problem would lie in the fact that the items that are deleted from players' inventories are deleted from MySQL. If there were more than (example) 250 items deleted from characters' inventories (server-wide ; the items would have to all be the last (example) 300 items added to the table) and no new items added and then someone used this PHP script, the GUID of the newly item added. [b]Example :[/b] 1. Items with the GUID range of 100 to 500 are added to players' inventory. 2. More than 250 of those items are deleted, all in order, 249 being the first item in the table now. 3. The PHP script runs the MySQL "SELECT" statement, getting the entries in descending order. This returns the value 249. 4. It then adds the item as GUID 250. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [b][color=red]Conclusion [/color][/b] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [b]Does this matter? All help is appreciated.[/b] I have no problem sharing this script with the MaNGOS community. I will make a reply with the complete source code and instructions, once I have this working to the best of its ability. Thank you. Chris
  5. Yeah. Seeing that MaNGOS doesn't have an anti-cheat feature, I will assume there is no working one yet. Hopefuly there will be one in the future but for now, .ban it is. Thanks to all those who replied and gave their insight to this problem... Chris
  6. Not the case with my server, as I am the only account with level > 0 privileges. Thank you for your comment. Chris
  7. Searched I have; working solution I have not found. Could you point me in the direction of a solution that works for 3.3.3a? Thank you for your reply. Chris
  8. So, how did it go? Personally, I didn't see anything in the log files that looks hack-ish. Maybe I should change the log level. Thanks! Chris
  9. Thanks for your reply. I believe it is WEH. As an admin I saw 2 people flying, so I logged into a player (GM Lvl 0) account and sent them a whisper and asked them how they did that. They showed me different things they could do, and I asked them where they got it. They said to Google for "WEH", so I did and came upon the DeathSoft website. I downloaded it and ran it and to my amazement, any players (even those with GM Lv 0) can use all of the features. This includes teleport, fly, speedhack, etc... Thank you very much. Chris
×
×
  • 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. Privacy Policy Terms of Use