Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-08-12 01:07:20 +08:00
44 changed files with 433 additions and 305 deletions

View File

@@ -0,0 +1,2 @@
-- DB update 2024_08_02_00 -> 2024_08_05_00
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|256 WHERE `entry` = 17968;

View File

@@ -0,0 +1,2 @@
-- DB update 2024_08_05_00 -> 2024_08_06_00
UPDATE `creature_onkill_reputation` SET `MaxStanding1` = 7 WHERE `creature_id` IN (17977,21582);

View File

@@ -0,0 +1,8 @@
-- DB update 2024_08_06_00 -> 2024_08_06_01
UPDATE `creature_loot_template` SET `Chance` = 50, `GroupId` = 2 WHERE `Entry` = 20783 AND `Reference` IN (14501, 24013);
UPDATE `creature_loot_template` SET `Chance` = 50, `GroupId` = 1 WHERE `Entry` IN (20785, 20786, 20788, 20789, 20790) AND `Reference` IN (14501, 24013);
UPDATE `creature_loot_template` SET `Chance` = 50, `GroupId` = 1 WHERE `Entry` = 20784 AND `Reference` = 14501;
DELETE FROM `creature_loot_template` WHERE `Entry` = 20784 AND `Reference` = 24013;
INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
(20784, 24013, 24013, 50, 0, 1, 1, 1, 1, 'Armbreaker Huffaz - (ReferenceTable)');

View File

@@ -0,0 +1,5 @@
-- DB update 2024_08_06_01 -> 2024_08_06_02
--
DELETE FROM `command` WHERE `name` = 'morph mount';
INSERT INTO `command` (`name`, `security`, `help`) VALUES
('morph mount', 1, 'Syntax: .morph mount #displayid - Change the selected target\'s mount\'s model ID to #displayid.');

View File

@@ -0,0 +1,205 @@
-- DB update 2024_08_06_02 -> 2024_08_06_03
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.8571428571428571, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 1420;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.8571428571428571, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 2914;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.8571428571428571, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 14881;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22515;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22517;
UPDATE `creature_template` SET `speed_walk` = 0.8, `speed_run` = 0.00571428558, `BaseAttackTime` = 1800, `RangeAttackTime` = 1800 WHERE `entry` = 22841;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22844;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22845;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22846;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22847;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22848;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.142857142857143, `BaseAttackTime` = 1000, `RangeAttackTime` = 1000 WHERE `entry` = 22849;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22853;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22855;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22856;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22869;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22871;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 3000, `RangeAttackTime` = 3000 WHERE `entry` = 22873;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22874;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22875;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22876;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22877;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 1500, `RangeAttackTime` = 1500 WHERE `entry` = 22878;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22879;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22880;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22882;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22883;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 1200, `RangeAttackTime` = 1200 WHERE `entry` = 22884;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22885;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22886;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22887;
UPDATE `creature_template` SET `speed_walk` = 2.4, `speed_run` = 2.14285714286, `BaseAttackTime` = 1500, `RangeAttackTime` = 1500 WHERE `entry` = 22898;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 2.14285714286, `BaseAttackTime` = 1500, `RangeAttackTime` = 1500 WHERE `entry` = 22917;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22939;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22945;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.38571425847, `BaseAttackTime` = 1500, `RangeAttackTime` = 1500 WHERE `entry` = 22946;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22947;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 2.14285714286, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22948;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22949;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22950;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22951;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22952;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22953;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22954;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22955;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22956;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22957;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22959;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22960;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.428571428571429, `BaseAttackTime` = 1800, `RangeAttackTime` = 1800 WHERE `entry` = 22962;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22963;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22964;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22965;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 22984;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.38571425847, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23018;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23028;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 2, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23030;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23033;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23047;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23049;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23084;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.8571428571428571, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23086;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.8571428571428571, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23087;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.428571428571429, `BaseAttackTime` = 1300, `RangeAttackTime` = 1300 WHERE `entry` = 23089;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23147;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23157;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23158;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23159;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23172;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23191;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23196;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23210;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 2, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23222;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23223;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.428571428571429, `BaseAttackTime` = 1500, `RangeAttackTime` = 1500 WHERE `entry` = 23232;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23235;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23236;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23237;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 2, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23239;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23288;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 2, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23330;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2400, `RangeAttackTime` = 2400 WHERE `entry` = 23337;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23339;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23374;
UPDATE `creature_template` SET `speed_walk` = 2, `speed_run` = 1.714285714285714, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23394;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23397;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23398;
UPDATE `creature_template` SET `speed_walk` = 1.1111120224, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23399;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23400;
UPDATE `creature_template` SET `speed_walk` = 1.1111120224, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23401;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23402;
UPDATE `creature_template` SET `speed_walk` = 1.6, `speed_run` = 1.428571428571429, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23403;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23410;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23411;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23412;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23417;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.714285714285714, `BaseAttackTime` = 1600, `RangeAttackTime` = 1600 WHERE `entry` = 23421;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23426;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23448;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23472;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1.142857142857143, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23499;
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 0.99206284114, `BaseAttackTime` = 2000, `RangeAttackTime` = 2000 WHERE `entry` = 23502;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.200000002980232238, `CombatReach` = 1 WHERE `DisplayID` = 901;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.349999994039535522, `CombatReach` = 0.5 WHERE `DisplayID` = 6303;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.187000006437301635, `CombatReach` = 0.150000005960464477 WHERE `DisplayID` = 9829;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 16925;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 16925;
UPDATE `creature_model_info` SET `BoundingRadius` = 5, `CombatReach` = 5 WHERE `DisplayID` = 21357;
UPDATE `creature_model_info` SET `BoundingRadius` = 2, `CombatReach` = 0 WHERE `DisplayID` = 21115;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.799999952316284179, `CombatReach` = 0 WHERE `DisplayID` = 21116;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.799999952316284179, `CombatReach` = 0 WHERE `DisplayID` = 21118;
UPDATE `creature_model_info` SET `BoundingRadius` = 2, `CombatReach` = 0 WHERE `DisplayID` = 21117;
UPDATE `creature_model_info` SET `BoundingRadius` = 1, `CombatReach` = 1.25 WHERE `DisplayID` = 5187;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.521999955177307128, `CombatReach` = 1.5 WHERE `DisplayID` = 21114;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.899999976158142089, `CombatReach` = 2.5 WHERE `DisplayID` = 11335;
UPDATE `creature_model_info` SET `BoundingRadius` = 4, `CombatReach` = 6 WHERE `DisplayID` = 19991;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.300000011920928955, `CombatReach` = 1 WHERE `DisplayID` = 21146;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.899999976158142089, `CombatReach` = 2.5 WHERE `DisplayID` = 21120;
UPDATE `creature_model_info` SET `BoundingRadius` = 2.5, `CombatReach` = 3.75 WHERE `DisplayID` = 21262;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.868054986000061035, `CombatReach` = 3.75 WHERE `DisplayID` = 21159;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.781249523162841796, `CombatReach` = 3.375 WHERE `DisplayID` = 21161;
UPDATE `creature_model_info` SET `BoundingRadius` = 2, `CombatReach` = 2 WHERE `DisplayID` = 21162;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.799999952316284179, `CombatReach` = 1.799999952316284179 WHERE `DisplayID` = 21164;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.799999952316284179, `CombatReach` = 1.799999952316284179 WHERE `DisplayID` = 21164;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.527799963951110839, `CombatReach` = 5 WHERE `DisplayID` = 20609;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.520833015441894531, `CombatReach` = 2.25 WHERE `DisplayID` = 21370;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.607638478279113769, `CombatReach` = 2.625 WHERE `DisplayID` = 21367;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.502200007438659667, `CombatReach` = 2.02500009536743164 WHERE `DisplayID` = 21373;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.213891997933387756, `CombatReach` = 0.699999988079071044 WHERE `DisplayID` = 5492;
UPDATE `creature_model_info` SET `BoundingRadius` = 3, `CombatReach` = 4.199999809265136718 WHERE `DisplayID` = 17528;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.699999988079071044, `CombatReach` = 1.60000002384185791 WHERE `DisplayID` = 21457;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.347000002861022949, `CombatReach` = 1.5 WHERE `DisplayID` = 18790;
UPDATE `creature_model_info` SET `BoundingRadius` = 2.10000014305114746, `CombatReach` = 10.5 WHERE `DisplayID` = 21174;
UPDATE `creature_model_info` SET `BoundingRadius` = 80, `CombatReach` = 24 WHERE `DisplayID` = 21145;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.458999991416931152, `CombatReach` = 7.5 WHERE `DisplayID` = 21135;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.517049968242645263, `CombatReach` = 2.02500009536743164 WHERE `DisplayID` = 21449;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.502200007438659667, `CombatReach` = 2.02500009536743164 WHERE `DisplayID` = 21372;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.420000016689300537, `CombatReach` = 1.80000007152557373 WHERE `DisplayID` = 14334;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.75, `CombatReach` = 3.75 WHERE `DisplayID` = 21252;
UPDATE `creature_model_info` SET `BoundingRadius` = 2.75, `CombatReach` = 5.774999618530273437 WHERE `DisplayID` = 21443;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.842599987983703613, `CombatReach` = 3.300000190734863281 WHERE `DisplayID` = 21416;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.80429995059967041, `CombatReach` = 3.149999856948852539 WHERE `DisplayID` = 21417;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.80429995059967041, `CombatReach` = 3.149999856948852539 WHERE `DisplayID` = 21419;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.861749947071075439, `CombatReach` = 3.375 WHERE `DisplayID` = 21418;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.041666030883789062, `CombatReach` = 4.5 WHERE `DisplayID` = 21151;
UPDATE `creature_model_info` SET `BoundingRadius` = 4, `CombatReach` = 4.800000190734863281 WHERE `DisplayID` = 18753;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.270399987697601318, `CombatReach` = 1.949999928474426269 WHERE `DisplayID` = 21454;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.805999994277954101, `CombatReach` = 3 WHERE `DisplayID` = 21456;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.75, `CombatReach` = 2.5 WHERE `DisplayID` = 21503;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.472000002861022949, `CombatReach` = 3 WHERE `DisplayID` = 21216;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.75, `CombatReach` = 2.5 WHERE `DisplayID` = 21502;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.468749701976776123, `CombatReach` = 2.02500009536743164 WHERE `DisplayID` = 21537;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.805999994277954101, `CombatReach` = 3 WHERE `DisplayID` = 19199;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.428399980068206787, `CombatReach` = 2.099999904632568359 WHERE `DisplayID` = 21196;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 16925;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.651000022888183593, `CombatReach` = 2.625 WHERE `DisplayID` = 21379;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.694444000720977783, `CombatReach` = 3 WHERE `DisplayID` = 21539;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.744000017642974853, `CombatReach` = 3 WHERE `DisplayID` = 21543;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 11686;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.468749701976776123, `CombatReach` = 2.02500009536743164 WHERE `DisplayID` = 21384;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.744000017642974853, `CombatReach` = 3 WHERE `DisplayID` = 21380;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 11686;
UPDATE `creature_model_info` SET `BoundingRadius` = 1, `CombatReach` = 1 WHERE `DisplayID` = 1141;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.138900011777877807, `CombatReach` = 0.25 WHERE `DisplayID` = 21242;
UPDATE `creature_model_info` SET `BoundingRadius` = 2.599999904632568359, `CombatReach` = 2.599999904632568359 WHERE `DisplayID` = 21112;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.468749701976776123, `CombatReach` = 2.02500009536743164 WHERE `DisplayID` = 21375;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.60000002384185791, `CombatReach` = 0 WHERE `DisplayID` = 21344;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.60000002384185791, `CombatReach` = 0 WHERE `DisplayID` = 21346;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.60000002384185791, `CombatReach` = 0 WHERE `DisplayID` = 21345;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.607638478279113769, `CombatReach` = 2.625 WHERE `DisplayID` = 20381;
UPDATE `creature_model_info` SET `BoundingRadius` = 3, `CombatReach` = 3 WHERE `DisplayID` = 21318;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.20000004768371582, `CombatReach` = 4 WHERE `DisplayID` = 21490;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.75, `CombatReach` = 1.5 WHERE `DisplayID` = 20577;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.1284714937210083, `CombatReach` = 4.875 WHERE `DisplayID` = 21549;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.434027493000030517, `CombatReach` = 1.875 WHERE `DisplayID` = 21284;
UPDATE `creature_model_info` SET `BoundingRadius` = 3.75, `CombatReach` = 3.125 WHERE `DisplayID` = 21355;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.694444000720977783, `CombatReach` = 3 WHERE `DisplayID` = 21555;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.642360687255859375, `CombatReach` = 2.77500009536743164 WHERE `DisplayID` = 21553;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.642360687255859375, `CombatReach` = 2.77500009536743164 WHERE `DisplayID` = 21552;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.1284714937210083, `CombatReach` = 4.875 WHERE `DisplayID` = 21550;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.75, `CombatReach` = 1.5 WHERE `DisplayID` = 20577;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.744000017642974853, `CombatReach` = 3 WHERE `DisplayID` = 21546;
UPDATE `creature_model_info` SET `BoundingRadius` = 2.5, `CombatReach` = 5 WHERE `DisplayID` = 18251;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.899999976158142089, `CombatReach` = 2.5 WHERE `DisplayID` = 11342;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.799999952316284179, `CombatReach` = 0 WHERE `DisplayID` = 21442;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.5, `CombatReach` = 3 WHERE `DisplayID` = 21460;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.689399957656860351, `CombatReach` = 2.699999809265136718 WHERE `DisplayID` = 21562;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 11686;
UPDATE `creature_model_info` SET `BoundingRadius` = 2.5, `CombatReach` = 3.75 WHERE `DisplayID` = 16255;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.689399957656860351, `CombatReach` = 2.699999809265136718 WHERE `DisplayID` = 21567;
UPDATE `creature_model_info` SET `BoundingRadius` = 2, `CombatReach` = 3 WHERE `DisplayID` = 21587;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.689399957656860351, `CombatReach` = 2.699999809265136718 WHERE `DisplayID` = 21468;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.689399957656860351, `CombatReach` = 2.699999809265136718 WHERE `DisplayID` = 21569;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.60000002384185791, `CombatReach` = 0 WHERE `DisplayID` = 21476;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.5, `CombatReach` = 0 WHERE `DisplayID` = 21475;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.5, `CombatReach` = 3 WHERE `DisplayID` = 15880;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.389999985694885253, `CombatReach` = 1 WHERE `DisplayID` = 15435;
UPDATE `creature_model_info` SET `BoundingRadius` = 1.25, `CombatReach` = 0 WHERE `DisplayID` = 21594;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 11686;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.389999985694885253, `CombatReach` = 1 WHERE `DisplayID` = 15435;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 16925;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.5, `CombatReach` = 1 WHERE `DisplayID` = 11686;
UPDATE `creature_model_info` SET `BoundingRadius` = 0.389999985694885253, `CombatReach` = 1 WHERE `DisplayID` = 15435;

View File

@@ -0,0 +1,6 @@
-- DB update 2024_08_06_03 -> 2024_08_08_00
--
DELETE FROM `acore_string` WHERE `entry` IN (6613,6615);
INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES
(6613, '|cfff00000[GM Announcement]: {}|r', NULL, NULL, '|cfff00000[GM Ankündigung von [{}]]: {}|r', '|cfff00000[管理员公告]: {}|r', NULL, NULL, NULL, NULL),
(6615, '|cffffff00[|c1f40af20GM Announce by|r |cffff0000{}|cffffff00]:|r {}|r', NULL, NULL, '|cffffff00[|c1f40af20GM Ankündigung von|r |cffff0000{}|cffffff00]:|r {}|r', '|cffffff00[|c1f40af20管理员广播|r |cffff0000{}|cffffff00]:|r {}|r', NULL, NULL, NULL, NULL);

View File

@@ -217,18 +217,7 @@ if(OPENSSL_USE_STATIC_LIBS)
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX" AND
CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL "7.0" AND CMAKE_SYSTEM_VERSION VERSION_LESS "7.1" AND
OpenSSL_FIND_VERSION VERSION_GREATER_EQUAL "1.1" AND OpenSSL_FIND_VERSION VERSION_LESS "1.2")
# QNX 7.0.x provides openssl 1.0.2 and 1.1.1 in parallel:
# * openssl 1.0.2: libcrypto.so.2 and libssl.so.2, headers under usr/include/openssl
# * openssl 1.1.1: libcrypto1_1.so.2.1 and libssl1_1.so.2.1, header under usr/include/openssl1_1
# See http://www.qnx.com/developers/articles/rel_6726_0.html
set(_OPENSSL_FIND_PATH_SUFFIX "openssl1_1")
set(_OPENSSL_NAME_POSTFIX "1_1")
else()
set(_OPENSSL_FIND_PATH_SUFFIX "include")
endif()
set(_OPENSSL_FIND_PATH_SUFFIX "include")
if (OPENSSL_ROOT_DIR OR NOT "$ENV{OPENSSL_ROOT_DIR}" STREQUAL "")
set(_OPENSSL_ROOT_HINTS HINTS ${OPENSSL_ROOT_DIR} ENV OPENSSL_ROOT_DIR)
@@ -284,7 +273,6 @@ endif ()
if(HOMEBREW_PREFIX)
list(APPEND _OPENSSL_ROOT_HINTS
"${HOMEBREW_PREFIX}/opt/openssl@1.1"
"${HOMEBREW_PREFIX}/opt/openssl@3")
endif()
@@ -633,41 +621,6 @@ function(from_hex HEX DEC)
endfunction()
if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
if(openssl_version_str)
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
# The status gives if this is a developer or prerelease and is ignored here.
# Major, minor, and fix directly translate into the version numbers shown in
# the string. The patch field translates to the single character suffix that
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
# on.
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
# 96 is the ASCII code of 'a' minus 1
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
unset(_tmp)
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
# this should be updated to handle that, too. This has not happened yet
# so it is simply ignored here for now.
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
endif ()
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
else ()
# Since OpenSSL 3.0.0, the new version format is MAJOR.MINOR.PATCH and
# a new OPENSSL_VERSION_STR macro contains exactly that
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" OPENSSL_VERSION_STR
REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_STR[\t ]+\"([0-9])+\\.([0-9])+\\.([0-9])+\".*")
string(REGEX REPLACE "^.*OPENSSL_VERSION_STR[\t ]+\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*$"
@@ -676,7 +629,6 @@ if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
set(OPENSSL_VERSION "${OPENSSL_VERSION_STR}")
unset(OPENSSL_VERSION_STR)
endif ()
endif ()
foreach(_comp IN LISTS OpenSSL_FIND_COMPONENTS)

View File

@@ -20,11 +20,7 @@
Acore::Crypto::ARC4::ARC4() : _ctx(EVP_CIPHER_CTX_new())
{
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
_cipher = EVP_CIPHER_fetch(nullptr, "RC4", nullptr);
#else
EVP_CIPHER const* _cipher = EVP_rc4();
#endif
EVP_CIPHER_CTX_init(_ctx);
int result = EVP_EncryptInit_ex(_ctx, _cipher, nullptr, nullptr, nullptr);
@@ -34,10 +30,7 @@ Acore::Crypto::ARC4::ARC4() : _ctx(EVP_CIPHER_CTX_new())
Acore::Crypto::ARC4::~ARC4()
{
EVP_CIPHER_CTX_free(_ctx);
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
EVP_CIPHER_free(_cipher);
#endif
}
void Acore::Crypto::ARC4::Init(uint8 const* seed, std::size_t len)

View File

@@ -40,9 +40,7 @@ namespace Acore::Crypto
template <typename Container>
void UpdateData(Container& c) { UpdateData(std::data(c), std::size(c)); }
private:
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
EVP_CIPHER* _cipher;
#endif
EVP_CIPHER_CTX* _ctx;
};
}

View File

@@ -57,20 +57,7 @@ void BigNumber::SetQword(uint64 val)
void BigNumber::SetBinary(uint8 const* bytes, int32 len, bool littleEndian)
{
if (littleEndian)
{
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
uint8* array = new uint8[len];
for (int i = 0; i < len; i++)
array[i] = bytes[len - 1 - i];
BN_bin2bn(array, len, _bn);
delete[] array;
#else
BN_lebin2bn(bytes, len, _bn);
#endif
}
else
BN_bin2bn(bytes, len, _bn);
}
@@ -197,27 +184,8 @@ bool BigNumber::IsNegative() const
void BigNumber::GetBytes(uint8* buf, std::size_t bufsize, bool littleEndian) const
{
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
int nBytes = GetNumBytes();
ASSERT(nBytes >= 0, "Bignum has negative number of bytes ({}).", nBytes);
std::size_t numBytes = static_cast<std::size_t>(nBytes);
// too large to store
ASSERT(numBytes <= bufsize, "Buffer of size {} is too small to hold bignum with {} bytes.\n", bufsize, numBytes);
// If we need more bytes than length of BigNumber set the rest to 0
if (numBytes < bufsize)
memset((void*)buf, 0, bufsize);
BN_bn2bin(_bn, buf + (bufsize - numBytes));
// openssl's BN stores data internally in big endian format, reverse if little endian desired
if (littleEndian)
std::reverse(buf, buf + bufsize);
#else
int res = littleEndian ? BN_bn2lebinpad(_bn, buf, bufsize) : BN_bn2binpad(_bn, buf, bufsize);
ASSERT(res > 0, "Buffer of size {} is too small to hold bignum with {} bytes.\n", bufsize, BN_num_bytes(_bn));
#endif
}
std::vector<uint8> BigNumber::ToByteVector(int32 minSize, bool littleEndian) const

View File

@@ -34,13 +34,8 @@ namespace Acore::Impl
{
typedef EVP_MD const* (*HashCreator)();
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
static EVP_MD_CTX* MakeCTX() noexcept { return EVP_MD_CTX_create(); }
static void DestroyCTX(EVP_MD_CTX* ctx) { EVP_MD_CTX_destroy(ctx); }
#else
static EVP_MD_CTX* MakeCTX() noexcept { return EVP_MD_CTX_new(); }
static void DestroyCTX(EVP_MD_CTX* ctx) { EVP_MD_CTX_free(ctx); }
#endif
};
template <GenericHashImpl::HashCreator HashCreator, std::size_t DigestLength>

View File

@@ -17,34 +17,12 @@
#include "OpenSSLCrypto.h"
#include <openssl/crypto.h> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010000fL
#include <vector>
#include <thread>
#include <mutex>
std::vector<std::mutex*> cryptoLocks;
static void lockingCallback(int mode, int type, char const* /*file*/, int /*line*/)
{
if (mode & CRYPTO_LOCK)
cryptoLocks[type]->lock();
else
cryptoLocks[type]->unlock();
}
static void threadIdCallback(CRYPTO_THREADID * id)
{
(void)id;
CRYPTO_THREADID_set_numeric(id, std::hash<std::thread::id>()(std::this_thread::get_id()));
}
#elif OPENSSL_VERSION_NUMBER >= 0x30000000L
#include <openssl/provider.h>
OSSL_PROVIDER* LegacyProvider;
OSSL_PROVIDER* DefaultProvider;
#endif
#if OPENSSL_VERSION_NUMBER >= 0x30000000L && AC_PLATFORM == AC_PLATFORM_WINDOWS
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
#include <boost/dll/runtime_symbol_info.hpp>
#include <filesystem>
@@ -62,43 +40,16 @@ void SetupLibrariesForWindows()
void OpenSSLCrypto::threadsSetup()
{
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010000fL
cryptoLocks.resize(CRYPTO_num_locks());
for (int i = 0 ; i < CRYPTO_num_locks(); ++i)
{
cryptoLocks[i] = new std::mutex();
}
(void)&threadIdCallback;
CRYPTO_THREADID_set_callback(threadIdCallback);
(void)&lockingCallback;
CRYPTO_set_locking_callback(lockingCallback);
#elif OPENSSL_VERSION_NUMBER >= 0x30000000L
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
SetupLibrariesForWindows();
#endif
LegacyProvider = OSSL_PROVIDER_load(nullptr, "legacy");
DefaultProvider = OSSL_PROVIDER_load(nullptr, "default");
#endif
}
void OpenSSLCrypto::threadsCleanup()
{
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010000fL
CRYPTO_set_locking_callback(nullptr);
CRYPTO_THREADID_set_callback(nullptr);
for (int i = 0 ; i < CRYPTO_num_locks(); ++i)
{
delete cryptoLocks[i];
}
cryptoLocks.resize(0);
#elif OPENSSL_VERSION_NUMBER >= 0x30000000L
OSSL_PROVIDER_unload(LegacyProvider);
OSSL_PROVIDER_unload(DefaultProvider);
OSSL_PROVIDER_set_default_search_path(nullptr, nullptr);
#endif
}

View File

@@ -392,9 +392,6 @@ int main(int argc, char** argv)
if (MySQL::GetLibraryVersion() < 80000)
LOG_WARN("server", "WARNING: You are using MySQL version 5.7 which is soon EOL!\nThis version will be deprecated. Consider upgrading to MySQL 8.0 or 8.1!");
#endif
#if OPENSSL_VERSION_NUMBER < 0x30000000L
LOG_WARN("server", "WARNING: You are using OpenSSL version 1.1 which is soon EOL!\nThis version will be deprecated. Consider upgrading to OpenSSL 3.0 or 3.1!");
#endif
// Launch CliRunnable thread
std::shared_ptr<std::thread> cliThread;

View File

@@ -1306,7 +1306,7 @@ void Battleground::ReadyMarkerClicked(Player* p)
readyMarkerClickedSet.insert(p->GetGUID());
uint32 count = readyMarkerClickedSet.size();
uint32 req = ArenaTeam::GetReqPlayersForType(GetArenaType());
p->GetSession()->SendNotification("You are marked as ready %u/%u", count, req);
ChatHandler(p->GetSession()).SendNotification("You are marked as ready {}/{}", count, req);
if (count == req)
{
m_Events |= BG_STARTING_EVENT_2;

View File

@@ -99,19 +99,41 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
return false;
}
void ChatHandler::SendWorldText(std::string_view str)
void ChatHandler::SendNotification(std::string_view str)
{
std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
for (std::string_view line : lines)
{
WorldPacket data(SMSG_NOTIFICATION, line.size() + 1);
data << line.data();
m_session->SendPacket(&data);
}
}
Player* player = m_session->GetPlayer();
if (!player || !player->IsInWorld())
void ChatHandler::SendGMText(std::string_view str)
{
std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
// Session should have permissions to receive global gm messages
if (AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
return;
for (std::string_view line : lines)
{
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
player->SendDirectMessage(&data);
m_session->SendPacket(&data);
}
}
void ChatHandler::SendWorldText(std::string_view str)
{
std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
for (std::string_view line : lines)
{
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
m_session->SendPacket(&data);
}
}
@@ -120,9 +142,6 @@ void ChatHandler::SendWorldTextOptional(std::string_view str, uint32 flag)
std::vector<std::string_view> lines = Acore::Tokenize(str, '\n', true);
Player* player = m_session->GetPlayer();
if (!player || !player->IsInWorld())
return;
if (sWorld->getBoolConfig(CONFIG_PLAYER_SETTINGS_ENABLED))
if (player->GetPlayerSetting(AzerothcorePSSource, SETTING_ANNOUNCER_FLAGS).HasFlag(flag))
return;
@@ -483,6 +502,23 @@ Player* ChatHandler::getSelectedPlayerOrSelf() const
return targetPlayer;
}
bool ChatHandler::HasSession() const
{
if (!m_session)
return false;
return true;
}
void ChatHandler::DoForAllValidSessions(std::function<void(Player*)> exec)
{
SessionMap::const_iterator itr;
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
if (Player* player = itr->second->GetPlayer())
if (player->IsInWorld())
exec(player);
}
char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1)
{
// skip empty
@@ -1003,6 +1039,11 @@ int CliHandler::GetSessionDbLocaleIndex() const
return sObjectMgr->GetDBCLocaleIndex();
}
bool CliHandler::HasSession() const
{
return true;
}
bool AddonChannelCommandHandler::ParseCommands(std::string_view str)
{
if (memcmp(str.data(), "AzerothCore\t", 12))

View File

@@ -69,36 +69,62 @@ public:
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = nullptr; return start; }
void SendNotification(std::string_view str);
template<typename... Args>
void SendNotification(uint32 strId, Args&&... args)
{
if (HasSession())
SendNotification(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
}
template<typename... Args>
void SendNotification(char const* fmt, Args&&... args)
{
if (HasSession())
SendNotification(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
}
void SendGMText(std::string_view str);
template<typename... Args>
void SendGMText(uint32 strId, Args&&... args)
{
// GMText should be sent to all sessions
DoForAllValidSessions([&](Player* player)
{
m_session = player->GetSession();
SendGMText(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
});
}
template<typename... Args>
void SendGMText(char const* fmt, Args&&... args)
{
// GMText should be sent to all sessions
DoForAllValidSessions([&](Player* player)
{
m_session = player->GetSession();
SendGMText(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
});
}
void SendWorldText(std::string_view str);
template<typename... Args>
void SendWorldText(uint32 strId, Args&&... args)
{
// WorldText should be sent to all sessions
SessionMap::const_iterator itr;
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
{
Player* player = itr->second->GetPlayer();
if (player && player->IsInWorld())
DoForAllValidSessions([&](Player* player)
{
m_session = player->GetSession();
SendWorldText(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
}
}
});
}
template<typename... Args>
void SendWorldText(char const* fmt, Args&&... args)
{
// WorldTextOptional should be sent to all sessions
SessionMap::const_iterator itr;
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
{
Player* player = itr->second->GetPlayer();
if (player && player->IsInWorld())
// WorldText should be sent to all sessions
DoForAllValidSessions([&](Player* player)
{
m_session = player->GetSession();
SendWorldText(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
}
}
});
}
void SendWorldTextOptional(std::string_view str, uint32 flag);
@@ -106,31 +132,21 @@ public:
void SendWorldTextOptional(uint32 strId, uint32 flag, Args&&... args)
{
// WorldTextOptional should be sent to all sessions
SessionMap::const_iterator itr;
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
{
Player* player = itr->second->GetPlayer();
if (player && player->IsInWorld())
DoForAllValidSessions([&](Player* player)
{
m_session = player->GetSession();
SendWorldTextOptional(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...), flag);
}
}
});
}
template<typename... Args>
void SendWorldTextOptional(char const* fmt, uint32 flag, Args&&... args)
{
// WorldTextOptional should be sent to all sessions
SessionMap::const_iterator itr;
for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
{
Player* player = itr->second->GetPlayer();
if (player && player->IsInWorld())
DoForAllValidSessions([&](Player* player)
{
m_session = player->GetSession();
SendWorldTextOptional(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...), flag);
}
}
});
}
// function with different implementation for chat/console
@@ -143,13 +159,15 @@ public:
template<typename... Args>
void PSendSysMessage(char const* fmt, Args&&... args)
{
SendSysMessage(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
if (HasSession())
SendSysMessage(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
}
template<typename... Args>
void PSendSysMessage(uint32 entry, Args&&... args)
{
SendSysMessage(PGetParseString(entry, std::forward<Args>(args)...));
if (HasSession())
SendSysMessage(PGetParseString(entry, std::forward<Args>(args)...));
}
template<typename... Args>
@@ -198,6 +216,12 @@ public:
// Returns either the selected player or self if there is no selected player
Player* getSelectedPlayerOrSelf() const;
// Has different implementation for console
virtual bool HasSession() const;
// Do whatever you want to all the players with a valid session [including GameMasters], i.e.: param exec = [&](Player* p) { p->Whatever(); }
// A "valid" session requires player->IsInWorld() to be true
void DoForAllValidSessions(std::function<void(Player*)> exec);
char* extractKeyFromLink(char* text, char const* linkType, char** something1 = nullptr);
char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = nullptr);
char* extractQuotedArg(char* args);
@@ -247,6 +271,9 @@ public:
LocaleConstant GetSessionDbcLocale() const override;
int GetSessionDbLocaleIndex() const override;
// CLI does not have a session, so we override it to always be true to output SendNotification and PSendSysMessage to console
bool HasSession() const override;
private:
void* m_callbackArg;
Print* m_print;

View File

@@ -16,6 +16,7 @@
*/
#include "BattlegroundMgr.h"
#include "Chat.h"
#include "GossipDef.h"
#include "Language.h"
#include "ObjectMgr.h"
@@ -262,9 +263,9 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
ToggleInstantFlight();
if (m_isInstantFlightOn)
GetSession()->SendNotification(LANG_INSTANT_FLIGHT_ON);
ChatHandler(GetSession()).SendNotification(LANG_INSTANT_FLIGHT_ON);
else
GetSession()->SendNotification(LANG_INSTANT_FLIGHT_OFF);
ChatHandler(GetSession()).SendNotification(LANG_INSTANT_FLIGHT_OFF);
PlayerTalkClass->SendCloseGossip();
return;

View File

@@ -55,7 +55,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
{
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ))
{
SendNotification(LANG_AUCTION_REQ, sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_AUCTION_REQ, sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
return;
}

View File

@@ -55,7 +55,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recvData)
if (!_player->GetBGAccessByLevel(bgTypeId))
{
// temp, must be gossip message...
SendNotification(LANG_YOUR_BG_LEVEL_REQ_ERROR);
ChatHandler(this).SendNotification(LANG_YOUR_BG_LEVEL_REQ_ERROR);
return;
}
@@ -414,7 +414,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
if (_player->GetCharmGUID() || _player->IsInCombat())
{
_player->GetSession()->SendNotification(LANG_YOU_IN_COMBAT);
ChatHandler(_player->GetSession()).SendNotification(LANG_YOU_IN_COMBAT);
return;
}

View File

@@ -966,14 +966,14 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_SPELLS))
{
pCurrChar->resetSpells();
SendNotification(LANG_RESET_SPELLS);
ChatHandler(this).SendNotification(LANG_RESET_SPELLS);
}
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_TALENTS))
{
pCurrChar->resetTalents(true);
pCurrChar->SendTalentsInfoData(false); // original talents send already in to SendInitialPacketsBeforeAddToMap, resend reset state
SendNotification(LANG_RESET_TALENTS);
ChatHandler(this).SendNotification(LANG_RESET_TALENTS);
}
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_CHECK_ACHIEVS))
@@ -1039,7 +1039,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
pCurrChar->SetTaxiCheater(true);
if (pCurrChar->IsGameMaster())
SendNotification(LANG_GM_ON);
ChatHandler(this).SendNotification(LANG_GM_ON);
std::string IP_str = GetRemoteAddress();
LOG_INFO("entities.player", "Account: {} (IP: {}) Login Character:[{}] ({}) Level: {}",
@@ -1234,7 +1234,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
sWorld->ShutdownMsg(true, pCurrChar);
if (pCurrChar->IsGameMaster())
SendNotification(LANG_GM_ON);
ChatHandler(pCurrChar->GetSession()).SendNotification(LANG_GM_ON);
m_playerLoading = false;
}

View File

@@ -74,7 +74,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (lang == LANG_UNIVERSAL && type != CHAT_MSG_AFK && type != CHAT_MSG_DND)
{
LOG_ERROR("entities.player.cheat", "CMSG_MESSAGECHAT: Possible hacking-attempt: {} tried to send a message in universal language", GetPlayerInfo());
SendNotification(LANG_UNKNOWN_LANGUAGE);
ChatHandler(this).SendNotification(LANG_UNKNOWN_LANGUAGE);
recvData.rfinish();
return;
}
@@ -85,7 +85,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
LanguageDesc const* langDesc = GetLanguageDescByID(lang);
if (!langDesc)
{
SendNotification(LANG_UNKNOWN_LANGUAGE);
ChatHandler(this).SendNotification(LANG_UNKNOWN_LANGUAGE);
recvData.rfinish();
return;
}
@@ -105,7 +105,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (!foundAura)
{
SendNotification(LANG_NOT_LEARNED_LANGUAGE);
ChatHandler(this).SendNotification(LANG_NOT_LEARNED_LANGUAGE);
recvData.rfinish();
return;
}
@@ -137,7 +137,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (sender->GetTotalPlayedTime() < minutes * MINUTE)
{
SendNotification(LANG_MUTED_PLAYER, minutes);
ChatHandler(this).SendNotification(LANG_MUTED_PLAYER, minutes);
recvData.rfinish();
return;
}
@@ -164,7 +164,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER)
{
SendNotification(LANG_GM_SILENCE, sender->GetName());
ChatHandler(this).SendNotification(LANG_GM_SILENCE, sender->GetName());
recvData.rfinish();
return;
}
@@ -296,7 +296,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (!_player->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime().count());
SendNotification(LANG_WAIT_BEFORE_SPEAKING, timeStr);
ChatHandler(this).SendNotification(LANG_WAIT_BEFORE_SPEAKING, timeStr);
return;
}
}
@@ -361,7 +361,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ))
{
SendNotification(LANG_SAY_REQ, sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_SAY_REQ, sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
return;
}
@@ -387,7 +387,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && receiver != sender)
{
SendNotification(LANG_WHISPER_REQ, sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_WHISPER_REQ, sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
return;
}
@@ -407,7 +407,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
// pussywizard: optimization
if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
{
SendNotification(LANG_GM_SILENCE, GetPlayer()->GetName());
ChatHandler(this).SendNotification(LANG_GM_SILENCE, GetPlayer()->GetName());
return;
}
@@ -601,7 +601,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
{
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
{
SendNotification(LANG_CHANNEL_REQ, sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_CHANNEL_REQ, sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
return;
}
}
@@ -746,7 +746,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
if (!GetPlayer()->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime().count());
SendNotification(LANG_WAIT_BEFORE_SPEAKING, timeStr);
ChatHandler(this).SendNotification(LANG_WAIT_BEFORE_SPEAKING, timeStr);
return;
}

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Chat.h"
#include "DatabaseEnv.h"
#include "Group.h"
#include "GroupMgr.h"
@@ -725,7 +726,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recvData)
// Check if player is in BG
if (_player->InBattleground())
{
_player->GetSession()->SendNotification(LANG_BG_READY_CHECK_ERROR);
ChatHandler(_player->GetSession()).SendNotification(LANG_BG_READY_CHECK_ERROR);
return;
}
}

View File

@@ -16,6 +16,7 @@
*/
#include "AccountMgr.h"
#include "Chat.h"
#include "CharacterCache.h"
#include "DBCStores.h"
#include "DatabaseEnv.h"
@@ -117,7 +118,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
if (player->GetLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ))
{
SendNotification(LANG_MAIL_SENDER_REQ, sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_MAIL_SENDER_REQ, sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
return;
}

View File

@@ -1118,7 +1118,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
if (AccountMgr::IsAdminAccount(GetSecurity()))
GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation);
else
SendNotification(LANG_PERMISSION_DENIED);
ChatHandler(this).SendNotification(LANG_PERMISSION_DENIED);
}
void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
@@ -1129,13 +1129,13 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
if (!AccountMgr::IsAdminAccount(GetSecurity()))
{
SendNotification(LANG_PERMISSION_DENIED);
ChatHandler(this).SendNotification(LANG_PERMISSION_DENIED);
return;
}
if (charname.empty() || !normalizePlayerName (charname))
{
SendNotification(LANG_NEED_CHARACTER_NAME);
ChatHandler(this).SendNotification(LANG_NEED_CHARACTER_NAME);
return;
}
@@ -1143,7 +1143,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
if (!player)
{
SendNotification(LANG_PLAYER_NOT_EXIST_OR_OFFLINE, charname.c_str());
ChatHandler(this).SendNotification(LANG_PLAYER_NOT_EXIST_OR_OFFLINE, charname.c_str());
return;
}
@@ -1157,7 +1157,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
if (!result)
{
SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str());
ChatHandler(this).SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str());
return;
}

View File

@@ -17,6 +17,7 @@
#include "Battleground.h"
#include "BattlegroundAV.h"
#include "Chat.h"
#include "GameObjectAI.h"
#include "Group.h"
#include "Language.h"
@@ -586,7 +587,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
// Check if player is in BG
if (_player->InBattleground())
{
_player->GetSession()->SendNotification(LANG_BG_SHARE_QUEST_ERROR);
ChatHandler(_player->GetSession()).SendNotification(LANG_BG_SHARE_QUEST_ERROR);
continue;
}
}

View File

@@ -35,7 +35,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ))
{
SendNotification(LANG_TICKET_REQ, sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_TICKET_REQ, sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
return;
}
@@ -118,7 +118,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
sTicketMgr->AddTicket(ticket);
sTicketMgr->UpdateLastChange();
sWorld->SendGMText(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName().c_str(), ticket->GetId());
ChatHandler(nullptr).SendGMText(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName(), ticket->GetId());
response = GMTICKET_RESPONSE_CREATE_SUCCESS;
}
@@ -145,7 +145,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket& recv_data)
ticket->SetMessage(message);
ticket->SaveToDB(trans);
sWorld->SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName().c_str(), ticket->GetId());
ChatHandler(nullptr).SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->GetId());
response = GMTICKET_RESPONSE_UPDATE_SUCCESS;
}
@@ -163,7 +163,7 @@ void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket& /*recv_data*/)
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
SendPacket(&data);
sWorld->SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName().c_str(), ticket->GetId());
ChatHandler(nullptr).SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->GetId());
sTicketMgr->CloseTicket(ticket->GetId(), GetPlayer()->GetGUID());
sTicketMgr->SendTicket(this, nullptr);

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Chat.h"
#include "Item.h"
#include "Language.h"
#include "Log.h"
@@ -264,7 +265,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
// not accept case incorrect money amount
if (!_player->HasEnoughMoney(my_trade->GetMoney()))
{
SendNotification(LANG_NOT_ENOUGH_GOLD);
ChatHandler(this).SendNotification(LANG_NOT_ENOUGH_GOLD);
my_trade->SetAccepted(false, true);
return;
}
@@ -272,7 +273,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
// not accept case incorrect money amount
if (!trader->HasEnoughMoney(his_trade->GetMoney()))
{
trader->GetSession()->SendNotification(LANG_NOT_ENOUGH_GOLD);
ChatHandler(trader->GetSession()).SendNotification(LANG_NOT_ENOUGH_GOLD);
his_trade->SetAccepted(false, true);
return;
}
@@ -422,8 +423,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
{
clearAcceptTradeMode(my_trade, his_trade);
SendNotification(LANG_NOT_FREE_TRADE_SLOTS);
trader->GetSession()->SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS);
ChatHandler(this).SendNotification(LANG_NOT_FREE_TRADE_SLOTS);
ChatHandler(trader->GetSession()).SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS);
my_trade->SetAccepted(false);
his_trade->SetAccepted(false);
delete my_spell;
@@ -434,8 +435,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
{
clearAcceptTradeMode(my_trade, his_trade);
SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS);
trader->GetSession()->SendNotification(LANG_NOT_FREE_TRADE_SLOTS);
ChatHandler(this).SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS);
ChatHandler(trader->GetSession()).SendNotification(LANG_NOT_FREE_TRADE_SLOTS);
my_trade->SetAccepted(false);
his_trade->SetAccepted(false);
delete my_spell;
@@ -574,7 +575,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
{
SendNotification(LANG_TRADE_REQ, sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_TRADE_REQ, sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
return;
}
@@ -639,7 +640,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
if (pOther->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
{
SendNotification(LANG_TRADE_OTHER_REQ, sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
ChatHandler(this).SendNotification(LANG_TRADE_OTHER_REQ, sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
return;
}

View File

@@ -16,6 +16,7 @@
*/
#include "InstanceScript.h"
#include "Chat.h"
#include "Creature.h"
#include "DatabaseEnv.h"
#include "GameObject.h"
@@ -602,7 +603,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
instance->DoForAllPlayers([&, buff](Player* player)
{
player->GetSession()->SendNotification("%s", buff);
ChatHandler(player->GetSession()).SendNotification("{}", buff);
});
}
}

View File

@@ -815,16 +815,6 @@ bool WorldSession::DisallowHyperlinksAndMaybeKick(std::string_view str)
return false;
}
void WorldSession::SendNotification(std::string_view str)
{
WorldPacket data(SMSG_NOTIFICATION, str.size() + 1);
for (std::string_view line : Acore::Tokenize(str, '\n', true))
{
data << line.data();
SendPacket(&data);
}
}
char const* WorldSession::GetAcoreString(uint32 entry) const
{
return sObjectMgr->GetAcoreString(entry, GetSessionDbLocaleIndex());

View File

@@ -365,18 +365,6 @@ public:
void ReadMovementInfo(WorldPacket& data, MovementInfo* mi);
void WriteMovementInfo(WorldPacket* data, MovementInfo* mi);
void SendNotification(std::string_view str);
template<typename... Args>
void SendNotification(uint32 strId, Args&&... args)
{
SendNotification(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
}
template<typename... Args>
void SendNotification(char const* fmt, Args&&... args)
{
SendNotification(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
}
void SendPacket(WorldPacket const* packet);
void SendPetNameInvalid(uint32 error, std::string const& name, DeclinedName* declinedName);
void SendPartyResult(PartyOperation operation, std::string const& member, PartyResult res, uint32 val = 0);

View File

@@ -22,6 +22,7 @@
#include "BattlegroundSA.h"
#include "BattlegroundWS.h"
#include "CellImpl.h"
#include "Chat.h"
#include "Common.h"
#include "Creature.h"
#include "DynamicObject.h"
@@ -6168,7 +6169,7 @@ void Spell::EffectPlaySound(SpellEffIndex effIndex)
{
case 58730: // Restricted Flight Area
case 58600: // Restricted Flight Area
player->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
ChatHandler(player->GetSession()).SendNotification(LANG_ZONE_NOFLYZONE);
break;
default:
break;

View File

@@ -4792,12 +4792,6 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS);
});
// Random Periodic
ApplySpellFix({ 40867 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].Amplitude = 9000;
});
// Flame Wave
ApplySpellFix({ 33800 }, [](SpellInfo* spellInfo)
{

View File

@@ -566,7 +566,6 @@ public:
[[nodiscard]] virtual uint16 GetConfigMaxSkillValue() const = 0;
virtual void SetInitialWorldSettings() = 0;
virtual void LoadConfigSettings(bool reload = false) = 0;
virtual void SendGMText(uint32 string_id, ...) = 0;
virtual void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
virtual void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
virtual bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;

View File

@@ -2582,32 +2582,6 @@ namespace Acore
};
} // namespace Acore
/// Send a System Message to all GMs (except self if mentioned)
void World::SendGMText(uint32 string_id, ...)
{
va_list ap;
va_start(ap, string_id);
Acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
Acore::LocalizedPacketListDo<Acore::WorldWorldTextBuilder> wt_do(wt_builder);
for (SessionMap::iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
{
// Session should have permissions to receive global gm messages
WorldSession* session = itr->second;
if (!session || AccountMgr::IsPlayerAccount(session->GetSecurity()))
continue;
// Player should be in world
Player* player = session->GetPlayer();
if (!player || !player->IsInWorld())
continue;
wt_do(session->GetPlayer());
}
va_end(ap);
}
/// Send a packet to all players (or players selected team) in the zone (except self if mentioned)
bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self, TeamId teamId)
{

View File

@@ -238,7 +238,6 @@ public:
void SetInitialWorldSettings() override;
void LoadConfigSettings(bool reload = false) override;
void SendGMText(uint32 string_id, ...) override;
void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;

View File

@@ -68,22 +68,22 @@ public:
if (!enableArg)
{
if (!AccountMgr::IsPlayerAccount(session->GetSecurity()) && session->GetPlayer()->isGMChat())
session->SendNotification(LANG_GM_CHAT_ON);
handler->SendNotification(LANG_GM_CHAT_ON);
else
session->SendNotification(LANG_GM_CHAT_OFF);
handler->SendNotification(LANG_GM_CHAT_OFF);
return true;
}
if (*enableArg)
{
session->GetPlayer()->SetGMChat(true);
session->SendNotification(LANG_GM_CHAT_ON);
handler->SendNotification(LANG_GM_CHAT_ON);
return true;
}
else
{
session->GetPlayer()->SetGMChat(false);
session->SendNotification(LANG_GM_CHAT_OFF);
handler->SendNotification(LANG_GM_CHAT_OFF);
return true;
}
}
@@ -206,14 +206,14 @@ public:
_player->SetGMVisible(true);
_player->UpdateObjectVisibility();
handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
handler->SendNotification(LANG_INVISIBLE_VISIBLE);
}
else
{
_player->AddAura(VISUAL_AURA, _player);
_player->SetGMVisible(false);
_player->UpdateObjectVisibility();
handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
handler->SendNotification(LANG_INVISIBLE_INVISIBLE);
}
return true;
@@ -223,7 +223,7 @@ public:
{
handler->GetPlayer()->SetGameMaster(true);
handler->GetPlayer()->UpdateTriggerVisibility();
handler->GetSession()->SendNotification(LANG_GM_ON);
handler->SendNotification(LANG_GM_ON);
return true;
}
@@ -231,7 +231,7 @@ public:
{
handler->GetPlayer()->SetGameMaster(false);
handler->GetPlayer()->UpdateTriggerVisibility();
handler->GetSession()->SendNotification(LANG_GM_OFF);
handler->SendNotification(LANG_GM_OFF);
return true;
}
};

View File

@@ -77,7 +77,7 @@ public:
if (WorldSession* session = handler->GetSession())
name = session->GetPlayer()->GetName();
sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, name.c_str(), message.data());
handler->SendGMText(LANG_GM_ANNOUNCE_COLOR, name, message.data());
return true;
}
@@ -92,12 +92,12 @@ public:
}
// announce to logged in GMs
static bool HandleGMAnnounceCommand(ChatHandler* /*handler*/, Tail message)
static bool HandleGMAnnounceCommand(ChatHandler* handler, Tail message)
{
if (message.empty())
return false;
sWorld->SendGMText(LANG_GM_BROADCAST, message.data());
handler->SendGMText(LANG_GM_BROADCAST, message.data());
return true;
}

View File

@@ -464,7 +464,7 @@ public:
auto SetCommentatorMod = [&](bool enable)
{
session->SendNotification(enable ? "Commentator mode on" : "Commentator mode off");
handler->SendNotification(enable ? "Commentator mode on" : "Commentator mode off");
session->GetPlayer()->SetCommentator(enable);
};
@@ -508,7 +508,7 @@ public:
auto SetDevMod = [&](bool enable)
{
session->SendNotification(enable ? LANG_DEV_ON : LANG_DEV_OFF);
handler->SendNotification(enable ? LANG_DEV_ON : LANG_DEV_OFF);
session->GetPlayer()->SetDeveloper(enable);
sScriptMgr->OnHandleDevCommand(handler->GetSession()->GetPlayer(), enable);
};

View File

@@ -77,7 +77,8 @@ public:
static ChatCommandTable morphCommandTable =
{
{ "reset", HandleMorphResetCommand, SEC_MODERATOR, Console::No },
{ "target", HandleMorphTargetCommand, SEC_MODERATOR, Console::No }
{ "target", HandleMorphTargetCommand, SEC_MODERATOR, Console::No },
{ "mount", HandleMorphMountCommand, SEC_MODERATOR, Console::No }
};
static ChatCommandTable commandTable =
@@ -868,6 +869,21 @@ public:
return true;
}
static bool HandleMorphMountCommand(ChatHandler* handler, uint32 displayID)
{
Player* target = handler->getSelectedPlayerOrSelf();
if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer())) // check online security
return false;
if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayID);
else
return false;
return true;
}
//set temporary phase mask for player
static bool HandleModifyPhaseCommand(ChatHandler* handler, uint32 phaseMask)
{

View File

@@ -16,6 +16,7 @@
*/
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
@@ -145,7 +146,12 @@ class spell_anetheron_sleep : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
if (!targets.empty())
{
if (Unit* victim = GetCaster()->GetVictim())
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
Acore::Containers::RandomResize(targets, 3);
}
}
void Register() override

View File

@@ -143,10 +143,10 @@ class spell_mother_shahraz_random_periodic_aura : public AuraScript
return ValidateSpellInfo({ SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC });
}
void Update(AuraEffect const* /*effect*/)
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
if (GetUnitOwner())
if (GetUnitOwner() && (effect->GetTickNumber() % 6 == 1 || effect->GetTickNumber() == 1)) // Reapplies 12-18s after the third beam
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC), true);
}

View File

@@ -2221,6 +2221,11 @@ struct dragonmaw_race_npc : public ScriptedAI
}
}
void PathEndReached(uint32 /*pathId*/) override
{
Reset();
}
void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);

View File

@@ -16,6 +16,7 @@
*/
#include "CellImpl.h"
#include "Chat.h"
#include "CreatureScript.h"
#include "GameEventMgr.h"
#include "GameObjectAI.h"
@@ -1081,7 +1082,7 @@ public:
if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG))
return false;
player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
ChatHandler(player->GetSession()).SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
return true;
}
@@ -1599,7 +1600,7 @@ public:
else
{
CloseGossipMenuFor(player);
player->GetSession()->SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND);
ChatHandler(player->GetSession()).SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND);
return false;
}
}

View File

@@ -72,7 +72,6 @@ public:
MOCK_METHOD(uint16, GetConfigMaxSkillValue, (), (const));
MOCK_METHOD(void, SetInitialWorldSettings, ());
MOCK_METHOD(void, LoadConfigSettings, (bool reload), ());
void SendGMText(uint32 string_id, ...) override {}
MOCK_METHOD(void, SendGlobalMessage, (WorldPacket const* packet, WorldSession* self, TeamId teamId), ());
MOCK_METHOD(void, SendGlobalGMMessage, (WorldPacket const* packet, WorldSession* self, TeamId teamId), ());
MOCK_METHOD(bool, SendZoneMessage, (uint32 zone, WorldPacket const* packet, WorldSession* self, TeamId teamId), ());