[General] Rename WorldEvent into BaseEvent

pull/163/head
David Cernat 8 years ago
parent 27242cdab9
commit 182b238b5f

@ -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<Script::CallbackIdentity("OnObjectPlace")>(
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<Script::CallbackIdentity("OnObjectDelete")>(
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<Script::CallbackIdentity("OnObjectScale")>(
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<Script::CallbackIdentity("OnObjectLock")>(
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<Script::CallbackIdentity("OnObjectUnlock")>(
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<Script::CallbackIdentity("OnDoorState")>(
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()

@ -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);

@ -4,28 +4,28 @@
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Base/WorldEvent.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp>
#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

@ -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;

@ -1,14 +1,14 @@
#ifndef OPENMW_LOCALEVENT_HPP
#define OPENMW_LOCALEVENT_HPP
#include <components/openmw-mp/Base/WorldEvent.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp>
#include "../mwworld/cellstore.hpp"
#include <RakNetTypes.h>
namespace mwmp
{
class Networking;
class LocalEvent : public WorldEvent
class LocalEvent : public BaseEvent
{
public:

@ -1,5 +1,5 @@
#ifndef OPENMW_WORLDEVENT_HPP
#define OPENMW_WORLDEVENT_HPP
#ifndef OPENMW_BASEEVENT_HPP
#define OPENMW_BASEEVENT_HPP
#include <components/esm/loadcell.hpp>
#include <components/esm/cellref.hpp>
@ -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

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);
}

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);

@ -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);
};
}

@ -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);
}

@ -5,7 +5,7 @@
#include <RakNetTypes.h>
#include <BitStream.h>
#include <PacketPriority.h>
#include <components/openmw-mp/Base/WorldEvent.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Packets/BasePacket.hpp>
@ -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;
};
}

Loading…
Cancel
Save