Compare commits

...

50 Commits

Author SHA1 Message Date
Quentin Dawans
c48ca4ca05
Merge 93c40437baa1aca12c57a022d3ffddee50edc69a into dab83dd19eeee975bb7e8bb70c29064eba3bf334 2025-11-08 13:15:16 +00:00
Ovv
93c40437ba fix(network): use IPv4 protocol for systemd socket 2025-11-08 14:14:52 +01:00
github-actions[bot]
dab83dd19e chore(DB): import pending files
Referenced commit(s): af779202e623986de4f00fb0f82f61c40dddcc43
2025-11-08 07:04:47 +00:00
Benjamin Jackson
af779202e6
fix(Core): Move and adjust experience modifiers for instanced elite creatures. (#23563) 2025-11-08 02:03:43 -05:00
Andrew
09e0343491
fix(Scripts/Ahnkahet): Clean up Herald Volazj insanity casting and ph… (#23549) 2025-11-07 19:37:42 -03:00
github-actions[bot]
433be02111 chore(DB): import pending files
Referenced commit(s): 494326656def0b998da319e109a51503d719dd22
2025-11-07 18:21:09 +00:00
Rocco Silipo
494326656d
fix(DB/Script): Add various corrections to Massacre At Light's Point event. (#23558) 2025-11-07 19:20:04 +01:00
github-actions[bot]
6b66ae22e3 chore(DB): import pending files
Referenced commit(s): dea8cd64df2d0eb6850bf042506b8ef478ef4feb
2025-11-07 15:57:19 +00:00
sogladev
fb96e65696
fix(DB/Creature): add chains to Blightblood Troll (#23561) 2025-11-07 16:56:26 +01:00
killerwife
dea8cd64df
Movement: Fix flying in dalaran after disconnect (#23559) 2025-11-07 16:56:12 +01:00
sogladev
7ac7228315
fix(Core/Player): simultaneously swap melee and ranged weapon in combat (#23557) 2025-11-07 12:07:57 +01:00
github-actions[bot]
24ca7efb73 chore(DB): import pending files
Referenced commit(s): 0bdf7a6b0fc3da39469e7083e4069d111950f64e
2025-11-07 06:48:18 +00:00
Nicolas Lebacq
0bdf7a6b0f
fix(DB/Creature): Deleted Wendigo entity spawning under the ground… (#23555) 2025-11-07 07:47:12 +01:00
github-actions[bot]
639ee028fd chore(DB): import pending files
Referenced commit(s): 6ef3383b121855d3de1bcc02a00d9420901775a5
2025-11-06 15:03:07 +00:00
Rocco Silipo
6ef3383b12
Fix(DB/Creature): Remove accessory from Enslaved Proto-drake. (#23550) 2025-11-06 16:02:02 +01:00
Ovv
2fe3b8ea61 fix(network): use correct protocol for systemd socket
Update AsyncAcceptor to assign the socket using the endpoint's protocol
instead of hardcoded IPv4. This ensures compatibility with both IPv4 and
IPv6 endpoints when using systemd socket activation.
2025-11-04 17:56:47 +01:00
Ovv
bc755bf275 fix log warning 2025-11-01 11:13:27 +01:00
Ovv
2619f4e61d get_listen_fds -> get_listen_fd 2025-11-01 11:09:49 +01:00
Ovv
8606ff060a Fix fd returned by get_listen_fds 2025-11-01 11:08:40 +01:00
Ovv
c1e5c8aacf Include Config.h in SOcketMgr.h 2025-10-31 22:52:42 +01:00
Ovv
0b6bd03baa remove extra blank line 2025-10-31 21:03:51 +01:00
Ovv
9d1143f47c Systemd socket activation: env handling, config option and worldserver.conf.dist entry 2025-10-31 20:25:22 +01:00
Ovv
d747c9c67a Merge branch 'master' into ovv/systemd-socket-activation 2025-10-31 20:03:25 +01:00
Quentin Dawans
9dbaf9e03e
Merge branch 'master' into ovv/systemd-socket-activation 2025-08-14 11:50:52 +02:00
Quentin Dawans
61cf90618a
Merge branch 'master' into ovv/systemd-socket-activation 2025-08-06 19:00:47 +02:00
Quentin Dawans
fac356ba79
Merge branch 'master' into ovv/systemd-socket-activation 2025-07-27 15:56:32 +02:00
Quentin Dawans
af98fcd476
Merge branch 'master' into ovv/systemd-socket-activation 2025-07-26 20:35:54 +02:00
Quentin Dawans
37e8e2102f
Merge branch 'master' into ovv/systemd-socket-activation 2025-07-12 18:51:36 +02:00
Quentin Dawans
28c368c7b2
Merge branch 'master' into ovv/systemd-socket-activation 2025-07-08 16:18:39 +02:00
Quentin Dawans
2060c4cc87
Merge branch 'master' into ovv/systemd-socket-activation 2025-06-30 11:28:28 +02:00
Quentin Dawans
f49c8550bd
Merge branch 'master' into ovv/systemd-socket-activation 2025-06-23 22:09:16 +02:00
=
a71cb0581d changes requested by review 2025-06-23 21:47:09 +02:00
=
123f74b6ea changes requested by review 2025-06-21 16:45:39 +02:00
Quentin Dawans
48118b764f
Merge branch 'master' into ovv/systemd-socket-activation 2025-06-20 17:29:43 +02:00
=
88b46fbf37 Changes requested by review 2025-06-20 17:28:49 +02:00
Quentin Dawans
8d13542d6a
Merge branch 'master' into ovv/systemd-socket-activation 2025-06-16 13:11:27 +02:00
Quentin Dawans
64f45f3f1d
Merge branch 'master' into ovv/systemd-socket-activation 2025-05-23 18:32:32 +02:00
Quentin Dawans
ffeb7daf5c
Merge branch 'master' into ovv/systemd-socket-activation 2025-05-21 16:49:05 +02:00
=
3b25987ab1 include <string> 2025-05-12 23:17:50 +02:00
=
e5968c1f28 cleanup 2025-05-12 23:08:13 +02:00
=
6eb1b565d4 Remove dependency on libsystemd 2025-05-12 23:04:36 +02:00
=
7a3a8c2c2f On shutdown don't set realm offline if using systemd socket activation 2025-05-11 22:13:56 +02:00
Quentin Dawans
0100cb47be
Merge branch 'master' into ovv/systemd-socket-activation 2025-05-11 18:35:00 +02:00
Quentin Dawans
319d3ad8ed
Merge branch 'master' into ovv/systemd-socket-activation 2025-05-05 11:18:08 +02:00
=
bd8eaafe30 codestyle fix 2025-05-04 11:09:55 +02:00
=
65ee429b83 cmake linux -> unix 2025-05-04 11:09:55 +02:00
=
417da2ecbc some cleanup 2025-05-04 11:09:55 +02:00
=
aad8bde477 make libsystemd optional 2025-05-04 11:09:55 +02:00
=
f91c93bc2f Fix codestyle & install libsystemd-dev in CI 2025-05-04 11:09:55 +02:00
=
79a05f7024 Linux: Support systemd socket activation for the worldserver game socket
Using systemd socket activation allows the worldserver to start only
when a connection is made to the socket, which can help reduce resource
for small servers.
2025-05-04 11:09:55 +02:00
16 changed files with 2805 additions and 409 deletions

View File

@ -0,0 +1,2 @@
-- DB update 2025_11_06_00 -> 2025_11_06_01
DELETE FROM `vehicle_template_accessory` WHERE `entry` = 24083;

View File

@ -0,0 +1,3 @@
-- DB update 2025_11_06_01 -> 2025_11_07_00
--
DELETE FROM `creature` WHERE `guid` = 3564 AND `id1` = 1135;

View File

@ -0,0 +1,43 @@
-- DB update 2025_11_07_00 -> 2025_11_07_01
--
-- v11_2_5_63906
SET @VBUILD := 63906;
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28932;
UPDATE `creature_template_addon` SET `bytes2` = 1 WHERE (`entry` = 28932);
DELETE FROM `creature` WHERE (`id1` = 28932) AND `guid` IN (96663, 96664, 96671, 96798, 96800, 96865, 96870, 96871);
INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
(96663, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6146.6094, -1971.1476, 481.92764, 5.305801, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL),
(96664, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6143.005, -1973.7048, 482.06653, 4.520403, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL),
(96671, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6218.721, -1985.6326, 482.0804, 4.3982296, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL),
(96798, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6221.371, -1989.2194, 482.06653, 1.5009831, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL),
(96800, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6128.758, -2046.2726, 482.0735, 2.7052603, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL),
(96865, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6131.65, -2049.7249, 482.03876, 0.6806784, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL),
(96870, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6203.877, -2064.1401, 482.06653, 0.06981317, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL),
(96871, 28932, 0, 0, 571, 0, 0, 1, 1, 0, 6207.528, -2061.5386, 482.02487, 4.08407, 300, 5, 0, 4979, 0, 1, 0, 0, 0, '', @VBUILD, 0, NULL);
DELETE FROM `smart_scripts` WHERE (`entryorguid` IN (-96663, -96798, -96800, -96870, -96664, -96671, -96865, -96871)) AND (`source_type` = 0) AND (`id` IN (0));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(-96663, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52686, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam LH\''),
(-96798, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52686, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam LH\''),
(-96800, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52686, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam LH\''),
(-96870, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52686, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam LH\''),
(-96664, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52681, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam RH\''),
(-96671, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52681, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam RH\''),
(-96865, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52681, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam RH\''),
(-96871, 0, 0, 0, 60, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52681, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Effect Bunny - On Update - Cast \'Voltarus Blight Beam RH\'');
-- Set `unitflag` to IMMUNE_TO_PC, verify spawns, add missing spawn
DELETE FROM `creature` WHERE (`id1` = 28931) and `guid` IN (96497, 96498, 96499, 96545);
INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `Comment`, `VerifiedBuild`) VALUES
(96497, 28931, 0, 0, 571, 0, 0, 1, 1, 0, 6144.44, -1971.41, 461.385, 5.16617, 300, 0, 0, 200000, 0, 0, 0, 256, 0, '', NULL, @VBUILD),
(96498, 28931, 0, 0, 571, 0, 0, 1, 1, 0, 6206.33, -2063.48, 461.385, 2.14675, 300, 0, 0, 200000, 0, 0, 0, 256, 0, '', NULL, @VBUILD),
(96499, 28931, 0, 0, 571, 0, 0, 1, 1, 0, 6129.33, -2047.82, 461.385, 0.506145, 300, 0, 0, 200000, 0, 0, 0, 256, 0, '', NULL, @VBUILD),
(96545, 28931, 0, 0, 571, 0, 0, 1, 1, 0, 6221.2, -1986.5, 461.385, 3.78736, 300, 0, 0, 200000, 0, 0, 0, 256, 0, '', NULL, @VBUILD);
-- Voltarus Blight Beam LH, RH
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` IN (52686, 52681)) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 3) AND (`ConditionValue2` = 28931) AND (`ConditionValue3` = 0);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 52686, 0, 0, 31, 0, 3, 28931, 0, 0, 0, 0, '', 'target Blightblood Troll'),
(13, 1, 52681, 0, 0, 31, 0, 3, 28931, 0, 0, 0, 0, '', 'target Blightblood Troll');

View File

@ -0,0 +1,108 @@
-- DB update 2025_11_07_01 -> 2025_11_07_02
-- Add Waypoints (Scarlet Miner)
DELETE FROM `waypoint_data` WHERE (`id` IN (2884100, 2884101));
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
(2884100, 1, 2376.9087, -5906.2495, 108.593, NULL, 0, 1, 0, 100, 0),
(2884100, 2, 2340.1587, -5903.4995, 102.593, NULL, 0, 1, 0, 100, 0),
(2884100, 3, 2306.4087, -5904.7495, 90.593, NULL, 0, 1, 0, 100, 0),
(2884100, 4, 2292.6587, -5917.4995, 82.343, NULL, 0, 1, 0, 100, 0),
(2884100, 5, 2285.6587, -5943.4995, 64.093, NULL, 0, 1, 0, 100, 0),
(2884100, 6, 2271.9087, -5968.4995, 49.843, NULL, 0, 1, 0, 100, 0),
(2884100, 7, 2248.1587, -5978.4995, 36.843, NULL, 0, 1, 0, 100, 0),
(2884100, 8, 2234.6587, -5996.9995, 25.842999, NULL, 0, 1, 0, 100, 0),
(2884100, 9, 2223.4087, -6014.9995, 11.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 10, 2216.1587, -6035.9995, 7.3429985, NULL, 0, 1, 0, 100, 0),
(2884100, 11, 2195.4087, -6061.2495, 6.3429985, NULL, 0, 1, 0, 100, 0),
(2884100, 12, 2184.4087, -6091.9995, 2.0929985, NULL, 0, 1, 0, 100, 0),
(2884100, 13, 2179.6587, -6120.2495, 1.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 14, 2175.4087, -6142.9995, 1.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 15, 2167.9087, -6159.4995, 1.8429985, NULL, 0, 1, 0, 100, 0),
(2884100, 16, 2149.4087, -6161.4995, 1.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 17, 2134.9087, -6166.2495, 0.8429985, NULL, 0, 1, 0, 100, 0),
(2884100, 18, 2130.9087, -6173.2495, 4.3429985, NULL, 0, 1, 0, 100, 0),
(2884100, 19, 2125.9087, -6180.7495, 10.0929985, NULL, 0, 1, 0, 100, 0),
(2884100, 20, 2123.4087, -6184.7495, 14.0929985, NULL, 0, 1, 0, 100, 0),
(2884100, 21, 2115.9087, -6196.2495, 13.8429985, NULL, 0, 1, 0, 100, 0),
(2884100, 22, 2119.1106, -6191.905, 13.275559, NULL, 0, 1, 0, 100, 0),
(2884101, 1, 2376.855, -5906.1553, 108.57493, NULL, 0, 1, 0, 100, 0),
(2884101, 2, 2340.105, -5903.4053, 102.57493, NULL, 0, 1, 0, 100, 0),
(2884101, 3, 2306.855, -5904.9053, 90.57493, NULL, 0, 1, 0, 100, 0),
(2884101, 4, 2292.855, -5917.6553, 82.32493, NULL, 0, 1, 0, 100, 0),
(2884101, 5, 2285.855, -5943.4053, 64.07493, NULL, 0, 1, 0, 100, 0),
(2884101, 6, 2272.105, -5968.4053, 49.82493, NULL, 0, 1, 0, 100, 0),
(2884101, 7, 2248.355, -5978.4053, 36.82493, NULL, 0, 1, 0, 100, 0),
(2884101, 8, 2234.605, -5996.9053, 25.824928, NULL, 0, 1, 0, 100, 0),
(2884101, 9, 2223.605, -6015.1553, 11.574928, NULL, 0, 1, 0, 100, 0),
(2884101, 10, 2216.105, -6035.9053, 7.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 11, 2195.105, -6059.4053, 6.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 12, 2184.855, -6087.1553, 3.0749283, NULL, 0, 1, 0, 100, 0),
(2884101, 13, 2180.605, -6119.4053, 1.5749283, NULL, 0, 1, 0, 100, 0),
(2884101, 14, 2177.605, -6149.4053, 1.8249283, NULL, 0, 1, 0, 100, 0),
(2884101, 15, 2188.855, -6170.4053, 1.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 16, 2213.105, -6165.4053, 1.0749283, NULL, 0, 1, 0, 100, 0),
(2884101, 17, 2241.855, -6160.4053, 2.0749283, NULL, 0, 1, 0, 100, 0),
(2884101, 18, 2269.105, -6163.4053, 2.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 19, 2269.605, -6168.9053, 2.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 20, 2270.105, -6174.6553, 5.8249283, NULL, 0, 1, 0, 100, 0),
(2884101, 21, 2270.605, -6180.9053, 9.824928, NULL, 0, 1, 0, 100, 0),
(2884101, 22, 2271.105, -6186.1553, 14.074928, NULL, 0, 1, 0, 100, 0),
(2884101, 23, 2273.855, -6196.4053, 13.824928, NULL, 0, 1, 0, 100, 0),
(2884101, 24, 2273.0032, -6191.717, 13.239414, NULL, 0, 1, 0, 100, 0);
-- Remove Script Names.
UPDATE `creature_template` SET `ScriptName` = '' WHERE (`entry` IN (28817, 28833, 28841));
UPDATE `gameobject_template` SET `ScriptName` = '' WHERE (`entry` = 190767);
-- Set spell target position for Mine Car spawn.
UPDATE `spell_target_position` SET `PositionX` = 2389.58, `PositionY` = -5901.18, `PositionZ` = 109.02134, `Orientation` = 0 WHERE `ID` = 52462;
-- Set Unit Flag for Mine Car (immune_to_npc)
UPDATE `creature_template` SET `unit_flags` = `unit_flags` |512 WHERE (`entry` = 28817);
-- Set SmartAI (Mine Car)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28817;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28817);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28817, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 25703, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mine Car - On Just Summoned - Morph To Model 25703'),
(28817, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 12, 28841, 8, 0, 0, 0, 0, 8, 0, 0, 0, 0, 2382.171, -5899.672, 107.74545, 0, 'Mine Car - On Just Summoned - Summon Creature \'Scarlet Miner\''),
(28817, 0, 2, 0, 8, 0, 100, 0, 52465, 0, 0, 0, 0, 0, 29, 3, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Mine Car - On Spellhit \'Drag Mine Cart\' - Start Follow Invoker');
-- Set SmartAI (Scarlet Miner)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28841;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28841);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28841, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2884100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - On Just Summoned - Run Script'),
(28841, 0, 1, 0, 109, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2884101, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - On Path 0 Finished - Run Script');
-- Set Scarlet Miner Action List
DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (2884100, 2884101));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(2884100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Set Run Off'),
(2884100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 1, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Move To Owner Or Summoner'),
(2884100, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Say Line 0'),
(2884100, 9, 3, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 11, 52465, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Cast \'Drag Mine Cart\''),
(2884100, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Set Run On'),
(2884100, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 233, 2884100, 2884101, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Start Random Path 2884100-2884101'),
(2884101, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Set Orientation Owner Or Summoner'),
(2884101, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Say Line 1'),
(2884101, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 28, 52465, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Remove Aura \'Drag Mine Cart\''),
(2884101, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Despawn Instant'),
(2884101, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Despawn Instant');
-- Set SmartAI (Scarlet Fleet Defender)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28834;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28834);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28834, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 3000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Fleet Defender - On Just Died - Despawn In 3000 ms'),
(28834, 0, 1, 0, 0, 0, 100, 0, 1000, 5000, 5000, 8000, 0, 0, 11, 52566, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Fleet Defender - In Combat - Cast \'Shoot\'');
-- Update SmartAI (Scarlet Cannon)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28850;
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28850) AND (`source_type` = 0) AND (`id` IN (2));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28850, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 3000, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Land Cannon - On Just Died - Despawn In 3000 ms');

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if defined(__linux__)
#include "Log.h"
#include "StringConvert.h"
#include <cstdlib>
#include <unistd.h>
#include <string>
int get_listen_fd()
{
char* const listen_pid = std::getenv("LISTEN_PID");
char* const listen_fds = std::getenv("LISTEN_FDS");
if (!listen_pid || !listen_fds)
return 0;
pid_t pid = Acore::StringTo<int>(listen_pid).value_or(0);
if (pid != getpid())
return 0;
int fds = Acore::StringTo<int>(listen_fds).value_or(0);
if (fds <= 0)
return 0;
if (fds > 1)
LOG_WARN("network", "Multiple file descriptors received from systemd socket activation, only the first will be used");
return 3;
}
#else
// On non-Linux systems, just return 0 (no socket activation)
int get_listen_fd()
{
return 0;
}
#endif

View File

@ -0,0 +1,23 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SYSTEMD_H_
#define _SYSTEMD_H_
int get_listen_fd();
#endif

View File

@ -48,6 +48,7 @@
#include "SecretMgr.h"
#include "SharedDefines.h"
#include "SteadyTimer.h"
#include "Systemd.h"
#include "World.h"
#include "WorldSessionMgr.h"
#include "WorldSocket.h"
@ -406,6 +407,7 @@ int main(int argc, char** argv)
sScriptMgr->OnShutdown();
// set server offline
if (!sConfigMgr->GetOption<bool>("Network.UseSocketActivation", false))
LoginDatabase.DirectExecute("UPDATE realmlist SET flag = flag | {} WHERE id = '{}'", REALM_FLAG_OFFLINE, realm.Id.Realm);
LOG_INFO("server.worldserver", "Halting process...");

View File

@ -397,6 +397,20 @@ Network.TcpNodelay = 1
Network.EnableProxyProtocol = 0
#
# Network.UseSocketActivation
# Description: Enable systemd socket activation support for the worldserver.
# When enabled and the process is started by systemd socket activation,
# the server will use the socket passed by systemd instead of
# creating and binding its own listening socket. Disabled by default.
#
# When enabled the realm is not automatically set as offline on shutdown.
#
# Example: 1 - (Enabled)
# Default: 0 - (Disabled)
Network.UseSocketActivation = 0
#
###################################################################################################

View File

@ -1848,8 +1848,13 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool
return EQUIP_ERR_NOT_DURING_ARENA_MATCH;
}
if (IsInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer != 0)
if (IsInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC))
{
uint32 cooldownSpell = IsClass(CLASS_ROGUE, CLASS_CONTEXT_WEAPON_SWAP) ? 6123 : 6119;
uint32 startRecoveryTime = sSpellMgr->GetSpellInfo(cooldownSpell)->StartRecoveryTime;
if (m_weaponChangeTimer != 0 && m_weaponChangeTimer != startRecoveryTime)
return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err
}
if (IsNonMeleeSpellCast(false))
return EQUIP_ERR_CANT_DO_RIGHT_NOW;

View File

@ -1170,6 +1170,12 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
pCurrChar->RemoveUnitFlag(UNIT_FLAG_STUNNED);
}
if (pCurrChar->GetPendingFlightChange() <= pCurrChar->GetMapChangeOrderCounter())
{
if (!pCurrChar->HasIncreaseMountedFlightSpeedAura() && !pCurrChar->HasFlyAura())
pCurrChar->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_CAN_FLY);
}
pCurrChar->SendInitialPacketsBeforeAddToMap();
// necessary actions from AddPlayerToMap:

View File

@ -84,14 +84,9 @@ uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false
if (gain && creature)
{
if (creature->isElite())
{
// Elites in instances have a 2.75x XP bonus instead of the regular 2x world bonus.
if (unit->GetMap() && unit->GetMap()->IsDungeon())
xpMod *= 2.75f;
else
xpMod *= 2.0f;
}
// Instanced mobs (particularly bosses) oftentimes have higher bonuses, especially in later content levels
xpMod *= creature->GetCreatureTemplate()->ModExperience;
}

View File

@ -502,49 +502,6 @@ public:
};
};
class npc_scarlet_cannon : public CreatureScript
{
public:
npc_scarlet_cannon() : CreatureScript("npc_scarlet_cannon") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_scarlet_cannonAI(creature);
}
struct npc_scarlet_cannonAI : public VehicleAI
{
npc_scarlet_cannonAI(Creature* creature) : VehicleAI(creature) { summonAttackers = 0; }
uint32 summonAttackers;
void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool apply) override
{
summonAttackers = apply ? 8000 : 0;
}
void UpdateAI(uint32 diff) override
{
VehicleAI::UpdateAI(diff);
if (summonAttackers)
{
summonAttackers += diff;
if (summonAttackers >= 15000)
{
for (uint8 i = 0; i < 15; ++i)
if (Creature* summon = me->SummonCreature(28834 /*NPC_SCARLET_FLEET_DEFENDER*/, 2192.56f + irand(-10, 10), -6147.90f + irand(-10, 10), 5.2f, 4.7f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 45000))
{
summon->SetHomePosition(me->GetHomePosition());
summon->AI()->AttackStart(me);
}
summonAttackers = 1;
}
}
}
};
};
/*######
##Quest 12848
######*/
@ -835,253 +792,6 @@ public:
}
};
/*####
## npc_scarlet_miner_cart
####*/
enum Spells_SM
{
SPELL_CART_CHECK = 54173,
SPELL_CART_DRAG = 52465
};
class npc_scarlet_miner_cart : public CreatureScript
{
public:
npc_scarlet_miner_cart() : CreatureScript("npc_scarlet_miner_cart") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_scarlet_miner_cartAI(creature);
}
struct npc_scarlet_miner_cartAI : public PassiveAI
{
npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature)
{
me->SetImmuneToAll(true);
me->SetFaction(FACTION_FRIENDLY);
me->SetDisplayFromModel(0); // Modelid2 is a horse.
}
ObjectGuid minerGUID;
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
minerGUID = guid;
}
void DoAction(int32 /*param*/) override
{
if (Creature* miner = ObjectAccessor::GetCreature(*me, minerGUID))
{
me->SetWalk(false);
//Not 100% correct, but movement is smooth. Sometimes miner walks faster
//than normal, this speed is fast enough to keep up at those times.
me->SetSpeed(MOVE_RUN, 1.25f);
me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0);
me->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
me->SetFaction(FACTION_FRIENDLY);
}
}
void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
{
who->SetVisible(!apply);
if (!apply)
if (Creature* miner = ObjectAccessor::GetCreature(*me, minerGUID))
miner->DisappearAndDie();
}
};
};
/*####
## npc_scarlet_miner
####*/
enum Says_SM
{
SAY_SCARLET_MINER_0 = 0,
SAY_SCARLET_MINER_1 = 1
};
class npc_scarlet_miner : public CreatureScript
{
public:
npc_scarlet_miner() : CreatureScript("npc_scarlet_miner") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_scarlet_minerAI(creature);
}
struct npc_scarlet_minerAI : public npc_escortAI
{
npc_scarlet_minerAI(Creature* creature) : npc_escortAI(creature)
{
me->SetReactState(REACT_PASSIVE);
}
uint32 IntroTimer;
uint32 IntroPhase;
ObjectGuid carGUID;
void Reset() override
{
carGUID.Clear();
IntroTimer = 0;
IntroPhase = 0;
}
void InitWaypoint()
{
AddWaypoint(1, 2389.03f, -5902.74f, 109.014f, 5000);
AddWaypoint(2, 2341.812012f, -5900.484863f, 102.619743f);
AddWaypoint(3, 2308.34f, -5904.2f, 91.1099f);
AddWaypoint(4, 2300.69f, -5912.99f, 86.1572f);
AddWaypoint(5, 2294.142090f, -5927.274414f, 75.316849f);
AddWaypoint(6, 2286.984375f, -5944.955566f, 63.714966f);
AddWaypoint(7, 2280.001709f, -5961.186035f, 54.228283f);
AddWaypoint(8, 2259.389648f, -5974.197754f, 42.359348f);
AddWaypoint(9, 2242.882812f, -5984.642578f, 32.827850f);
AddWaypoint(10, 2239.79f, -5989.31f, 30.4453f);
AddWaypoint(11, 2236.52f, -5994.28f, 27.4829f);
AddWaypoint(12, 2232.61f, -6000.23f, 23.1281f);
AddWaypoint(13, 2228.69f, -6006.46f, 17.6638f);
AddWaypoint(14, 2225.2f, -6012.39f, 12.9487f);
AddWaypoint(15, 2217.265625f, -6028.959473f, 7.675705f);
AddWaypoint(16, 2202.595947f, -6061.325684f, 5.882018f);
AddWaypoint(17, 2188.974609f, -6080.866699f, 3.370027f);
if (urand(0, 1))
{
AddWaypoint(18, 2176.483887f, -6110.407227f, 1.855181f);
AddWaypoint(19, 2172.516602f, -6146.752441f, 1.074235f);
AddWaypoint(20, 2138.918457f, -6158.920898f, 1.342926f);
AddWaypoint(21, 2129.866699f, -6174.107910f, 4.380779f);
AddWaypoint(22, 2125.250001f, -6181.230001f, 9.91997f);
AddWaypoint(23, 2117.709473f, -6193.830078f, 13.3542f, 10000);
}
else
{
AddWaypoint(18, 2184.190186f, -6166.447266f, 0.968877f);
AddWaypoint(19, 2234.265625f, -6163.741211f, 0.916021f);
AddWaypoint(20, 2268.071777f, -6158.750977f, 1.822252f);
AddWaypoint(21, 2270.028320f, -6176.505859f, 6.340538f);
AddWaypoint(22, 2270.350001f, -6182.410001f, 10.42431f);
AddWaypoint(23, 2271.739014f, -6195.401855f, 13.3542f, 10000);
}
}
void InitCartQuest(Player* who)
{
carGUID = who->GetVehicleBase()->GetGUID();
InitWaypoint();
me->SetWalk(true);
Start(false, who->GetGUID());
SetDespawnAtFar(false);
}
void WaypointReached(uint32 waypointId) override
{
switch (waypointId)
{
case 1:
if (Unit* car = ObjectAccessor::GetCreature(*me, carGUID))
{
me->SetFacingToObject(car);
// xinef: add some flags
car->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE);
car->SetImmuneToAll(true);
car->SetFaction(FACTION_FRIENDLY);
}
Talk(SAY_SCARLET_MINER_0);
me->SetWalk(false);
IntroTimer = 4000;
IntroPhase = 1;
break;
case 23:
if (Creature* car = ObjectAccessor::GetCreature(*me, carGUID))
{
car->SetPosition(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ() + 1, car->GetOrientation());
car->StopMovingOnCurrentPos();
me->SetFacingToObject(car);
car->RemoveAura(SPELL_CART_DRAG);
}
Talk(SAY_SCARLET_MINER_1);
break;
default:
break;
}
}
void UpdateAI(uint32 diff) override
{
if (IntroPhase)
{
if (IntroTimer <= diff)
{
if (IntroPhase == 1)
{
if (Creature* car = ObjectAccessor::GetCreature(*me, carGUID))
DoCast(car, SPELL_CART_DRAG);
IntroTimer = 800;
IntroPhase = 2;
}
else
{
if (Creature* car = ObjectAccessor::GetCreature(*me, carGUID))
car->AI()->DoAction(0);
IntroPhase = 0;
}
}
else IntroTimer -= diff;
}
npc_escortAI::UpdateAI(diff);
}
};
};
/*######
## go_inconspicuous_mine_car
######*/
enum Spells_Cart
{
SPELL_CART_SUMM = 52463
};
class go_inconspicuous_mine_car : public GameObjectScript
{
public:
go_inconspicuous_mine_car() : GameObjectScript("go_inconspicuous_mine_car") { }
bool OnGossipHello(Player* player, GameObject* /*go*/) override
{
if (player->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE)
{
// Hack Why Trinity Dont Support Custom Summon Location
if (Creature* miner = player->SummonCreature(28841, 2383.869629f, -5900.312500f, 107.996086f, player->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1))
{
player->CastSpell(player, SPELL_CART_SUMM, true);
if (Creature* car = player->GetVehicleCreatureBase())
{
if (car->GetEntry() == 28817)
{
car->AI()->SetGUID(miner->GetGUID());
CAST_AI(npc_scarlet_miner::npc_scarlet_minerAI, miner->AI())->InitCartQuest(player);
}
}
}
}
return true;
}
};
class spell_death_knight_initiate_visual : public SpellScript
{
PrepareSpellScript(spell_death_knight_initiate_visual);
@ -1219,13 +929,9 @@ void AddSC_the_scarlet_enclave_c1()
RegisterSpellScript(spell_q12698_the_gift_that_keeps_on_giving);
new npc_scarlet_ghoul();
new npc_dkc1_gothik();
new npc_scarlet_cannon();
new npc_unworthy_initiate();
new npc_unworthy_initiate_anchor();
new go_acherus_soul_prison();
new npc_scarlet_miner();
new npc_scarlet_miner_cart();
new go_inconspicuous_mine_car();
RegisterSpellScript(spell_death_knight_initiate_visual);
RegisterSpellScript(spell_lich_king_whisper);
RegisterSpellScript(spell_lich_king_vo_blocker);

View File

@ -77,51 +77,52 @@ enum Misc
DATA_SET_INSANITY_PHASE = 1,
};
enum Events
{
EVENT_HERALD_MIND_FLAY = 1,
EVENT_HERALD_SHADOW,
EVENT_HERALD_SHIVER,
};
const std::array<uint32, MAX_INSANITY_TARGETS> InsanitySpells = { SPELL_INSANITY_PHASING_1, SPELL_INSANITY_PHASING_2, SPELL_INSANITY_PHASING_3, SPELL_INSANITY_PHASING_4, SPELL_INSANITY_PHASING_5 };
struct boss_volazj : public BossAI
{
boss_volazj(Creature* pCreature) : BossAI(pCreature, DATA_HERALD_VOLAZJ),
insanityTimes(0),
insanityPhase(false)
{ }
void InitializeAI() override
{
BossAI::InitializeAI();
// Visible for all players in insanity
me->SetPhaseMask((1 | 16 | 32 | 64 | 128 | 256), true);
}
void Reset() override
{
_Reset();
insanityTimes = 0;
insanityPhase = false;
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_STUNNED);
ResetPlayersPhaseMask();
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
me->SetPhaseMask((1 | 16 | 32 | 64 | 128 | 256), true);
ScheduleHealthCheckEvent({ 66, 33 }, [&]{
scheduler.CancelAll();
DoCastSelf(SPELL_INSANITY);
}, false);
}
void ScheduleTasks() override
{
ScheduleTimedEvent(8s, [&] {
DoCastVictim(SPELL_MIND_FLAY);
}, 20s);
ScheduleTimedEvent(5s, [&] {
DoCastVictim(SPELL_SHADOW_BOLT_VOLLEY);
}, 5s);
ScheduleTimedEvent(15s, [&] {
DoCastRandomTarget(SPELL_SHIVER);
}, 15s);
}
void JustEngagedWith(Unit* /*who*/) override
{
_JustEngagedWith();
events.ScheduleEvent(EVENT_HERALD_MIND_FLAY, 8s);
events.ScheduleEvent(EVENT_HERALD_SHADOW, 5s);
events.ScheduleEvent(EVENT_HERALD_SHIVER, 15s);
Talk(SAY_AGGRO);
DoCastSelf(SPELL_WHISPER_AGGRO);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
me->SetInCombatWithZone();
}
void JustDied(Unit* /*killer*/) override
@ -184,36 +185,13 @@ struct boss_volazj : public BossAI
}
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override
{
// Do not perform insanity recast if boss is casting Insanity already
if (me->FindCurrentSpellBySpellId(SPELL_INSANITY))
{
return;
}
// First insanity
if (insanityTimes == 0 && me->HealthBelowPctDamaged(66, damage))
{
DoCastSelf(SPELL_INSANITY, false);
++insanityTimes;
}
// Second insanity
else if (insanityTimes == 1 && me->HealthBelowPctDamaged(33, damage))
{
me->InterruptNonMeleeSpells(false);
DoCastSelf(SPELL_INSANITY, false);
++insanityTimes;
}
}
void UpdateAI(uint32 diff) override
{
//Return since we have no target
if (!UpdateVictim())
{
return;
}
scheduler.Update(diff);
if (insanityPhase)
{
@ -226,53 +204,13 @@ struct boss_volazj : public BossAI
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_STUNNED);
me->RemoveAurasDueToSpell(INSANITY_VISUAL);
}
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
while (uint32 const eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_HERALD_MIND_FLAY:
{
DoCastVictim(SPELL_MIND_FLAY, false);
events.Repeat(20s);
break;
}
case EVENT_HERALD_SHADOW:
{
DoCastVictim(SPELL_SHADOW_BOLT_VOLLEY, false);
events.Repeat(5s);
break;
}
case EVENT_HERALD_SHIVER:
{
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
DoCast(pTarget, SPELL_SHIVER, false);
}
events.Repeat(15s);
break;
}
}
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
ScheduleTasks();
}
DoMeleeAttackIfReady();
}
private:
uint8 insanityTimes;
bool insanityPhase; // Indicates if boss enter to insanity phase
uint32 GetPlrInsanityAuraId(uint32 phaseMask) const
@ -312,6 +250,7 @@ private:
bool CheckPhaseMinions()
{
summons.RemoveNotExisting();
if (summons.empty())
{
ResetPlayersPhaseMask();

View File

@ -20,6 +20,7 @@
#include "IpAddress.h"
#include "Log.h"
#include "Systemd.h"
#include <atomic>
#include <boost/asio/ip/tcp.hpp>
#include <functional>
@ -33,10 +34,20 @@ class AsyncAcceptor
public:
typedef void(*AcceptCallback)(tcp::socket&& newSocket, uint32 threadIndex);
AsyncAcceptor(Acore::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port) :
AsyncAcceptor(Acore::Asio::IoContext& ioContext, std::string const& bindIp, uint16 port, bool supportSocketActivation = false) :
_acceptor(ioContext), _endpoint(Acore::Net::make_address(bindIp), port),
_socket(ioContext), _closed(false), _socketFactory([this](){ return DefaultSocketFactory(); })
_socket(ioContext), _closed(false), _socketFactory([this](){ return DefaultSocketFactory(); }),
_supportSocketActivation(supportSocketActivation)
{
int const listen_fd = get_listen_fd();
if (_supportSocketActivation && listen_fd > 0)
{
LOG_DEBUG("network", "Using socket from systemd socket activation");
boost::system::error_code errorCode;
_acceptor.assign(boost::asio::ip::tcp::v4(), listen_fd, errorCode);
if (errorCode)
LOG_WARN("network", "Failed to assign socket {}", errorCode.message());
}
}
template<class T>
@ -72,6 +83,9 @@ public:
bool Bind()
{
boost::system::error_code errorCode;
// with socket activation the acceptor is already open and bound
if (!_acceptor.is_open())
{
_acceptor.open(_endpoint.protocol(), errorCode);
if (errorCode)
{
@ -94,6 +108,7 @@ public:
LOG_INFO("network", "Could not bind to {}:{} {}", _endpoint.address().to_string(), _endpoint.port(), errorCode.message());
return false;
}
}
_acceptor.listen(ACORE_MAX_LISTEN_CONNECTIONS, errorCode);
if (errorCode)
@ -124,6 +139,7 @@ private:
tcp::socket _socket;
std::atomic<bool> _closed;
std::function<std::pair<tcp::socket*, uint32>()> _socketFactory;
bool _supportSocketActivation;
};
template<class T>

View File

@ -19,6 +19,7 @@
#define SocketMgr_h__
#include "AsyncAcceptor.h"
#include "Config.h"
#include "Errors.h"
#include "NetworkThread.h"
#include <boost/asio/ip/tcp.hpp>
@ -42,7 +43,8 @@ public:
std::unique_ptr<AsyncAcceptor> acceptor;
try
{
acceptor = std::make_unique<AsyncAcceptor>(ioContext, bindIp, port);
bool supportSocketActivation = sConfigMgr->GetOption<bool>("Network.UseSocketActivation", false);
acceptor = std::make_unique<AsyncAcceptor>(ioContext, bindIp, port, supportSocketActivation);
}
catch (boost::system::system_error const& err)
{