Files
azerothcore-wotlk/src/server/game/Server/Packets/MiscPackets.h
Kitzunu ead906c58f refactor(Core/Packets): Rewrite MSG_RANDOM_ROLL to new packet class (#10590)
* refactor(Core/Packets): Rewrite MSG_RANDOM_ROLL

* cherry-pick commit (c0f516caee)

Co-Authored-By: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
Co-Authored-By: DJScias <439655+DJScias@users.noreply.github.com>

* handle crash check in DoRandomRoll()

* Update MiscPackets.h

* Update Player.h

Co-authored-by: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
Co-authored-by: DJScias <439655+DJScias@users.noreply.github.com>
2022-02-11 10:30:49 +01:00

71 lines
2.0 KiB
C++

/*
* 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 MiscPackets_h__
#define MiscPackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
#include "Weather.h"
enum WeatherState : uint32;
namespace WorldPackets
{
namespace Misc
{
class AC_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);
};
class RandomRollClient final : public ClientPacket
{
public:
RandomRollClient(WorldPacket&& packet) : ClientPacket(MSG_RANDOM_ROLL, std::move(packet)) { }
void Read() override;
uint32 Min = 0;
uint32 Max = 0;
};
class RandomRoll final : public ServerPacket
{
public:
RandomRoll() : ServerPacket(MSG_RANDOM_ROLL, 4 + 4 + 4 + 8) { }
WorldPacket const* Write() override;
uint32 Min = 0;
uint32 Max = 0;
uint32 Result = 0;
ObjectGuid Roller;
};
}
}
#endif // MiscPackets_h__