diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index b98501165..7f75eda1e 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -21,7 +21,7 @@ using namespace std; Networking *Networking::sThis = 0; -static WorldEvent *worldEvent = nullptr; +static BaseEvent *baseEvent = nullptr; Networking::Networking(RakNet::RakPeerInterface *peer) { @@ -418,13 +418,13 @@ void Networking::processWorldPacket(RakNet::Packet *packet) WorldPacket *myPacket = worldController->GetPacket(packet->data[0]); - if (worldEvent) + if (baseEvent) { - delete worldEvent; - worldEvent = nullptr; + delete baseEvent; + baseEvent = nullptr; } - worldEvent = new WorldEvent(player->guid); + baseEvent = new BaseEvent(player->guid); switch (packet->data[0]) { @@ -434,12 +434,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_PLACE from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); Script::Call( player->getId(), - worldEvent->cell.getDescription().c_str()); + baseEvent->cell.getDescription().c_str()); break; } @@ -449,12 +449,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_DELETE from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); Script::Call( player->getId(), - worldEvent->cell.getDescription().c_str()); + baseEvent->cell.getDescription().c_str()); break; } @@ -464,12 +464,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_SCALE from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); Script::Call( player->getId(), - worldEvent->cell.getDescription().c_str()); + baseEvent->cell.getDescription().c_str()); break; } @@ -479,12 +479,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_LOCK from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); Script::Call( player->getId(), - worldEvent->cell.getDescription().c_str()); + baseEvent->cell.getDescription().c_str()); break; } @@ -494,12 +494,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_UNLOCK from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); Script::Call( player->getId(), - worldEvent->cell.getDescription().c_str()); + baseEvent->cell.getDescription().c_str()); break; } @@ -509,8 +509,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_MOVE from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -520,8 +520,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ROTATE from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -531,8 +531,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ANIM_PLAY from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -542,8 +542,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONTAINER from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -553,8 +553,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_HEALTH from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -564,12 +564,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_DOOR_STATE from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); Script::Call( player->getId(), - worldEvent->cell.getDescription().c_str()); + baseEvent->cell.getDescription().c_str()); break; } @@ -579,8 +579,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_SHORT from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -590,8 +590,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_FLOAT from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -601,8 +601,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_MEMBER_SHORT from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -612,8 +612,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_GLOBAL_SHORT from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -623,8 +623,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_MUSIC_PLAY from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -634,8 +634,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_VIDEO_PLAY from %s", player->npc.mName.c_str()); - myPacket->Read(worldEvent); - myPacket->Send(worldEvent, true); + myPacket->Read(baseEvent); + myPacket->Send(baseEvent, true); break; } @@ -746,9 +746,9 @@ WorldPacketController *Networking::getWorldController() const return worldController; } -WorldEvent *Networking::getLastEvent() +BaseEvent *Networking::getLastEvent() { - return worldEvent; + return baseEvent; } const Networking &Networking::get() diff --git a/apps/openmw-mp/Networking.hpp b/apps/openmw-mp/Networking.hpp index e72c62fd0..24bac7775 100644 --- a/apps/openmw-mp/Networking.hpp +++ b/apps/openmw-mp/Networking.hpp @@ -36,7 +36,7 @@ namespace mwmp PlayerPacketController *getPlayerController() const; WorldPacketController *getWorldController() const; - WorldEvent *getLastEvent(); + BaseEvent *getLastEvent(); MasterClient *getMasterClient(); void InitQuery(std::string queryAddr, unsigned short queryPort, std::string serverAddr, unsigned short serverPort); diff --git a/apps/openmw-mp/Script/Functions/World.cpp b/apps/openmw-mp/Script/Functions/World.cpp index aa0126e82..aa153714a 100644 --- a/apps/openmw-mp/Script/Functions/World.cpp +++ b/apps/openmw-mp/Script/Functions/World.cpp @@ -4,28 +4,28 @@ #include #include #include -#include +#include #include "World.hpp" using namespace mwmp; -static WorldEvent *worldEvent = nullptr; +static BaseEvent *baseEvent = nullptr; static WorldObject tempWorldObject; std::regex exteriorCellPattern("^(-?\\d+), (-?\\d+)$"); -void WorldFunctions::CreateWorldEvent(unsigned short pid) noexcept +void WorldFunctions::CreateBaseEvent(unsigned short pid) noexcept { Player *player; GET_PLAYER(pid, player, ); - if (worldEvent) + if (baseEvent) { - delete worldEvent; - worldEvent = nullptr; + delete baseEvent; + baseEvent = nullptr; } - worldEvent = new WorldEvent(player->guid); + baseEvent = new BaseEvent(player->guid); } void WorldFunctions::AddWorldObject() noexcept @@ -41,29 +41,29 @@ void WorldFunctions::AddWorldObject() noexcept worldObject.lockLevel = tempWorldObject.lockLevel; worldObject.pos = tempWorldObject.pos; - worldEvent->objectChanges.objects.push_back(worldObject); + baseEvent->objectChanges.objects.push_back(worldObject); } -void WorldFunctions::SetWorldEventCell(const char* cellDescription) noexcept +void WorldFunctions::SetBaseEventCell(const char* cellDescription) noexcept { std::string description = cellDescription; std::smatch baseMatch; if (std::regex_match(description, baseMatch, exteriorCellPattern)) { - worldEvent->cell.mData.mFlags &= ~ESM::Cell::Interior; + baseEvent->cell.mData.mFlags &= ~ESM::Cell::Interior; // The first sub match is the whole string, so check for a length of 3 if (baseMatch.size() == 3) { - worldEvent->cell.mData.mX = stoi(baseMatch[1].str()); - worldEvent->cell.mData.mY = stoi(baseMatch[2].str()); + baseEvent->cell.mData.mX = stoi(baseMatch[1].str()); + baseEvent->cell.mData.mY = stoi(baseMatch[2].str()); } } else { - worldEvent->cell.mData.mFlags |= ESM::Cell::Interior; - worldEvent->cell.mName = description; + baseEvent->cell.mData.mFlags |= ESM::Cell::Interior; + baseEvent->cell.mName = description; } } @@ -198,32 +198,32 @@ double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept void WorldFunctions::SendObjectDelete() noexcept { - mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_DELETE)->Send(worldEvent, worldEvent->guid); + mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_DELETE)->Send(baseEvent, baseEvent->guid); } void WorldFunctions::SendObjectPlace() noexcept { - mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_PLACE)->Send(worldEvent, worldEvent->guid); + mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_PLACE)->Send(baseEvent, baseEvent->guid); } void WorldFunctions::SendObjectScale() noexcept { - mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_SCALE)->Send(worldEvent, worldEvent->guid); + mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_SCALE)->Send(baseEvent, baseEvent->guid); } void WorldFunctions::SendObjectLock() noexcept { - mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_LOCK)->Send(worldEvent, worldEvent->guid); + mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_LOCK)->Send(baseEvent, baseEvent->guid); } void WorldFunctions::SendObjectUnlock() noexcept { - mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_UNLOCK)->Send(worldEvent, worldEvent->guid); + mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_UNLOCK)->Send(baseEvent, baseEvent->guid); } void WorldFunctions::SendDoorState() noexcept { - mwmp::Networking::get().getWorldController()->GetPacket(ID_DOOR_STATE)->Send(worldEvent, worldEvent->guid); + mwmp::Networking::get().getWorldController()->GetPacket(ID_DOOR_STATE)->Send(baseEvent, baseEvent->guid); } void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept diff --git a/apps/openmw-mp/Script/Functions/World.hpp b/apps/openmw-mp/Script/Functions/World.hpp index 3876d7f56..a32f81bf2 100644 --- a/apps/openmw-mp/Script/Functions/World.hpp +++ b/apps/openmw-mp/Script/Functions/World.hpp @@ -2,10 +2,10 @@ #define OPENMW_WORLD_HPP #define WORLDFUNCTIONS \ - {"CreateWorldEvent", WorldFunctions::CreateWorldEvent},\ + {"CreateBaseEvent", WorldFunctions::CreateBaseEvent},\ \ {"AddWorldObject", WorldFunctions::AddWorldObject},\ - {"SetWorldEventCell", WorldFunctions::SetWorldEventCell},\ + {"SetBaseEventCell", WorldFunctions::SetBaseEventCell},\ \ {"SetObjectRefId", WorldFunctions::SetObjectRefId},\ {"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\ @@ -50,10 +50,10 @@ class WorldFunctions { public: - static void CreateWorldEvent(unsigned short pid) noexcept; + static void CreateBaseEvent(unsigned short pid) noexcept; static void AddWorldObject() noexcept; - static void SetWorldEventCell(const char* cellDescription) noexcept; + static void SetBaseEventCell(const char* cellDescription) noexcept; static void SetObjectRefId(const char* refId) noexcept; static void SetObjectRefNumIndex(int refNumIndex) noexcept; diff --git a/apps/openmw/mwmp/LocalEvent.hpp b/apps/openmw/mwmp/LocalEvent.hpp index 3484dc327..d9e5256ec 100644 --- a/apps/openmw/mwmp/LocalEvent.hpp +++ b/apps/openmw/mwmp/LocalEvent.hpp @@ -1,14 +1,14 @@ #ifndef OPENMW_LOCALEVENT_HPP #define OPENMW_LOCALEVENT_HPP -#include +#include #include "../mwworld/cellstore.hpp" #include namespace mwmp { class Networking; - class LocalEvent : public WorldEvent + class LocalEvent : public BaseEvent { public: diff --git a/components/openmw-mp/Base/WorldEvent.hpp b/components/openmw-mp/Base/BaseEvent.hpp similarity index 88% rename from components/openmw-mp/Base/WorldEvent.hpp rename to components/openmw-mp/Base/BaseEvent.hpp index da85e45dd..97cd868cf 100644 --- a/components/openmw-mp/Base/WorldEvent.hpp +++ b/components/openmw-mp/Base/BaseEvent.hpp @@ -1,5 +1,5 @@ -#ifndef OPENMW_WORLDEVENT_HPP -#define OPENMW_WORLDEVENT_HPP +#ifndef OPENMW_BASEEVENT_HPP +#define OPENMW_BASEEVENT_HPP #include #include @@ -65,16 +65,16 @@ namespace mwmp int action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item }; - class WorldEvent + class BaseEvent { public: - WorldEvent(RakNet::RakNetGUID guid) : guid(guid) + BaseEvent(RakNet::RakNetGUID guid) : guid(guid) { } - WorldEvent() + BaseEvent() { } @@ -87,4 +87,4 @@ namespace mwmp }; } -#endif //OPENMW_WORLDEVENT_HPP +#endif //OPENMW_BASEEVENT_HPP diff --git a/components/openmw-mp/Packets/World/PacketContainer.cpp b/components/openmw-mp/Packets/World/PacketContainer.cpp index 9c2687b98..517e541ad 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.cpp +++ b/components/openmw-mp/Packets/World/PacketContainer.cpp @@ -8,7 +8,7 @@ PacketContainer::PacketContainer(RakNet::RakPeerInterface *peer) : WorldPacket(p packetID = ID_CONTAINER; } -void PacketContainer::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketContainer::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketContainer.hpp b/components/openmw-mp/Packets/World/PacketContainer.hpp index 8c80ff7a8..c1fcb6d89 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.hpp +++ b/components/openmw-mp/Packets/World/PacketContainer.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketContainer(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketDoorState.cpp b/components/openmw-mp/Packets/World/PacketDoorState.cpp index 2682e8be7..c14659958 100644 --- a/components/openmw-mp/Packets/World/PacketDoorState.cpp +++ b/components/openmw-mp/Packets/World/PacketDoorState.cpp @@ -8,7 +8,7 @@ PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : WorldPacket(p packetID = ID_DOOR_STATE; } -void PacketDoorState::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketDoorState::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketDoorState.hpp b/components/openmw-mp/Packets/World/PacketDoorState.hpp index 5e354d13c..130bbe1e3 100644 --- a/components/openmw-mp/Packets/World/PacketDoorState.hpp +++ b/components/openmw-mp/Packets/World/PacketDoorState.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketDoorState(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketMusicPlay.cpp b/components/openmw-mp/Packets/World/PacketMusicPlay.cpp index 73b25e786..ef9f45962 100644 --- a/components/openmw-mp/Packets/World/PacketMusicPlay.cpp +++ b/components/openmw-mp/Packets/World/PacketMusicPlay.cpp @@ -8,7 +8,7 @@ PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : WorldPacket(p packetID = ID_MUSIC_PLAY; } -void PacketMusicPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketMusicPlay::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketMusicPlay.hpp b/components/openmw-mp/Packets/World/PacketMusicPlay.hpp index d9542bb85..69cb9635a 100644 --- a/components/openmw-mp/Packets/World/PacketMusicPlay.hpp +++ b/components/openmw-mp/Packets/World/PacketMusicPlay.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketMusicPlay(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp index 9997c8bfb..dfc1eca31 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.cpp @@ -8,7 +8,7 @@ PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : Wor packetID = ID_OBJECT_ANIM_PLAY; } -void PacketObjectAnimPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectAnimPlay::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp index 02082c644..b22a87e79 100644 --- a/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectAnimPlay.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectAnimPlay(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp index b577243a0..ea0810177 100644 --- a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp @@ -8,7 +8,7 @@ PacketObjectDelete::PacketObjectDelete(RakNet::RakPeerInterface *peer) : WorldPa packetID = ID_OBJECT_DELETE; } -void PacketObjectDelete::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectDelete::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.hpp b/components/openmw-mp/Packets/World/PacketObjectDelete.hpp index d3042bc67..3f125244b 100644 --- a/components/openmw-mp/Packets/World/PacketObjectDelete.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectDelete.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectDelete(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectHealth.cpp b/components/openmw-mp/Packets/World/PacketObjectHealth.cpp index 930e0a791..46411134f 100644 --- a/components/openmw-mp/Packets/World/PacketObjectHealth.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectHealth.cpp @@ -8,7 +8,7 @@ PacketObjectHealth::PacketObjectHealth(RakNet::RakPeerInterface *peer) : WorldPa packetID = ID_OBJECT_HEALTH; } -void PacketObjectHealth::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectHealth::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); } diff --git a/components/openmw-mp/Packets/World/PacketObjectHealth.hpp b/components/openmw-mp/Packets/World/PacketObjectHealth.hpp index 541fab0c6..fca1b634f 100644 --- a/components/openmw-mp/Packets/World/PacketObjectHealth.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectHealth.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectHealth(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectLock.cpp b/components/openmw-mp/Packets/World/PacketObjectLock.cpp index 2adf302b0..fc15ab531 100644 --- a/components/openmw-mp/Packets/World/PacketObjectLock.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectLock.cpp @@ -8,7 +8,7 @@ PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : WorldPacket packetID = ID_OBJECT_LOCK; } -void PacketObjectLock::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectLock::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectLock.hpp b/components/openmw-mp/Packets/World/PacketObjectLock.hpp index 1eb91149d..f65d27df1 100644 --- a/components/openmw-mp/Packets/World/PacketObjectLock.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectLock.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectLock(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectMove.cpp b/components/openmw-mp/Packets/World/PacketObjectMove.cpp index 30b79f65f..4d2e6d293 100644 --- a/components/openmw-mp/Packets/World/PacketObjectMove.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectMove.cpp @@ -8,7 +8,7 @@ PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : WorldPacket packetID = ID_OBJECT_MOVE; } -void PacketObjectMove::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectMove::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectMove.hpp b/components/openmw-mp/Packets/World/PacketObjectMove.hpp index ad41bc079..9ebea8ff1 100644 --- a/components/openmw-mp/Packets/World/PacketObjectMove.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectMove.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectMove(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp index 9c97a7bc5..967a4de38 100644 --- a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp @@ -8,7 +8,7 @@ PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPack packetID = ID_OBJECT_PLACE; } -void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectPlace::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.hpp b/components/openmw-mp/Packets/World/PacketObjectPlace.hpp index cea0263dd..fb0d9f740 100644 --- a/components/openmw-mp/Packets/World/PacketObjectPlace.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectPlace.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectPlace(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectRotate.cpp b/components/openmw-mp/Packets/World/PacketObjectRotate.cpp index d0038499d..49d20d16c 100644 --- a/components/openmw-mp/Packets/World/PacketObjectRotate.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectRotate.cpp @@ -8,7 +8,7 @@ PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : WorldPa packetID = ID_OBJECT_ROTATE; } -void PacketObjectRotate::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectRotate::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectRotate.hpp b/components/openmw-mp/Packets/World/PacketObjectRotate.hpp index de772ef4c..601f6039e 100644 --- a/components/openmw-mp/Packets/World/PacketObjectRotate.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectRotate.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectRotate(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectScale.cpp b/components/openmw-mp/Packets/World/PacketObjectScale.cpp index 64671601e..314a650f2 100644 --- a/components/openmw-mp/Packets/World/PacketObjectScale.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectScale.cpp @@ -8,7 +8,7 @@ PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : WorldPack packetID = ID_OBJECT_SCALE; } -void PacketObjectScale::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectScale::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectScale.hpp b/components/openmw-mp/Packets/World/PacketObjectScale.hpp index 0a3c7942d..5991ada9f 100644 --- a/components/openmw-mp/Packets/World/PacketObjectScale.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectScale.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectScale(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp b/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp index 174105319..ff9436e35 100644 --- a/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp +++ b/components/openmw-mp/Packets/World/PacketObjectUnlock.cpp @@ -8,7 +8,7 @@ PacketObjectUnlock::PacketObjectUnlock(RakNet::RakPeerInterface *peer) : WorldPa packetID = ID_OBJECT_UNLOCK; } -void PacketObjectUnlock::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketObjectUnlock::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketObjectUnlock.hpp b/components/openmw-mp/Packets/World/PacketObjectUnlock.hpp index dec44f18f..1b4d4a7e0 100644 --- a/components/openmw-mp/Packets/World/PacketObjectUnlock.hpp +++ b/components/openmw-mp/Packets/World/PacketObjectUnlock.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketObjectUnlock(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp index 3a58c1e9d..5e3fbe301 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.cpp @@ -8,7 +8,7 @@ PacketScriptGlobalShort::PacketScriptGlobalShort(RakNet::RakPeerInterface *peer) packetID = ID_SCRIPT_GLOBAL_SHORT; } -void PacketScriptGlobalShort::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketScriptGlobalShort::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp index 27d3df662..d0738c7cc 100644 --- a/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptGlobalShort.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketScriptGlobalShort(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp index 693ce9b86..d72191dbb 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.cpp @@ -8,7 +8,7 @@ PacketScriptLocalFloat::PacketScriptLocalFloat(RakNet::RakPeerInterface *peer) : packetID = ID_SCRIPT_LOCAL_FLOAT; } -void PacketScriptLocalFloat::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketScriptLocalFloat::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp index c5f28f4b1..8599609a4 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalFloat.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketScriptLocalFloat(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp b/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp index 34ced66c0..441a190b4 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalShort.cpp @@ -8,7 +8,7 @@ PacketScriptLocalShort::PacketScriptLocalShort(RakNet::RakPeerInterface *peer) : packetID = ID_SCRIPT_LOCAL_SHORT; } -void PacketScriptLocalShort::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketScriptLocalShort::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp b/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp index 746bf9c47..cadb9b312 100644 --- a/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptLocalShort.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketScriptLocalShort(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp b/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp index 24bc9e68e..0cefc843a 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp +++ b/components/openmw-mp/Packets/World/PacketScriptMemberShort.cpp @@ -8,7 +8,7 @@ PacketScriptMemberShort::PacketScriptMemberShort(RakNet::RakPeerInterface *peer) packetID = ID_SCRIPT_MEMBER_SHORT; } -void PacketScriptMemberShort::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketScriptMemberShort::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp b/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp index b52728518..e95b0ddce 100644 --- a/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp +++ b/components/openmw-mp/Packets/World/PacketScriptMemberShort.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketScriptMemberShort(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/PacketVideoPlay.cpp b/components/openmw-mp/Packets/World/PacketVideoPlay.cpp index 74f2a0050..f2d9bf3d8 100644 --- a/components/openmw-mp/Packets/World/PacketVideoPlay.cpp +++ b/components/openmw-mp/Packets/World/PacketVideoPlay.cpp @@ -8,7 +8,7 @@ PacketVideoPlay::PacketVideoPlay(RakNet::RakPeerInterface *peer) : WorldPacket(p packetID = ID_VIDEO_PLAY; } -void PacketVideoPlay::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void PacketVideoPlay::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { WorldPacket::Packet(bs, event, send); diff --git a/components/openmw-mp/Packets/World/PacketVideoPlay.hpp b/components/openmw-mp/Packets/World/PacketVideoPlay.hpp index 869864852..bff4c6070 100644 --- a/components/openmw-mp/Packets/World/PacketVideoPlay.hpp +++ b/components/openmw-mp/Packets/World/PacketVideoPlay.hpp @@ -10,7 +10,7 @@ namespace mwmp public: PacketVideoPlay(RakNet::RakPeerInterface *peer); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); }; } diff --git a/components/openmw-mp/Packets/World/WorldPacket.cpp b/components/openmw-mp/Packets/World/WorldPacket.cpp index 8a962cac6..051b41d7d 100644 --- a/components/openmw-mp/Packets/World/WorldPacket.cpp +++ b/components/openmw-mp/Packets/World/WorldPacket.cpp @@ -5,7 +5,7 @@ using namespace mwmp; -void WorldPacket::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +void WorldPacket::Packet(RakNet::BitStream *bs, BaseEvent *event, bool send) { this->event = event; this->bs = bs; @@ -30,21 +30,21 @@ WorldPacket::~WorldPacket() } -void WorldPacket::Send(WorldEvent *event, RakNet::AddressOrGUID destination) +void WorldPacket::Send(BaseEvent *event, RakNet::AddressOrGUID destination) { bsSend->ResetWritePointer(); Packet(bsSend, event, true); peer->Send(bsSend, priority, reliability, 0, destination, false); } -void WorldPacket::Send(WorldEvent *event, bool toOther) +void WorldPacket::Send(BaseEvent *event, bool toOther) { bsSend->ResetWritePointer(); Packet(bsSend, event, true); peer->Send(bsSend, priority, reliability, 0, event->guid, toOther); } -void WorldPacket::Read(WorldEvent *event) +void WorldPacket::Read(BaseEvent *event) { Packet(bsRead, event, false); } diff --git a/components/openmw-mp/Packets/World/WorldPacket.hpp b/components/openmw-mp/Packets/World/WorldPacket.hpp index 59950245e..727ec3de3 100644 --- a/components/openmw-mp/Packets/World/WorldPacket.hpp +++ b/components/openmw-mp/Packets/World/WorldPacket.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include @@ -19,11 +19,11 @@ namespace mwmp ~WorldPacket(); - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + virtual void Packet(RakNet::BitStream *bs, BaseEvent *event, bool send); - virtual void Send(WorldEvent *event, bool toOtherPlayers = true); - virtual void Send(WorldEvent *event, RakNet::AddressOrGUID destination); - virtual void Read(WorldEvent *event); + virtual void Send(BaseEvent *event, bool toOtherPlayers = true); + virtual void Send(BaseEvent *event, RakNet::AddressOrGUID destination); + virtual void Read(BaseEvent *event); static size_t headerSize() { @@ -36,7 +36,7 @@ namespace mwmp } protected: - WorldEvent *event; + BaseEvent *event; }; }