![](https://www.getmangos.eu/uploads/set_resources_27/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://www.getmangos.eu/uploads/set_resources_27/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png)
xeross155
Members-
Posts
702 -
Joined
-
Last visited
Never -
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Everything posted by xeross155
-
Well what I did can't really be counted as a proper patch, but atleast people can pull again without much trouble now.
-
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.
-
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
-
My branch should also still work afaik
-
You can either commit the scriptdev2 patch changes or you can use git stash (apply)
-
The aura column in the db definitely seems the way to go, it wouldn't be too hard to implement either.
-
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
-
MaNGOS database class and leftJoins ?
xeross155 replied to Auntie Mangos's topic in OldGeneral discussion
I did it, it's working: http://github.com/xeross/mangos/commit/5e4351fcb07dd35fb0cebafe6377704dfed59a99 thanks Lynx3d -
MaNGOS database class and leftJoins ?
xeross155 replied to Auntie Mangos's topic in OldGeneral discussion
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. -
MaNGOS database class and leftJoins ?
xeross155 replied to Auntie Mangos's topic in OldGeneral discussion
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); -
MaNGOS database class and leftJoins ?
xeross155 replied to Auntie Mangos's topic in OldGeneral discussion
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 -
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
-
MaNGOS database class and leftJoins ?
xeross155 replied to Auntie Mangos's topic in OldGeneral discussion
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 ? -
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.
-
Does this follow the same url format as the official armory ?
-
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
-
I'll be rewriting this so that it uses the MaNGOS timer array, and I'll add support for multiple items per mail.
-
MaNGOS database class and leftJoins ?
xeross155 replied to Auntie Mangos's topic in OldGeneral discussion
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. -
MaNGOS database class and leftJoins ?
xeross155 replied to Auntie Mangos's topic in OldGeneral discussion
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. -
What kind of hardware needs for online more than 7k?
xeross155 replied to a topic in OldGeneral discussion
Linux is more efficient in terms of memory and cpu, plus you don't have a useless Desktop Environment on it. -
What kind of hardware needs for online more than 7k?
xeross155 replied to a topic in OldGeneral discussion
The MaNGOS core hasn't isn't multithreaded enough, the top amount of players was 4.5k with a lot of source edits. -
Unprocessed tail data, or in other words it's still trying to parse it the old way.
-
|PHP| Interesting Scripts for your Website
xeross155 replied to Auntie Mangos's topic in Old3rd party projects
Caching would be the best way to do it yes, or by a cron job or by a cache script.
Contact Us
To contact us
click here
You can also email us at [email protected]
Privacy Policy | Terms & Conditions
![](https://app.statuscake.com/button/index.php?Track=rY8W3bU5Dn&Days=1&Design=6)
You can also email us at [email protected]
Privacy Policy | Terms & Conditions
Copyright © getMaNGOS. All rights Reserved.
This website is in no way associated with or endorsed by Blizzard Entertainment®
This website is in no way associated with or endorsed by Blizzard Entertainment®