diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-05-13 11:49:09 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2017-05-13 11:49:09 +0200 |
commit | beb3316089b350a43e917d896e682298df8dcfc0 (patch) | |
tree | 8006c52594009f226d834991d101c97057699594 /src/server/game/Server/Packet.cpp | |
parent | c00316d3d4b57826cc8e38feed24faf84832c04b (diff) |
Core/Shared: Include cleanup
Diffstat (limited to 'src/server/game/Server/Packet.cpp')
-rw-r--r-- | src/server/game/Server/Packet.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/server/game/Server/Packet.cpp b/src/server/game/Server/Packet.cpp new file mode 100644 index 00000000000..09fdb85571f --- /dev/null +++ b/src/server/game/Server/Packet.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2008-2017 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 "Packet.h" +#include "Errors.h" + +WorldPackets::Packet::Packet(WorldPacket&& worldPacket) + : _worldPacket(std::move(worldPacket)) +{ +} + +WorldPackets::ServerPacket::ServerPacket(OpcodeServer opcode, size_t initialSize /*= 200*/, ConnectionType connection /*= CONNECTION_TYPE_DEFAULT*/) + : Packet(WorldPacket(opcode, initialSize, connection)) +{ +} + +void WorldPackets::ServerPacket::Read() +{ + ASSERT(!"Read not implemented for server packets."); +} + +WorldPackets::ClientPacket::ClientPacket(OpcodeClient expectedOpcode, WorldPacket&& packet) + : Packet(std::move(packet)) +{ + ASSERT(GetOpcode() == expectedOpcode); +} + +WorldPackets::ClientPacket::ClientPacket(WorldPacket&& packet) + : Packet(std::move(packet)) +{ +} + +WorldPacket const* WorldPackets::ClientPacket::Write() +{ + ASSERT(!"Write not allowed for client packets."); + // Shut up some compilers + return nullptr; +} |