forked from FoOtY/ClassyWoW
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[z1217] Implement mass mail send infrastructure.
It expected to be used in 2 case: some gameevent must send mails at start/end, and this can be useful in game commands. Both case wil implemented in later commits. * New MassMailMgr can accept tasks for send mass mails in safe way for map update threads context/etc. * It work in way: - By provided race mask or more generic SQL query string in async query selected affected characters - At query result ready at next world tick update in safe common part of tick code some from mails from queued mas mail tasks send. - Amount mails limited MassMailer.SendPerTick confir option (10 by default). This done for prevent high server load/lags at send too many mails in one tick (mail send all existed characters in DB who match to seelction criteria) - Server wait at shutdown complete mass mail tasks. This is now slowdown shutdown lot: with default setting 10K mail send in 20 secs (10000/50/10). - But manager not persistant for server crashes so any not send mails in queue lost at crash. * Implement mass mail gm commands. New comamnds mirror related normal sedn commands: - send mass items - send mass mail - send mass money Instead player name it expect or numeric racemask or textual race/team name or 'all'. * Implement game event mail sends at event start/stop. Also implement save game event state to DB mostly for avoid send mails at resume game event after server downtime. Thanks to X-Savior for inspiring and original research. (based on master commit f5c63c4) (based on master commit 534683c) (based on master commit 35028c6) (based on master commit e2e18ec) (based on master commit 84e29e0) (based on master commit dbc97cb) (based on master commit 96df816) (based on commit 9aea987)
- Loading branch information
VladimirMangos
committed
Jan 11, 2011
1 parent
5bb35ae
commit 8a6c1a8
Showing
28 changed files
with
859 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ALTER TABLE db_version CHANGE COLUMN required_z1205_s0624_01_mangos_mangos_string required_z1217_s0636_01_mangos_command bit; | ||
|
||
DELETE FROM command WHERE name IN ('send mass items','send mass mail','send mass money'); | ||
|
||
INSERT INTO command (name, security, help) VALUES | ||
('send mass items',3,'Syntax: .send mass items #racemask|$racename|alliance|horde|all "#subject" "#text" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to players. Subject and mail text must be in "". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'), | ||
('send mass mail',1,'Syntax: .send mass mail #racemask|$racename|alliance|horde|all "#subject" "#text"\r\n\r\nSend a mail to players. Subject and mail text must be in "".'), | ||
('send mass money','3','Syntax: .send mass money #racemask|$racename|alliance|horde|all "#subject" "#text" #money\r\n\r\nSend mail with money to players. Subject and mail text must be in "".'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ALTER TABLE character_db_version CHANGE COLUMN required_z1142_s0531_01_characters_bugreport required_z1217_s0636_02_characters_game_event_status bit; | ||
|
||
DROP TABLE IF EXISTS `game_event_status`; | ||
CREATE TABLE `game_event_status` ( | ||
`event` smallint(6) unsigned NOT NULL default '0', | ||
PRIMARY KEY (`event`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Game event system'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ALTER TABLE db_version CHANGE COLUMN required_z1217_s0636_01_mangos_command required_z1217_s0636_03_mangos_game_event_mail bit; | ||
|
||
DROP TABLE IF EXISTS `game_event_mail`; | ||
CREATE TABLE `game_event_mail` ( | ||
`event` smallint(6) NOT NULL default '0' COMMENT 'Negatives value to send at event stop, positive value for send at event start.', | ||
`raceMask` mediumint(8) unsigned NOT NULL default '0', | ||
`quest` mediumint(8) unsigned NOT NULL default '0', | ||
`mailTemplateId` mediumint(8) unsigned NOT NULL default '0', | ||
`senderEntry` mediumint(8) unsigned NOT NULL default '0', | ||
PRIMARY KEY (`event`,`raceMask`,`quest`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Game event system'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.