1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 20:19:40 +00:00

[General] Add placeholders for ActorEquipment & PlayerFaction packets

Also reorder packets and packet processors.
This commit is contained in:
David Cernat 2017-05-16 19:25:31 +03:00
parent f527fe9ebe
commit ad388c7e12
17 changed files with 380 additions and 168 deletions

View file

@ -104,9 +104,10 @@ source_group(tes3mp-server FILES ${SERVER} ${SERVER_HEADER})
set(PROCESSORS_ACTOR set(PROCESSORS_ACTOR
processors/actor/ProcessorActorAnimFlags.hpp processors/actor/ProcessorActorAnimPlay.hpp processors/actor/ProcessorActorAnimFlags.hpp processors/actor/ProcessorActorAnimPlay.hpp
processors/actor/ProcessorActorAttack.hpp processors/actor/ProcessorActorAuthority.hpp processors/actor/ProcessorActorAttack.hpp processors/actor/ProcessorActorAuthority.hpp
processors/actor/ProcessorActorCellChange.hpp processors/actor/ProcessorActorList.hpp processors/actor/ProcessorActorCellChange.hpp processors/actor/ProcessorActorEquipment.hpp
processors/actor/ProcessorActorPosition.hpp processors/actor/ProcessorActorSpeech.hpp processors/actor/ProcessorActorList.hpp processors/actor/ProcessorActorPosition.hpp
processors/actor/ProcessorActorStatsDynamic.hpp processors/actor/ProcessorActorTest.hpp processors/actor/ProcessorActorSpeech.hpp processors/actor/ProcessorActorStatsDynamic.hpp
processors/actor/ProcessorActorTest.hpp
) )
source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR}) source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR})
@ -118,10 +119,11 @@ set(PROCESSORS_PLAYER
processors/player/ProcessorPlayerCellChange.hpp processors/player/ProcessorPlayerCellState.hpp processors/player/ProcessorPlayerCellChange.hpp processors/player/ProcessorPlayerCellState.hpp
processors/player/ProcessorPlayerCharClass.hpp processors/player/ProcessorPlayerCharGen.hpp processors/player/ProcessorPlayerCharClass.hpp processors/player/ProcessorPlayerCharGen.hpp
processors/player/ProcessorPlayerDeath.hpp processors/player/ProcessorPlayerEquipment.hpp processors/player/ProcessorPlayerDeath.hpp processors/player/ProcessorPlayerEquipment.hpp
processors/player/ProcessorPlayerInventory.hpp processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerFaction.hpp processors/player/ProcessorPlayerInventory.hpp
processors/player/ProcessorPlayerLevel.hpp processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerLevel.hpp
processors/player/ProcessorPlayerResurrect.hpp processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerResurrect.hpp
processors/player/ProcessorPlayerSpellbook.hpp processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerSpellbook.hpp
processors/player/ProcessorPlayerStatsDynamic.hpp
) )
source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER}) source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER})

View file

@ -5,26 +5,27 @@
#include "ProcessorInitializer.hpp" #include "ProcessorInitializer.hpp"
#include "PlayerProcessor.hpp" #include "PlayerProcessor.hpp"
#include "processors/player/ProcessorPlayerPosition.hpp" #include "processors/player/ProcessorChatMsg.hpp"
#include "processors/player/ProcessorGUIMessageBox.hpp"
#include "processors/player/ProcessorPlayerCharGen.hpp"
#include "processors/player/ProcessorPlayerAnimFlags.hpp"
#include "processors/player/ProcessorPlayerAttack.hpp"
#include "processors/player/ProcessorPlayerAttribute.hpp"
#include "processors/player/ProcessorPlayerBounty.hpp"
#include "processors/player/ProcessorPlayerCellChange.hpp" #include "processors/player/ProcessorPlayerCellChange.hpp"
#include "processors/player/ProcessorPlayerCellState.hpp" #include "processors/player/ProcessorPlayerCellState.hpp"
#include "processors/player/ProcessorPlayerAttribute.hpp"
#include "processors/player/ProcessorPlayerSkill.hpp"
#include "processors/player/ProcessorPlayerLevel.hpp"
#include "processors/player/ProcessorPlayerBounty.hpp"
#include "processors/player/ProcessorPlayerEquipment.hpp"
#include "processors/player/ProcessorPlayerInventory.hpp"
#include "processors/player/ProcessorPlayerSpellbook.hpp"
#include "processors/player/ProcessorPlayerJournal.hpp"
#include "processors/player/ProcessorPlayerAttack.hpp"
#include "processors/player/ProcessorPlayerStatsDynamic.hpp"
#include "processors/player/ProcessorPlayerDeath.hpp"
#include "processors/player/ProcessorPlayerResurrect.hpp"
#include "processors/player/ProcessorPlayerAnimFlags.hpp"
#include "processors/player/ProcessorChatMsg.hpp"
#include "processors/player/ProcessorPlayerCharGen.hpp"
#include "processors/player/ProcessorGUIMessageBox.hpp"
#include "processors/player/ProcessorPlayerCharClass.hpp" #include "processors/player/ProcessorPlayerCharClass.hpp"
#include "processors/player/ProcessorPlayerDeath.hpp"
#include "processors/player/ProcessorPlayerEquipment.hpp"
#include "processors/player/ProcessorPlayerFaction.hpp"
#include "processors/player/ProcessorPlayerInventory.hpp"
#include "processors/player/ProcessorPlayerJournal.hpp"
#include "processors/player/ProcessorPlayerLevel.hpp"
#include "processors/player/ProcessorPlayerPosition.hpp"
#include "processors/player/ProcessorPlayerResurrect.hpp"
#include "processors/player/ProcessorPlayerSkill.hpp"
#include "processors/player/ProcessorPlayerSpellbook.hpp"
#include "processors/player/ProcessorPlayerStatsDynamic.hpp"
#include "ActorProcessor.hpp" #include "ActorProcessor.hpp"
#include "processors/actor/ProcessorActorList.hpp" #include "processors/actor/ProcessorActorList.hpp"
#include "processors/actor/ProcessorActorAuthority.hpp" #include "processors/actor/ProcessorActorAuthority.hpp"
@ -33,6 +34,7 @@
#include "processors/actor/ProcessorActorAnimPlay.hpp" #include "processors/actor/ProcessorActorAnimPlay.hpp"
#include "processors/actor/ProcessorActorAttack.hpp" #include "processors/actor/ProcessorActorAttack.hpp"
#include "processors/actor/ProcessorActorCellChange.hpp" #include "processors/actor/ProcessorActorCellChange.hpp"
#include "processors/actor/ProcessorActorEquipment.hpp"
#include "processors/actor/ProcessorActorStatsDynamic.hpp" #include "processors/actor/ProcessorActorStatsDynamic.hpp"
#include "processors/actor/ProcessorActorPosition.hpp" #include "processors/actor/ProcessorActorPosition.hpp"
#include "processors/actor/ProcessorActorSpeech.hpp" #include "processors/actor/ProcessorActorSpeech.hpp"
@ -59,26 +61,27 @@ using namespace mwmp;
void ProcessorInitializer() void ProcessorInitializer()
{ {
PlayerProcessor::AddProcessor(new ProcessorPlayerPosition()); PlayerProcessor::AddProcessor(new ProcessorChatMsg());
PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttack());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttribute());
PlayerProcessor::AddProcessor(new ProcessorPlayerBounty());
PlayerProcessor::AddProcessor(new ProcessorPlayerCellChange()); PlayerProcessor::AddProcessor(new ProcessorPlayerCellChange());
PlayerProcessor::AddProcessor(new ProcessorPlayerCellState()); PlayerProcessor::AddProcessor(new ProcessorPlayerCellState());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttribute());
PlayerProcessor::AddProcessor(new ProcessorPlayerSkill());
PlayerProcessor::AddProcessor(new ProcessorPlayerLevel());
PlayerProcessor::AddProcessor(new ProcessorPlayerBounty());
PlayerProcessor::AddProcessor(new ProcessorPlayerEquipment());
PlayerProcessor::AddProcessor(new ProcessorPlayerInventory());
PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook());
PlayerProcessor::AddProcessor(new ProcessorPlayerJournal());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttack());
PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic());
PlayerProcessor::AddProcessor(new ProcessorPlayerDeath());
PlayerProcessor::AddProcessor(new ProcessorPlayerResurrect());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags());
PlayerProcessor::AddProcessor(new ProcessorChatMsg());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen());
PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharClass()); PlayerProcessor::AddProcessor(new ProcessorPlayerCharClass());
PlayerProcessor::AddProcessor(new ProcessorPlayerDeath());
PlayerProcessor::AddProcessor(new ProcessorPlayerEquipment());
PlayerProcessor::AddProcessor(new ProcessorPlayerFaction());
PlayerProcessor::AddProcessor(new ProcessorPlayerInventory());
PlayerProcessor::AddProcessor(new ProcessorPlayerJournal());
PlayerProcessor::AddProcessor(new ProcessorPlayerLevel());
PlayerProcessor::AddProcessor(new ProcessorPlayerPosition());
PlayerProcessor::AddProcessor(new ProcessorPlayerResurrect());
PlayerProcessor::AddProcessor(new ProcessorPlayerSkill());
PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook());
PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic());
ActorProcessor::AddProcessor(new ProcessorActorList()); ActorProcessor::AddProcessor(new ProcessorActorList());
ActorProcessor::AddProcessor(new ProcessorActorAuthority()); ActorProcessor::AddProcessor(new ProcessorActorAuthority());
@ -86,9 +89,10 @@ void ProcessorInitializer()
ActorProcessor::AddProcessor(new ProcessorActorAnimPlay()); ActorProcessor::AddProcessor(new ProcessorActorAnimPlay());
ActorProcessor::AddProcessor(new ProcessorActorAttack()); ActorProcessor::AddProcessor(new ProcessorActorAttack());
ActorProcessor::AddProcessor(new ProcessorActorCellChange()); ActorProcessor::AddProcessor(new ProcessorActorCellChange());
ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic()); ActorProcessor::AddProcessor(new ProcessorActorEquipment());
ActorProcessor::AddProcessor(new ProcessorActorPosition()); ActorProcessor::AddProcessor(new ProcessorActorPosition());
ActorProcessor::AddProcessor(new ProcessorActorSpeech()); ActorProcessor::AddProcessor(new ProcessorActorSpeech());
ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic());
ActorProcessor::AddProcessor(new ProcessorActorTest()); ActorProcessor::AddProcessor(new ProcessorActorTest());
WorldProcessor::AddProcessor(new ProcessorContainer()); WorldProcessor::AddProcessor(new ProcessorContainer());

View file

@ -126,8 +126,9 @@ public:
{"OnPlayerBountyChange", Function<void, unsigned short>()}, {"OnPlayerBountyChange", Function<void, unsigned short>()},
{"OnPlayerEquipmentChange", Function<void, unsigned short>()}, {"OnPlayerEquipmentChange", Function<void, unsigned short>()},
{"OnPlayerInventoryChange", Function<void, unsigned short>()}, {"OnPlayerInventoryChange", Function<void, unsigned short>()},
{"OnPlayerSpellbookChange", Function<void, unsigned short>()},
{"OnPlayerJournalChange", Function<void, unsigned short>()}, {"OnPlayerJournalChange", Function<void, unsigned short>()},
{"OnPlayerFactionChange", Function<void, unsigned short>()},
{"OnPlayerSpellbookChange", Function<void, unsigned short>()},
{"OnCellLoad", Function<void, unsigned short, const char*>()}, {"OnCellLoad", Function<void, unsigned short, const char*>()},
{"OnCellUnload", Function<void, unsigned short, const char*>()}, {"OnCellUnload", Function<void, unsigned short, const char*>()},
{"OnCellDeletion", Function<void, const char*>()}, {"OnCellDeletion", Function<void, const char*>()},

View file

@ -0,0 +1,27 @@
#ifndef OPENMW_PROCESSORACTOREQUIPMENT_HPP
#define OPENMW_PROCESSORACTOREQUIPMENT_HPP
#include "apps/openmw-mp/ActorProcessor.hpp"
namespace mwmp
{
class ProcessorActorEquipment : public ActorProcessor
{
public:
ProcessorActorEquipment()
{
BPP_INIT(ID_ACTOR_EQUIPMENT)
}
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->sendToLoaded(&packet, &actorList);
}
};
}
#endif //OPENMW_PROCESSORACTOREQUIPMENT_HPP

View file

@ -0,0 +1,26 @@
#ifndef OPENMW_PROCESSORPLAYERFACTION_HPP
#define OPENMW_PROCESSORPLAYERFACTION_HPP
#include "apps/openmw-mp/PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerFaction : public PlayerProcessor
{
public:
ProcessorPlayerFaction()
{
BPP_INIT(ID_PLAYER_FACTION)
}
void Do(PlayerPacket &packet, Player &player) override
{
DEBUG_PRINTF(strPacketID.c_str());
Script::Call<Script::CallbackIdentity("OnPlayerFactionChange")>(player.getId());
}
};
}
#endif //OPENMW_PROCESSORPLAYERFACTION_HPP

View file

@ -97,27 +97,28 @@ add_openmw_dir (mwbase
) )
add_openmw_dir (mwmp Main Networking LocalPlayer DedicatedPlayer PlayerList LocalActor DedicatedActor ActorList WorldEvent add_openmw_dir (mwmp Main Networking LocalPlayer DedicatedPlayer PlayerList LocalActor DedicatedActor ActorList WorldEvent
Cell CellController MechanicsHelper GUIChat GUILogin GUIController PlayerMarkerCollection GUIDialogList Cell CellController MechanicsHelper GUIChat GUILogin GUIController PlayerMarkerCollection GUIDialogList
BaseClientPacketProcessor PlayerProcessor WorldProcessor ActorProcessor ProcessorInitializer) BaseClientPacketProcessor PlayerProcessor WorldProcessor ActorProcessor ProcessorInitializer
)
add_openmw_dir (mwmp\\processors\\actor ProcessorActorAnimFlags ProcessorActorAnimPlay ProcessorActorAttack add_openmw_dir (mwmp\\processors\\actor ProcessorActorAnimFlags ProcessorActorAnimPlay ProcessorActorAttack
ProcessorActorAuthority ProcessorActorCellChange ProcessorActorList ProcessorActorPosition ProcessorActorSpeech ProcessorActorAuthority ProcessorActorCellChange ProcessorActorEquipment ProcessorActorList ProcessorActorPosition
ProcessorActorStatsDynamic ProcessorActorTest ProcessorActorSpeech ProcessorActorStatsDynamic ProcessorActorTest
) )
add_openmw_dir (mwmp\\processors\\player ProcessorChatMessage ProcessorGameConsole ProcessorGameTime ProcessorGUIMessageBox add_openmw_dir (mwmp\\processors\\player ProcessorChatMessage ProcessorGameConsole ProcessorGameTime ProcessorGUIMessageBox
ProcessorHandshake ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo ProcessorPlayerBounty ProcessorHandshake ProcessorUserDisconnected ProcessorUserMyID ProcessorPlayerBaseInfo
ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerAnimFlags ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBounty ProcessorPlayerCellChange
ProcessorPlayerAnimFlags ProcessorPlayerStatsDynamic ProcessorPlayerEquipment ProcessorPlayerInventory ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerEquipment
ProcessorPlayerJournal ProcessorPlayerLevel ProcessorPlayerPosition ProcessorPlayerResurrect ProcessorPlayerSkill ProcessorPlayerInventory ProcessorPlayerJournal ProcessorPlayerLevel ProcessorPlayerPosition ProcessorPlayerResurrect
ProcessorPlayerSpellbook ProcessorUserDisconnected ProcessorUserMyID ProcessorPlayerSkill ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic
) )
add_openmw_dir (mwmp\\processors\\world BaseObjectProcessor ProcessorContainer ProcessorDoorState ProcessorMusicPlay add_openmw_dir (mwmp\\processors\\world BaseObjectProcessor ProcessorContainer ProcessorDoorState ProcessorMusicPlay
ProcessorObjectAnimPlay ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace ProcessorObjectAnimPlay ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace
ProcessorObjectRotate ProcessorObjectScale ProcessorObjectUnlock ProcessorScriptGlobalShort ProcessorScriptLocalFloat ProcessorObjectRotate ProcessorObjectScale ProcessorObjectUnlock ProcessorScriptGlobalShort ProcessorScriptLocalFloat
ProcessorScriptLocalShort ProcessorScriptMemberShort ProcessorVideoPlay ProcessorScriptLocalShort ProcessorScriptMemberShort ProcessorVideoPlay
) )
# Main executable # Main executable

View file

@ -5,32 +5,33 @@
#include "ProcessorInitializer.hpp" #include "ProcessorInitializer.hpp"
#include "PlayerProcessor.hpp" #include "PlayerProcessor.hpp"
#include "processors/player/ProcessorPlayerPosition.hpp"
#include "processors/player/ProcessorPlayerCellChange.hpp"
#include "processors/player/ProcessorPlayerCellState.hpp"
#include "processors/player/ProcessorPlayerAttribute.hpp"
#include "processors/player/ProcessorPlayerSkill.hpp"
#include "processors/player/ProcessorPlayerLevel.hpp"
#include "processors/player/ProcessorPlayerBounty.hpp"
#include "processors/player/ProcessorPlayerEquipment.hpp"
#include "processors/player/ProcessorPlayerInventory.hpp"
#include "processors/player/ProcessorPlayerSpellbook.hpp"
#include "processors/player/ProcessorPlayerJournal.hpp"
#include "processors/player/ProcessorPlayerAttack.hpp"
#include "processors/player/ProcessorPlayerStatsDynamic.hpp"
#include "processors/player/ProcessorPlayerDeath.hpp"
#include "processors/player/ProcessorPlayerResurrect.hpp"
#include "processors/player/ProcessorPlayerAnimFlags.hpp"
#include "processors/player/ProcessorChatMessage.hpp" #include "processors/player/ProcessorChatMessage.hpp"
#include "processors/player/ProcessorGameConsole.hpp" #include "processors/player/ProcessorGameConsole.hpp"
#include "processors/player/ProcessorGameTime.hpp" #include "processors/player/ProcessorGameTime.hpp"
#include "processors/player/ProcessorPlayerCharGen.hpp"
#include "processors/player/ProcessorGUIMessageBox.hpp" #include "processors/player/ProcessorGUIMessageBox.hpp"
#include "processors/player/ProcessorPlayerCharClass.hpp"
#include "processors/player/ProcessorHandshake.hpp" #include "processors/player/ProcessorHandshake.hpp"
#include "processors/player/ProcessorPlayerBaseInfo.hpp"
#include "processors/player/ProcessorUserDisconnected.hpp" #include "processors/player/ProcessorUserDisconnected.hpp"
#include "processors/player/ProcessorUserMyID.hpp" #include "processors/player/ProcessorUserMyID.hpp"
#include "processors/player/ProcessorPlayerBaseInfo.hpp"
#include "processors/player/ProcessorPlayerCharGen.hpp"
#include "processors/player/ProcessorPlayerAnimFlags.hpp"
#include "processors/player/ProcessorPlayerAttack.hpp"
#include "processors/player/ProcessorPlayerAttribute.hpp"
#include "processors/player/ProcessorPlayerBounty.hpp"
#include "processors/player/ProcessorPlayerCellChange.hpp"
#include "processors/player/ProcessorPlayerCellState.hpp"
#include "processors/player/ProcessorPlayerCharClass.hpp"
#include "processors/player/ProcessorPlayerDeath.hpp"
#include "processors/player/ProcessorPlayerEquipment.hpp"
#include "processors/player/ProcessorPlayerInventory.hpp"
#include "processors/player/ProcessorPlayerJournal.hpp"
#include "processors/player/ProcessorPlayerLevel.hpp"
#include "processors/player/ProcessorPlayerPosition.hpp"
#include "processors/player/ProcessorPlayerResurrect.hpp"
#include "processors/player/ProcessorPlayerSkill.hpp"
#include "processors/player/ProcessorPlayerSpellbook.hpp"
#include "processors/player/ProcessorPlayerStatsDynamic.hpp"
#include "WorldProcessor.hpp" #include "WorldProcessor.hpp"
#include "processors/world/ProcessorContainer.hpp" #include "processors/world/ProcessorContainer.hpp"
@ -55,6 +56,7 @@
#include "processors/actor/ProcessorActorAttack.hpp" #include "processors/actor/ProcessorActorAttack.hpp"
#include "processors/actor/ProcessorActorAuthority.hpp" #include "processors/actor/ProcessorActorAuthority.hpp"
#include "processors/actor/ProcessorActorCellChange.hpp" #include "processors/actor/ProcessorActorCellChange.hpp"
#include "processors/actor/ProcessorActorEquipment.hpp"
#include "processors/actor/ProcessorActorList.hpp" #include "processors/actor/ProcessorActorList.hpp"
#include "processors/actor/ProcessorActorPosition.hpp" #include "processors/actor/ProcessorActorPosition.hpp"
#include "processors/actor/ProcessorActorSpeech.hpp" #include "processors/actor/ProcessorActorSpeech.hpp"
@ -65,32 +67,33 @@ using namespace mwmp;
void ProcessorInitializer() void ProcessorInitializer()
{ {
PlayerProcessor::AddProcessor(new ProcessorPlayerPosition());
PlayerProcessor::AddProcessor(new ProcessorPlayerCellChange());
PlayerProcessor::AddProcessor(new ProcessorPlayerCellState());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttribute());
PlayerProcessor::AddProcessor(new ProcessorPlayerSkill());
PlayerProcessor::AddProcessor(new ProcessorPlayerLevel());
PlayerProcessor::AddProcessor(new ProcessorPlayerBounty());
PlayerProcessor::AddProcessor(new ProcessorPlayerEquipment());
PlayerProcessor::AddProcessor(new ProcessorPlayerInventory());
PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook());
PlayerProcessor::AddProcessor(new ProcessorPlayerJournal());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttack());
PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic());
PlayerProcessor::AddProcessor(new ProcessorPlayerDeath());
PlayerProcessor::AddProcessor(new ProcessorPlayerResurrect());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags());
PlayerProcessor::AddProcessor(new ProcessorChatMessage()); PlayerProcessor::AddProcessor(new ProcessorChatMessage());
PlayerProcessor::AddProcessor(new ProcessorGameConsole()); PlayerProcessor::AddProcessor(new ProcessorGameConsole());
PlayerProcessor::AddProcessor(new ProcessorGameTime()); PlayerProcessor::AddProcessor(new ProcessorGameTime());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen());
PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox()); PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharClass());
PlayerProcessor::AddProcessor(new ProcessorHandshake()); PlayerProcessor::AddProcessor(new ProcessorHandshake());
PlayerProcessor::AddProcessor(new ProcessorPlayerBaseInfo());
PlayerProcessor::AddProcessor(new ProcessorUserDisconnected()); PlayerProcessor::AddProcessor(new ProcessorUserDisconnected());
PlayerProcessor::AddProcessor(new ProcessorUserMyID()); PlayerProcessor::AddProcessor(new ProcessorUserMyID());
PlayerProcessor::AddProcessor(new ProcessorPlayerBaseInfo());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttack());
PlayerProcessor::AddProcessor(new ProcessorPlayerAttribute());
PlayerProcessor::AddProcessor(new ProcessorPlayerBounty());
PlayerProcessor::AddProcessor(new ProcessorPlayerCellChange());
PlayerProcessor::AddProcessor(new ProcessorPlayerCellState());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharClass());
PlayerProcessor::AddProcessor(new ProcessorPlayerDeath());
PlayerProcessor::AddProcessor(new ProcessorPlayerEquipment());
PlayerProcessor::AddProcessor(new ProcessorPlayerFaction());
PlayerProcessor::AddProcessor(new ProcessorPlayerInventory());
PlayerProcessor::AddProcessor(new ProcessorPlayerJournal());
PlayerProcessor::AddProcessor(new ProcessorPlayerLevel());
PlayerProcessor::AddProcessor(new ProcessorPlayerPosition());
PlayerProcessor::AddProcessor(new ProcessorPlayerResurrect());
PlayerProcessor::AddProcessor(new ProcessorPlayerSkill());
PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook());
PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic());
WorldProcessor::AddProcessor(new ProcessorContainer()); WorldProcessor::AddProcessor(new ProcessorContainer());
WorldProcessor::AddProcessor(new ProcessorDoorState()); WorldProcessor::AddProcessor(new ProcessorDoorState());
@ -114,6 +117,7 @@ void ProcessorInitializer()
ActorProcessor::AddProcessor(new ProcessorActorAttack()); ActorProcessor::AddProcessor(new ProcessorActorAttack());
ActorProcessor::AddProcessor(new ProcessorActorAuthority()); ActorProcessor::AddProcessor(new ProcessorActorAuthority());
ActorProcessor::AddProcessor(new ProcessorActorCellChange()); ActorProcessor::AddProcessor(new ProcessorActorCellChange());
ActorProcessor::AddProcessor(new ProcessorActorEquipment());
ActorProcessor::AddProcessor(new ProcessorActorList()); ActorProcessor::AddProcessor(new ProcessorActorList());
ActorProcessor::AddProcessor(new ProcessorActorPosition()); ActorProcessor::AddProcessor(new ProcessorActorPosition());
ActorProcessor::AddProcessor(new ProcessorActorSpeech()); ActorProcessor::AddProcessor(new ProcessorActorSpeech());

View file

@ -0,0 +1,26 @@
#ifndef OPENMW_PROCESSORACTOREQUIPMENT_HPP
#define OPENMW_PROCESSORACTOREQUIPMENT_HPP
#include "apps/openmw/mwmp/ActorProcessor.hpp"
#include "apps/openmw/mwmp/Main.hpp"
#include "apps/openmw/mwmp/CellController.hpp"
namespace mwmp
{
class ProcessorActorEquipment : public ActorProcessor
{
public:
ProcessorActorEquipment()
{
BPP_INIT(ID_ACTOR_EQUIPMENT);
}
virtual void Do(ActorPacket &packet, ActorList &actorList)
{
}
};
}
#endif //OPENMW_PROCESSORACTOREQUIPMENT_HPP

View file

@ -0,0 +1,25 @@
#ifndef OPENMW_PROCESSORPLAYERFACTION_HPP
#define OPENMW_PROCESSORPLAYERFACTION_HPP
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerFaction : public PlayerProcessor
{
public:
ProcessorPlayerFaction()
{
BPP_INIT(ID_PLAYER_FACTION)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (!isLocal()) return;
}
};
}
#endif //OPENMW_PROCESSORPLAYERFACTION_HPP

View file

@ -170,16 +170,16 @@ add_component_dir (openmw-mp\\Packets
add_component_dir (openmw-mp\\Packets\\Actor add_component_dir (openmw-mp\\Packets\\Actor
ActorPacket ActorPacket
PacketActorList PacketActorAuthority PacketActorTest PacketActorAnimPlay PacketActorAttack PacketActorCellChange PacketActorList PacketActorAuthority PacketActorTest PacketActorAnimPlay PacketActorAttack PacketActorCellChange
PacketActorAnimFlags PacketActorStatsDynamic PacketActorPosition PacketActorSpeech PacketActorAnimFlags PacketActorEquipment PacketActorPosition PacketActorSpeech PacketActorStatsDynamic
) )
add_component_dir (openmw-mp\\Packets\\Player add_component_dir (openmw-mp\\Packets\\Player
PlayerPacket PlayerPacket
PacketHandshake PacketChatMessage PacketPlayerBaseInfo PacketPlayerPosition PacketPlayerEquipment PacketHandshake PacketChatMessage PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerAnimFlags PacketPlayerAttack
PacketPlayerAttack PacketPlayerStatsDynamic PacketPlayerAnimFlags PacketPlayerCharGen PacketPlayerAttribute PacketPlayerAttribute PacketPlayerBounty PacketPlayerCellChange PacketPlayerCellState PacketPlayerClass
PacketPlayerSkill PacketPlayerLevel PacketPlayerBounty PacketPlayerClass PacketPlayerInventory PacketPlayerDeath PacketPlayerEquipment PacketPlayerFaction PacketPlayerInventory PacketPlayerJournal PacketPlayerLevel
PacketPlayerSpellbook PacketPlayerJournal PacketPlayerActiveSkills PacketPlayerCellChange PacketPlayerCellState PacketPlayerPosition PacketPlayerResurrect PacketPlayerSkill PacketPlayerSpellbook PacketPlayerStatsDynamic
PacketPlayerDeath PacketPlayerResurrect PacketGUIBoxes PacketTime PacketPlayerActiveSkills PacketGUIBoxes PacketTime
) )
add_component_dir (openmw-mp\\Packets\\World add_component_dir (openmw-mp\\Packets\\World

View file

@ -9,8 +9,9 @@
#include "../Packets/Actor/PacketActorAnimPlay.hpp" #include "../Packets/Actor/PacketActorAnimPlay.hpp"
#include "../Packets/Actor/PacketActorAttack.hpp" #include "../Packets/Actor/PacketActorAttack.hpp"
#include "../Packets/Actor/PacketActorCellChange.hpp" #include "../Packets/Actor/PacketActorCellChange.hpp"
#include "../Packets/Actor/PacketActorStatsDynamic.hpp" #include "../Packets/Actor/PacketActorEquipment.hpp"
#include "../Packets/Actor/PacketActorPosition.hpp" #include "../Packets/Actor/PacketActorPosition.hpp"
#include "../Packets/Actor/PacketActorStatsDynamic.hpp"
#include "../Packets/Actor/PacketActorSpeech.hpp" #include "../Packets/Actor/PacketActorSpeech.hpp"
@ -33,9 +34,10 @@ mwmp::ActorPacketController::ActorPacketController(RakNet::RakPeerInterface *pee
AddPacket<PacketActorAnimPlay>(&packets, peer); AddPacket<PacketActorAnimPlay>(&packets, peer);
AddPacket<PacketActorAttack>(&packets, peer); AddPacket<PacketActorAttack>(&packets, peer);
AddPacket<PacketActorCellChange>(&packets, peer); AddPacket<PacketActorCellChange>(&packets, peer);
AddPacket<PacketActorStatsDynamic>(&packets, peer); AddPacket<PacketActorEquipment>(&packets, peer);
AddPacket<PacketActorPosition>(&packets, peer); AddPacket<PacketActorPosition>(&packets, peer);
AddPacket<PacketActorSpeech>(&packets, peer); AddPacket<PacketActorSpeech>(&packets, peer);
AddPacket<PacketActorStatsDynamic>(&packets, peer);
} }

View file

@ -2,34 +2,35 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include "../Packets/Player/PacketPlayerClass.hpp"
#include "../Packets/Player/PacketPlayerPosition.hpp"
#include "../Packets/Player/PacketPlayerCellChange.hpp"
#include "../Packets/Player/PacketPlayerCellState.hpp"
#include "../Packets/Player/PacketPlayerBaseInfo.hpp"
#include "../Packets/Player/PacketPlayerEquipment.hpp"
#include "../Packets/Player/PacketPlayerAttack.hpp"
#include "../Packets/Player/PacketPlayerStatsDynamic.hpp"
#include "../Packets/Player/PacketPlayerResurrect.hpp"
#include "../Packets/Player/PacketPlayerDeath.hpp"
#include "../Packets/Player/PacketSendMyID.hpp" #include "../Packets/Player/PacketSendMyID.hpp"
#include "../Packets/Player/PacketDisconnect.hpp" #include "../Packets/Player/PacketDisconnect.hpp"
#include "../Packets/Player/PacketPlayerAnimFlags.hpp"
#include "../Packets/Player/PacketChatMessage.hpp" #include "../Packets/Player/PacketChatMessage.hpp"
#include "../Packets/Player/PacketPlayerCharGen.hpp" #include "../Packets/Player/PacketPlayerCharGen.hpp"
#include "../Packets/Player/PacketPlayerAttribute.hpp"
#include "../Packets/Player/PacketPlayerSkill.hpp"
#include "../Packets/Player/PacketPlayerLevel.hpp"
#include "../Packets/Player/PacketPlayerBounty.hpp"
#include "../Packets/Player/PacketHandshake.hpp" #include "../Packets/Player/PacketHandshake.hpp"
#include "../Packets/Player/PacketGUIBoxes.hpp" #include "../Packets/Player/PacketGUIBoxes.hpp"
#include "../Packets/Player/PacketTime.hpp" #include "../Packets/Player/PacketTime.hpp"
#include "../Packets/Player/PacketLoaded.hpp" #include "../Packets/Player/PacketLoaded.hpp"
#include "../Packets/Player/PacketPlayerInventory.hpp"
#include "../Packets/Player/PacketPlayerSpellbook.hpp"
#include "../Packets/Player/PacketPlayerJournal.hpp"
#include "../Packets/Player/PacketConsole.hpp" #include "../Packets/Player/PacketConsole.hpp"
#include "../Packets/Player/PacketPlayerActiveSkills.hpp" #include "../Packets/Player/PacketPlayerActiveSkills.hpp"
#include "../Packets/Player/PacketPlayerBaseInfo.hpp"
#include "../Packets/Player/PacketPlayerAnimFlags.hpp"
#include "../Packets/Player/PacketPlayerAttack.hpp"
#include "../Packets/Player/PacketPlayerAttribute.hpp"
#include "../Packets/Player/PacketPlayerBounty.hpp"
#include "../Packets/Player/PacketPlayerCellChange.hpp"
#include "../Packets/Player/PacketPlayerCellState.hpp"
#include "../Packets/Player/PacketPlayerClass.hpp"
#include "../Packets/Player/PacketPlayerDeath.hpp"
#include "../Packets/Player/PacketPlayerEquipment.hpp"
#include "../Packets/Player/PacketPlayerFaction.hpp"
#include "../Packets/Player/PacketPlayerInventory.hpp"
#include "../Packets/Player/PacketPlayerJournal.hpp"
#include "../Packets/Player/PacketPlayerLevel.hpp"
#include "../Packets/Player/PacketPlayerPosition.hpp"
#include "../Packets/Player/PacketPlayerResurrect.hpp"
#include "../Packets/Player/PacketPlayerSkill.hpp"
#include "../Packets/Player/PacketPlayerSpellbook.hpp"
#include "../Packets/Player/PacketPlayerStatsDynamic.hpp"
#include "PlayerPacketController.hpp" #include "PlayerPacketController.hpp"
@ -43,41 +44,36 @@ inline void AddPacket(mwmp::PlayerPacketController::packets_t *packets, RakNet::
mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *peer) mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *peer)
{ {
AddPacket<PacketPlayerPosition>(&packets, peer);
AddPacket<PacketPlayerCellChange>(&packets, peer);
AddPacket<PacketPlayerCellState>(&packets, peer);
AddPacket<PacketPlayerBaseInfo>(&packets, peer);
AddPacket<PacketPlayerEquipment>(&packets, peer);
AddPacket<PacketPlayerAttack>(&packets, peer);
AddPacket<PacketPlayerStatsDynamic>(&packets, peer);
AddPacket<PacketPlayerResurrect>(&packets, peer);
AddPacket<PacketPlayerDeath>(&packets, peer);
AddPacket<PacketPlayerAnimFlags>(&packets, peer);
AddPacket<PacketSendMyID>(&packets, peer); AddPacket<PacketSendMyID>(&packets, peer);
AddPacket<PacketDisconnect>(&packets, peer); AddPacket<PacketDisconnect>(&packets, peer);
AddPacket<PacketChatMessage>(&packets, peer); AddPacket<PacketChatMessage>(&packets, peer);
AddPacket<PacketPlayerCharGen>(&packets, peer);
AddPacket<PacketPlayerAttribute>(&packets, peer);
AddPacket<PacketPlayerSkill>(&packets, peer);
AddPacket<PacketPlayerLevel>(&packets, peer);
AddPacket<PacketPlayerBounty>(&packets, peer);
AddPacket<PacketHandshake>(&packets, peer); AddPacket<PacketHandshake>(&packets, peer);
AddPacket<PacketGUIBoxes>(&packets, peer); AddPacket<PacketGUIBoxes>(&packets, peer);
AddPacket<PacketPlayerClass>(&packets, peer);
AddPacket<PacketTime>(&packets, peer); AddPacket<PacketTime>(&packets, peer);
AddPacket<PacketLoaded>(&packets, peer); AddPacket<PacketLoaded>(&packets, peer);
AddPacket<PacketPlayerInventory>(&packets, peer); AddPacket<PacketConsole>(&packets, peer);
AddPacket<PacketPlayerSpellbook>(&packets, peer);
AddPacket<PacketPlayerJournal>(&packets, peer);
AddPacket<PacketPlayerActiveSkills>(&packets, peer); AddPacket<PacketPlayerActiveSkills>(&packets, peer);
AddPacket<PacketConsole>(&packets, peer); AddPacket<PacketPlayerBaseInfo>(&packets, peer);
AddPacket<PacketPlayerCharGen>(&packets, peer);
AddPacket<PacketPlayerAnimFlags>(&packets, peer);
AddPacket<PacketPlayerAttack>(&packets, peer);
AddPacket<PacketPlayerAttribute>(&packets, peer);
AddPacket<PacketPlayerBounty>(&packets, peer);
AddPacket<PacketPlayerCellChange>(&packets, peer);
AddPacket<PacketPlayerCellState>(&packets, peer);
AddPacket<PacketPlayerClass>(&packets, peer);
AddPacket<PacketPlayerDeath>(&packets, peer);
AddPacket<PacketPlayerEquipment>(&packets, peer);
AddPacket<PacketPlayerFaction>(&packets, peer);
AddPacket<PacketPlayerInventory>(&packets, peer);
AddPacket<PacketPlayerJournal>(&packets, peer);
AddPacket<PacketPlayerLevel>(&packets, peer);
AddPacket<PacketPlayerPosition>(&packets, peer);
AddPacket<PacketPlayerResurrect>(&packets, peer);
AddPacket<PacketPlayerSkill>(&packets, peer);
AddPacket<PacketPlayerSpellbook>(&packets, peer);
AddPacket<PacketPlayerStatsDynamic>(&packets, peer);
} }

View file

@ -10,46 +10,48 @@
enum GameMessages enum GameMessages
{ {
_ID_UNUSED = ID_USER_PACKET_ENUM+1, _ID_UNUSED = ID_USER_PACKET_ENUM+1,
ID_PLAYER_BASEINFO,
ID_PLAYER_CHARGEN,
ID_PLAYER_POSITION,
ID_PLAYER_STATS_DYNAMIC,
ID_PLAYER_ATTACK,
ID_USER_MYID, ID_USER_MYID,
ID_PLAYER_EQUIPMENT,
ID_USER_DISCONNECTED, ID_USER_DISCONNECTED,
ID_PLAYER_DEATH,
ID_PLAYER_RESURRECT,
ID_CHAT_MESSAGE, ID_CHAT_MESSAGE,
ID_PLAYER_ANIM_FLAGS,
ID_PLAYER_ATTRIBUTE,
ID_PLAYER_SKILL,
ID_PLAYER_LEVEL,
ID_PLAYER_BOUNTY,
ID_PLAYER_CHARCLASS,
ID_HANDSHAKE, ID_HANDSHAKE,
ID_LOADED, ID_LOADED,
ID_GUI_MESSAGEBOX, ID_GUI_MESSAGEBOX,
ID_GAME_TIME, ID_GAME_TIME,
ID_PLAYER_INVENTORY,
ID_PLAYER_SPELLBOOK, ID_PLAYER_BASEINFO,
ID_PLAYER_JOURNAL, ID_PLAYER_CHARGEN,
ID_PLAYER_ACTIVESKILLS, ID_PLAYER_ACTIVESKILLS,
ID_PLAYER_ANIM_FLAGS,
ID_PLAYER_ATTACK,
ID_PLAYER_ATTRIBUTE,
ID_PLAYER_BOUNTY,
ID_PLAYER_CELL_CHANGE, ID_PLAYER_CELL_CHANGE,
ID_PLAYER_CELL_STATE, ID_PLAYER_CELL_STATE,
ID_PLAYER_CHARCLASS,
ID_PLAYER_DEATH,
ID_PLAYER_EQUIPMENT,
ID_PLAYER_FACTION,
ID_PLAYER_INVENTORY,
ID_PLAYER_JOURNAL,
ID_PLAYER_LEVEL,
ID_PLAYER_POSITION,
ID_PLAYER_RESURRECT,
ID_PLAYER_SKILL,
ID_PLAYER_SPELLBOOK,
ID_PLAYER_STATS_DYNAMIC,
ID_ACTOR_LIST, ID_ACTOR_LIST,
ID_ACTOR_AUTHORITY, ID_ACTOR_AUTHORITY,
ID_ACTOR_TEST, ID_ACTOR_TEST,
ID_ACTOR_ANIM_FLAGS,
ID_ACTOR_ANIM_PLAY, ID_ACTOR_ANIM_PLAY,
ID_ACTOR_ATTACK, ID_ACTOR_ATTACK,
ID_ACTOR_CELL_CHANGE, ID_ACTOR_CELL_CHANGE,
ID_ACTOR_ANIM_FLAGS, ID_ACTOR_EQUIPMENT,
ID_ACTOR_STATS_DYNAMIC,
ID_ACTOR_POSITION, ID_ACTOR_POSITION,
ID_ACTOR_SPEECH, ID_ACTOR_SPEECH,
ID_ACTOR_STATS_DYNAMIC,
ID_OBJECT_PLACE, ID_OBJECT_PLACE,
ID_OBJECT_DELETE, ID_OBJECT_DELETE,

View file

@ -0,0 +1,46 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>
#include "PacketActorEquipment.hpp"
using namespace mwmp;
PacketActorEquipment::PacketActorEquipment(RakNet::RakPeerInterface *peer) : ActorPacket(peer)
{
packetID = ID_ACTOR_EQUIPMENT;
}
void PacketActorEquipment::Packet(RakNet::BitStream *bs, bool send)
{
ActorPacket::Packet(bs, send);
if (!send)
actorList->baseActors.clear();
else
actorList->count = (unsigned int)(actorList->baseActors.size());
RW(actorList->count, send);
RW(actorList->cell.mData.mFlags, send);
RW(actorList->cell.mData.mX, send);
RW(actorList->cell.mData.mY, send);
RW(actorList->cell.mName, send);
BaseActor actor;
for (unsigned int i = 0; i < actorList->count; i++)
{
if (send)
{
actor = actorList->baseActors.at(i);
}
RW(actor.refId, send);
RW(actor.refNumIndex, send);
RW(actor.mpNum, send);
if (!send)
{
actorList->baseActors.push_back(actor);
}
}
}

View file

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETACTOREQUIPMENT_HPP
#define OPENMW_PACKETACTOREQUIPMENT_HPP
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
namespace mwmp
{
class PacketActorEquipment : public ActorPacket
{
public:
PacketActorEquipment(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send);
};
}
#endif //OPENMW_PACKETACTOREQUIPMENT_HPP

View file

@ -0,0 +1,15 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketPlayerFaction.hpp"
using namespace std;
using namespace mwmp;
PacketPlayerFaction::PacketPlayerFaction(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_PLAYER_FACTION;
}
void PacketPlayerFaction::Packet(RakNet::BitStream *bs, bool send)
{
PlayerPacket::Packet(bs, send);
}

View file

@ -0,0 +1,18 @@
#ifndef OPENMW_PACKETPLAYERFACTION_HPP
#define OPENMW_PACKETPLAYERFACTION_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerFaction : public PlayerPacket
{
public:
PacketPlayerFaction(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send);
};
}
#endif //OPENMW_PACKETPLAYERFACTION_HPP