[General] Add placeholders for 12 new packets, to be implemented soon
Additionally, make it slightly clearer who created which previously existing packets.pull/249/merge
parent
b3b7003313
commit
27148ce9eb
@ -0,0 +1,27 @@
|
||||
#ifndef OPENMW_PROCESSORACTORAI_HPP
|
||||
#define OPENMW_PROCESSORACTORAI_HPP
|
||||
|
||||
#include "apps/openmw-mp/ActorProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorAI : public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorAI()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_AI)
|
||||
}
|
||||
|
||||
void Do(ActorPacket &packet, Player &player, BaseActorList &actorList) override
|
||||
{
|
||||
// Send only to players who have the cell loaded
|
||||
Cell *serverCell = CellController::get()->getCell(&actorList.cell);
|
||||
|
||||
if (serverCell != nullptr && *serverCell->getAuthority() == actorList.guid)
|
||||
serverCell->sendToLoaded(&packet, &actorList);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORAI_HPP
|
@ -1,23 +0,0 @@
|
||||
#ifndef OPENMW_PROCESSORACTORAUTHORITY_HPP
|
||||
#define OPENMW_PROCESSORACTORAUTHORITY_HPP
|
||||
|
||||
#include "apps/openmw-mp/ActorProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorAuthority : public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorAuthority()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_AUTHORITY)
|
||||
}
|
||||
|
||||
void Do(ActorPacket &packet, Player &player, BaseActorList &actorList) override
|
||||
{
|
||||
// In the current implementation, only the server should be able to send ActorAuthority packets
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORAUTHORITY_HPP
|
@ -0,0 +1,27 @@
|
||||
#ifndef OPENMW_PROCESSORACTORDEATH_HPP
|
||||
#define OPENMW_PROCESSORACTORDEATH_HPP
|
||||
|
||||
#include "apps/openmw-mp/ActorProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorDeath : public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorDeath()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_DEATH)
|
||||
}
|
||||
|
||||
void Do(ActorPacket &packet, Player &player, BaseActorList &actorList) override
|
||||
{
|
||||
// Send only to players who have the cell loaded
|
||||
Cell *serverCell = CellController::get()->getCell(&actorList.cell);
|
||||
|
||||
if (serverCell != nullptr && *serverCell->getAuthority() == actorList.guid)
|
||||
serverCell->sendToLoaded(&packet, &actorList);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORDEATH_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORGAMEWEATHER_HPP
|
||||
#define OPENMW_PROCESSORGAMEWEATHER_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorGameWeather : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorGameWeather()
|
||||
{
|
||||
BPP_INIT(ID_GAME_WEATHER)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORGAMEWEATHER_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERANIMPLAY_HPP
|
||||
#define OPENMW_PROCESSORPLAYERANIMPLAY_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerAnimPlay : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerAnimPlay()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_ANIM_PLAY)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
DEBUG_PRINTF(strPacketID.c_str());
|
||||
|
||||
player.sendToLoaded(&packet);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERANIMPLAY_HPP
|
@ -0,0 +1,27 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERBOOK_HPP
|
||||
#define OPENMW_PROCESSORPLAYERBOOK_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerBook : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerBook()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_BOOK)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
DEBUG_PRINTF(strPacketID.c_str());
|
||||
|
||||
packet.Send(true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnPlayerBook")>(player.getId());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERBOOK_HPP
|
@ -0,0 +1,27 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERDISPOSITION_HPP
|
||||
#define OPENMW_PROCESSORPLAYERDISPOSITION_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerDisposition : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerDisposition()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_DISPOSITION)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
DEBUG_PRINTF(strPacketID.c_str());
|
||||
|
||||
packet.Send(true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnPlayerDisposition")>(player.getId());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERDISPOSITION_HPP
|
@ -0,0 +1,27 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERMAP_HPP
|
||||
#define OPENMW_PROCESSORPLAYERMAP_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerMap : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerMap()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_MAP)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
DEBUG_PRINTF(strPacketID.c_str());
|
||||
|
||||
packet.Send(true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnPlayerMap")>(player.getId());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERMAP_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERREGIONCHANGE_HPP
|
||||
#define OPENMW_PROCESSORPLAYERREGIONCHANGE_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerRegionChange : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerRegionChange()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_REGION_CHANGE)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
DEBUG_PRINTF(strPacketID.c_str());
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnPlayerRegionChange")>(player.getId());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERREGIONCHANGE_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERREST_HPP
|
||||
#define OPENMW_PROCESSORPLAYERREST_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerRest : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerRest()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_REST)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
DEBUG_PRINTF(strPacketID.c_str());
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnPlayerRest")>(player.getId());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERREST_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERSPEECH_HPP
|
||||
#define OPENMW_PROCESSORPLAYERSPEECH_HPP
|
||||
|
||||
#include "apps/openmw-mp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerSpeech : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerSpeech()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_SPEECH)
|
||||
}
|
||||
|
||||
void Do(PlayerPacket &packet, Player &player) override
|
||||
{
|
||||
DEBUG_PRINTF(strPacketID.c_str());
|
||||
|
||||
player.sendToLoaded(&packet);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERSPEECH_HPP
|
@ -0,0 +1,36 @@
|
||||
#ifndef OPENMW_PROCESSOROBJECTSPAWN_HPP
|
||||
#define OPENMW_PROCESSOROBJECTSPAWN_HPP
|
||||
|
||||
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||
#include <apps/openmw-mp/Networking.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorObjectSpawn : public WorldProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorObjectSpawn()
|
||||
{
|
||||
BPP_INIT(ID_OBJECT_SPAWN)
|
||||
}
|
||||
|
||||
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
|
||||
|
||||
for (unsigned int i = 0; i < event.worldObjectCount; i++)
|
||||
{
|
||||
event.worldObjects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum();
|
||||
}
|
||||
|
||||
// Send this packet back to the original sender with the mpNum generation from above,
|
||||
// then send it to the other players
|
||||
packet.Send(false);
|
||||
packet.Send(true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnObjectSpawn")>(player.getId(), event.cell.getDescription().c_str());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSOROBJECTSPAWN_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORACTORAI_HPP
|
||||
#define OPENMW_PROCESSORACTORAI_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/ActorProcessor.hpp"
|
||||
#include "apps/openmw/mwmp/Main.hpp"
|
||||
#include "apps/openmw/mwmp/CellController.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorAI : public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorAI()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_AI);
|
||||
}
|
||||
|
||||
virtual void Do(ActorPacket &packet, ActorList &actorList)
|
||||
{
|
||||
//Main::get().getCellController()->readAI(actorList);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORAI_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORACTORDEATH_HPP
|
||||
#define OPENMW_PROCESSORACTORDEATH_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/ActorProcessor.hpp"
|
||||
#include "apps/openmw/mwmp/Main.hpp"
|
||||
#include "apps/openmw/mwmp/CellController.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorDeath : public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorDeath()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_DEATH);
|
||||
}
|
||||
|
||||
virtual void Do(ActorPacket &packet, ActorList &actorList)
|
||||
{
|
||||
//Main::get().getCellController()->readDeath(actorList);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORDEATH_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORGAMEWEATHER_HPP
|
||||
#define OPENMW_PROCESSORGAMEWEATHER_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorGameWeather : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorGameWeather()
|
||||
{
|
||||
BPP_INIT(ID_GAME_WEATHER)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORGAMEWEATHER_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERANIMPLAY_HPP
|
||||
#define OPENMW_PROCESSORPLAYERANIMPLAY_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerAnimPlay : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerAnimPlay()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_ANIM_PLAY)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERANIMPLAY_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERBOOK_HPP
|
||||
#define OPENMW_PROCESSORPLAYERBOOK_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerBook : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerBook()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_BOOK)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERBOOK_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERDISPOSITION_HPP
|
||||
#define OPENMW_PROCESSORPLAYERDISPOSITION_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerDisposition : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerDisposition()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_DISPOSITION)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERDISPOSITION_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERMAP_HPP
|
||||
#define OPENMW_PROCESSORPLAYERMAP_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerMap : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerMap()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_MAP)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERMAP_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERREGIONAUTHORITY_HPP
|
||||
#define OPENMW_PROCESSORPLAYERREGIONAUTHORITY_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerRegionAuthority : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerRegionAuthority()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_REGION_AUTHORITY)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERREGIONAUTHORITY_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERREST_HPP
|
||||
#define OPENMW_PROCESSORPLAYERREST_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerRest : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerRest()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_REST)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERREST_HPP
|
@ -0,0 +1,23 @@
|
||||
#ifndef OPENMW_PROCESSORPLAYERSPEECH_HPP
|
||||
#define OPENMW_PROCESSORPLAYERSPEECH_HPP
|
||||
|
||||
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorPlayerSpeech : public PlayerProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorPlayerSpeech()
|
||||
{
|
||||
BPP_INIT(ID_PLAYER_SPEECH)
|
||||
}
|
||||
|
||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
||||
{
|
||||
// Placeholder to be filled in later
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORPLAYERSPEECH_HPP
|
@ -0,0 +1,26 @@
|
||||
#ifndef OPENMW_PROCESSOROBJECTSPAWN_HPP
|
||||
#define OPENMW_PROCESSOROBJECTSPAWN_HPP
|
||||
|
||||
#include "BaseObjectProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorObjectSpawn : public BaseObjectProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorObjectSpawn()
|
||||
{
|
||||
BPP_INIT(ID_OBJECT_SPAWN)
|
||||
}
|
||||
|
||||
virtual void Do(WorldPacket &packet, WorldEvent &event)
|
||||
{
|
||||
BaseObjectProcessor::Do(packet, event);
|
||||
|
||||
//event.spawnObjects(ptrCellStore);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSOROBJECTSPAWN_HPP
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue