-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Core/Module): rework mod-online-reward
* Fix overload DB * Full rework system * Add locales for mails and self texts * Support External Mail module
- Loading branch information
1 parent
6863876
commit 31963e6
Showing
8 changed files
with
502 additions
and
456 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
modules/mod-online-reward/sql/db_characters/2020_07_08_00_backup_data.sql
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,34 @@ | ||
-- baskup old data | ||
DROP TABLE IF EXISTS `_online_reward`; | ||
DROP TABLE IF EXISTS `_online_reward_history`; | ||
|
||
CREATE TABLE `_online_reward` ( | ||
`RewardPlayedTime` int(20) NOT NULL DEFAULT 0, | ||
`ItemID` int(11) NOT NULL DEFAULT 1, | ||
`Count` int(11) NOT NULL DEFAULT 1, | ||
PRIMARY KEY (`RewardPlayedTime`) USING BTREE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; | ||
|
||
CREATE TABLE `_online_reward_history` ( | ||
`PlayerGuid` int(20) NOT NULL DEFAULT 0, | ||
`RewardedPerOnline` varchar(255) DEFAULT NULL, | ||
`RewardedPerHour` int(20) DEFAULT 0, | ||
PRIMARY KEY (`PlayerGuid`) USING BTREE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; | ||
|
||
CREATE TABLE IF NOT EXISTS `online_reward` ( | ||
`RewardPlayedTime` int(20) NOT NULL DEFAULT 0, | ||
`ItemID` int(11) NOT NULL DEFAULT 1, | ||
`Count` int(11) NOT NULL DEFAULT 1, | ||
PRIMARY KEY (`RewardPlayedTime`) USING BTREE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; | ||
|
||
CREATE TABLE IF NOT EXISTS `online_reward_history` ( | ||
`PlayerGuid` int(20) NOT NULL DEFAULT 0, | ||
`RewardedPerOnline` varchar(255) DEFAULT NULL, | ||
`RewardedPerHour` int(20) DEFAULT 0, | ||
PRIMARY KEY (`PlayerGuid`) USING BTREE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; | ||
|
||
INSERT INTO `_online_reward` SELECT * FROM `online_reward`; | ||
INSERT INTO `_online_reward_history` SELECT * FROM `online_reward_history`; |
22 changes: 22 additions & 0 deletions
22
modules/mod-online-reward/sql/db_characters/2020_07_08_00_online_reward.sql
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,22 @@ | ||
-- ---------------------------- | ||
-- Table structure for online_reward | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS `online_reward`; | ||
CREATE TABLE `online_reward` ( | ||
`RewardPlayedTime` int(20) NOT NULL DEFAULT 0, | ||
`ItemID` int(11) NOT NULL DEFAULT 1, | ||
`Count` int(11) NOT NULL DEFAULT 1, | ||
PRIMARY KEY (`RewardPlayedTime`) USING BTREE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; | ||
|
||
-- ---------------------------- | ||
-- Table structure for online_reward_history | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS `online_reward_history`; | ||
CREATE TABLE `online_reward_history` ( | ||
`PlayerGuid` int(20) NOT NULL DEFAULT 0, | ||
`RewardedPerOnline` varchar(255) DEFAULT NULL, | ||
`RewardedPerHour` int(20) DEFAULT 0, | ||
PRIMARY KEY (`PlayerGuid`) USING BTREE | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; | ||
|
7 changes: 7 additions & 0 deletions
7
modules/mod-online-reward/sql/db_characters/2020_07_08_01_insert_and_delete_backup.sql
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 @@ | ||
-- Insert data from backup | ||
INSERT INTO `online_reward` SELECT * FROM `_online_reward`; | ||
INSERT INTO `online_reward_history` SELECT * FROM `_online_reward_history`; | ||
|
||
-- Delete backup | ||
DROP TABLE IF EXISTS `_online_reward`; | ||
DROP TABLE IF EXISTS `_online_reward_history`; |
26 changes: 0 additions & 26 deletions
26
modules/mod-online-reward/sql/db_characters/online_reward.sql
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
modules/mod-online-reward/sql/db_world/2020_07_08_00_locale.sql
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,13 @@ | ||
-- Add locales | ||
DELETE FROM `string_module` WHERE `ModuleName` = 'mod-online-reward' AND `ID` BETWEEN 1 AND 3; | ||
INSERT INTO `string_module` (`ModuleName`, `ID`, `Locale`, `Text`) VALUES | ||
|
||
-- enUS | ||
('mod-online-reward', 1, 'enUS', 'Reward for online %s'), | ||
('mod-online-reward', 2, 'enUS', 'Hi, %s!\nYou been playing on our server for over %s. Please accept a gift from us.'), | ||
('mod-online-reward', 3, 'enUS', 'You were rewarded for online (%s). You can get the award at the post office.'), | ||
|
||
-- ruRU | ||
('mod-online-reward', 1, 'ruRU', 'Награда за онлайн %s'), | ||
('mod-online-reward', 2, 'ruRU', 'Привет, %s!\nВы играете на нашем сервере уже более %s. Пожалуйста примите подарок'), | ||
('mod-online-reward', 3, 'ruRU', 'Вы были вознаграждены за онлайн (%s). Получить награду можно на почте.'); |
Oops, something went wrong.