Jump to content

xeross155

Members
  • Posts

    702
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by xeross155

  1. Well what I did can't really be counted as a proper patch, but atleast people can pull again without much trouble now.
  2. Hmm haven't noticed anything, people here have been very helpful and supportive. And they might sometimes close a thread because it's an obvious question but I'd do the same.
  3. I'll be modifying AHBot a little so it's easier for people that merge a lot of branches to see what changes belong with which modification (Primarily adding comments) might also clean up a little. I just found that AHBot adds Code C++: if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) AH->auctioneer = 23442; else AH->auctioneer = GUID_LOPART(auctioneer); To me this seems unneeded, I see it's for 2 side interaction but why would that need a different auctioneer ID. BTW Here's the diff with what I changed: http://github.com/xeross/mangos/commit/63d194e8fe5d024518c2bedd2c38c02acc31a235
  4. My branch should also still work afaik
  5. You can either commit the scriptdev2 patch changes or you can use git stash (apply)
  6. The aura column in the db definitely seems the way to go, it wouldn't be too hard to implement either.
  7. I've finished rewriting this, it now supports up to 12 items per mail, the items need to be added in the mail_external_items table with mail_id being the ID of the mail. http://github.com/xeross/mangos/tree/external_mail
  8. I did it, it's working: http://github.com/xeross/mangos/commit/5e4351fcb07dd35fb0cebafe6377704dfed59a99 thanks Lynx3d
  9. It's properly working this way just the mail->AddItem is crashing (Stack overflow). Or in other words it crashes after the query Code sql: [16 ms] SQL: INSERT INTO item_instance (guid,owner_guid,DATA) VALUES (41,0,'41 1073741824 3 35 1065353216 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 25 0 ' ) Weird, it thinks owner_guid = 0; Lemme try and fix that.
  10. Ye I forgot the sort stuff added it now, Just have the problem that the shit crashes once I add the item to the mail. void WorldSession::SendExternalMails() { sLog.outString("EXTERNAL MAIL> Sending mails in queue..."); QueryResult *result = CharacterDatabase.Query("SELECT e.id, e.receiver, e.subject, e.message, e.money, i.item, i.count FROM mail_external e LEFT JOIN mail_external_items i ON e.id = i.mail_id ORDER BY e.id;"); if(!result) { sLog.outString("EXTERNAL MAIL> No mails in queue..."); delete result; return; } else { uint32 last_id = 0; MailDraft* mail = NULL; uint32 last_receiver_guid; do { Field *fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); uint64 receiver_guid = fields[1].GetUInt64(); std::string subject = fields[2].GetString(); std::string message = fields[3].GetString(); uint32 money = fields[4].GetUInt32(); uint32 itemId = fields[5].GetUInt32(); uint32 itemCount = fields[6].GetUInt32(); Player *receiver = sObjectMgr.GetPlayer( receiver_guid ); if (id != last_id) { // send last mail if (last_id != 0) { sLog.outString("EXTERNAL MAIL> Sending mail to character with guid %d", last_receiver_guid); mail->SendMailTo( MailReceiver(last_receiver_guid), MailSender(MAIL_NORMAL, 0, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_RETURNED); delete mail; CharacterDatabase.PExecute("DELETE mail_external AS e, mail_external_items AS i FROM mail_external AS e, mail_external_items AS i WHERE i.mail_id = e.id AND e.id = %u;", last_id); sLog.outString("EXTERNAL MAIL> Mail sent"); } // create new mail uint32 itemTextId = !message.empty() ? sObjectMgr.CreateItemText( message ) : 0; mail = &MailDraft( subject, itemTextId ); if(money) { sLog.outString("EXTERNAL MAIL> Adding money"); mail->AddMoney(money); } } if (itemId) { sLog.outString("EXTERNAL MAIL> Adding %u of item with id %u", itemCount, itemId); Item* mailItem = Item::CreateItem( itemId, itemCount, receiver ); mailItem->SaveToDB(); sLog.outDebug("EXTERNAL MAIL> Item lowGuid = %u", mailItem->GetGUIDLow()); mail->AddItem(mailItem); } last_id = id; last_receiver_guid = receiver_guid; } while( result->NextRow() ); // we only send a mail when mail_id!=last_mail_id, so we need to send the very last mail here: if (last_id != 0) { // send last mail sLog.outString("EXTERNAL MAIL> Sending mail to character with guid %d", last_receiver_guid); mail->SendMailTo( MailReceiver(last_receiver_guid), MailSender(MAIL_NORMAL, 0, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_RETURNED); delete mail; CharacterDatabase.PExecute("DELETE mail_external AS e, mail_external_items AS i FROM mail_external AS e, mail_external_items AS i WHERE i.mail_id = e.id AND e.id = %u;", last_id); sLog.outString("EXTERNAL MAIL> Mail sent"); } } delete result; sLog.outString("EXTERNAL MAIL> All Mails Sent..."); } Stack overflow on mail->AddItem(mailItem);
  11. Well I kind of wrote code that just checks if we're still at the same mail by comparing the ID with the last ID I think the code should work but I got a few errors I can't seem to figure out. void WorldSession::SendExternalMails() { sLog.outString("EXTERNAL MAIL> Sending mails in queue..."); QueryResult *result = CharacterDatabase.Query("SELECT e.id, e.receiver, e.subject, e.message, e.money, i.item, i.count FROM mail_external e LEFT JOIN mail_external_items i ON e.id = i.mail_id;"); if(!result) { sLog.outString("EXTERNAL MAIL> No mails in queue..."); delete result; return; } else { uint32 last_id = 0; do { Field *fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); uint64 receiver_guid = fields[1].GetUInt64(); std::string subject = fields[2].GetString(); std::string message = fields[3].GetString(); uint32 money = fields[4].GetUInt32(); uint32 itemId = fields[5].GetUInt32(); uint32 itemCount = fields[6].GetUInt32(); MailDraft mail; Player *receiver = sObjectMgr.GetPlayer( receiver_guid ); if(receiver) { sLog.outString("EXTERNAL MAIL> Sending mail to character with guid %s", receiver_guid, itemId); if(id != last_id) { if(mail) { mail.SendMailTo( MailReceiver(receiver_guid), MailSender(MAIL_NORMAL, 0, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_RETURNED); delete mail; CharacterDatabase.PExecute("DELETE mail_external AS e, mail_external_items AS i FROM mail_external AS e, mail_external_items AS i WHERE i.mail_id = e.id AND e.id = %u;", id); sLog.outString("EXTERNAL MAIL> Mail sent"); } uint32 itemTextId = !message.empty() ? sObjectMgr.CreateItemText( message ) : 0; mail = MailDraft( subject, itemTextId ); if(money) { sLog.outString("EXTERNAL MAIL> Adding money"); mail.AddMoney(money); } } if (itemId) { sLog.outString("EXTERNAL MAIL> Adding %u of item with id %u", itemCount, itemId); Item* mailItem = Item::CreateItem( itemId, itemCount, receiver ); mailItem->SaveToDB(); mail.AddItem(mailItem); } last_id = id; } else sLog.outString("EXTERNAL MAIL> Character with guid %u doesn't exist, skipping mail!", receiver_guid); } while( result->NextRow() ); } delete result; sLog.outString("EXTERNAL MAIL> All Mails Sent..."); } I can't seem to declare mail as an uninitialized MailDraft so I got the following errors. 'MailDraft' : no appropriate default constructor available f:\\Developing\\LecoWoW\\Server\\Source\\mangos\\src\\game\\Mail.cpp conditional expression of type 'MailDraft' is illegal f:\\Developing\\LecoWoW\\Server\\Source\\mangos\\src\\game\\Mail.cpp 'delete' : cannot convert from 'MailDraft' to 'void *' f:\\Developing\\LecoWoW\\Server\\Source\\mangos\\src\\game\\Mail.cpp
  12. git reset --hard HEAD Or if you have changes you made yourself (This looks like the ScriptDev2 patch) you can also use Code bash: git stash And after updating Code bash: git stash apply
  13. I now have the following SQL query Code sql: SELECT e.id, e.receiver, e.subject, e.message, e.money, i.item, i.count FROM mail_external e LEFT JOIN mail_external_items i ON e.id = i.mail_id; Which yields the following result Now I was wondering how I should iterate over it, should I check if the id is still the same and if so add the item to the current mail and if not send the mail and create a new one ?
  14. I didn't say you had to apply it to your source I said you should read the patch (You basically read the code that way) and then modify the existing announce command to suit your needs.
  15. Does this follow the same url format as the official armory ?
  16. Are there linux distros that don't have pkg-config available ? And can't we just check for SSL headers in a few predefined locations ?
  17. Hmm, It's Zor not Gore, the sequence Gore doesn't even occur in his nickname. And I haven't encountered a genuine question being locked with a use the search reply. Lastly, I do agree a little on the pass-the-buck stuff, there's been some occasions where I thought a question could be answered here (Though I don't really remember what ones). ~Xeross
  18. I'll be rewriting this so that it uses the MaNGOS timer array, and I'll add support for multiple items per mail.
  19. Ye, there must be some sort of built-in you don't have the requirements to do this.
  20. Basically if I do a normal left join I'd get something like Mail - ID: 1 - Mail Item 1 - Mail Item 2 - Mail Item 3 Mail - ID: 2 - Mail Item 4 - Mail Item 5 - Mail Item 6 However I wonder how I could loop over the mail items then, adding them to the mail template ain't a problem.
  21. The query ain't the problem, how will I parse the result inside C++ all leftjoin examples I found in the code do leftjoin SOMETHING as SOMETHING and then refer to it as a field, but that way I'd have 30 additional fields, I'd rather leftjoin everything related to one message and loop over it. Only way I can think of now is using a seperate query for the items.
  22. Linux is more efficient in terms of memory and cpu, plus you don't have a useless Desktop Environment on it.
  23. The MaNGOS core hasn't isn't multithreaded enough, the top amount of players was 4.5k with a lot of source edits.
  24. Unprocessed tail data, or in other words it's still trying to parse it the old way.
  25. Caching would be the best way to do it yes, or by a cron job or by a cache script.
×
×
  • 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