diff options
| author | Nayd <dnpd.dd@gmail.com> | 2015-01-28 13:58:40 +0000 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2019-07-09 21:17:59 +0200 |
| commit | 9a9af3cc5f7433a4de653b2cf28f3d8c757db8f9 (patch) | |
| tree | cb8f17361a84a91bcd37265d7ec0f859033e26c1 /src/server/game/Server | |
| parent | 2a9c038fc8bf87b968a94b23bd0ddb79fecf8b17 (diff) | |
Core/Packets: Update and enable SMSG_WEATHER
(cherry picked from commit 6f7d048765f102110cbf9ad4653c078fbadaa105)
Diffstat (limited to 'src/server/game/Server')
| -rw-r--r-- | src/server/game/Server/Packets/MiscPackets.cpp | 32 | ||||
| -rw-r--r-- | src/server/game/Server/Packets/MiscPackets.h | 45 |
2 files changed, 77 insertions, 0 deletions
diff --git a/src/server/game/Server/Packets/MiscPackets.cpp b/src/server/game/Server/Packets/MiscPackets.cpp new file mode 100644 index 00000000000..6348fe3b339 --- /dev/null +++ b/src/server/game/Server/Packets/MiscPackets.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 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 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/>. + */ + +#include "MiscPackets.h" + +WorldPackets::Misc::Weather::Weather() : ServerPacket(SMSG_WEATHER, 4 + 4 + 1) { } + +WorldPackets::Misc::Weather::Weather(WeatherState weatherID, float intensity /*= 0.0f*/, bool abrupt /*= false*/) + : ServerPacket(SMSG_WEATHER, 4 + 4 + 1), Abrupt(abrupt), Intensity(intensity), WeatherID(weatherID) { } + +WorldPacket const* WorldPackets::Misc::Weather::Write() +{ + _worldPacket << uint32(WeatherID); + _worldPacket << float(Intensity); + _worldPacket << uint8(Abrupt); + + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/MiscPackets.h b/src/server/game/Server/Packets/MiscPackets.h new file mode 100644 index 00000000000..4033b44e97d --- /dev/null +++ b/src/server/game/Server/Packets/MiscPackets.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 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 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 MiscPackets_h__ +#define MiscPackets_h__ + +#include "Packet.h" +#include "Weather.h" + +enum WeatherState : uint32; + +namespace WorldPackets +{ + namespace Misc + { + class TC_GAME_API Weather final : public ServerPacket + { + public: + Weather(); + Weather(WeatherState weatherID, float intensity = 0.0f, bool abrupt = false); + + WorldPacket const* Write() override; + + bool Abrupt = false; + float Intensity = 0.0f; + WeatherState WeatherID = WeatherState(0); + }; + } +} + +#endif // MiscPackets_h__ |
