Skip to content

Commit

Permalink
feat(Core/Module): rework mod-online-reward
Browse files Browse the repository at this point in the history
* Fix overload DB
* Full rework system
* Add locales for mails and self texts
* Support External Mail module
  • Loading branch information
Winfidonarleyan committed Jul 8, 2020
1 parent 6863876 commit 31963e6
Show file tree
Hide file tree
Showing 8 changed files with 502 additions and 456 deletions.
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`;
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;

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 modules/mod-online-reward/sql/db_characters/online_reward.sql

This file was deleted.

13 changes: 13 additions & 0 deletions modules/mod-online-reward/sql/db_world/2020_07_08_00_locale.sql
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). Получить награду можно на почте.');
Loading

0 comments on commit 31963e6

Please sign in to comment.