diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 731ed9c93..261d65fec 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -119,16 +119,17 @@ add_openmw_dir (mwmp/processors/player ProcessorChatMessage ProcessorGUIMessageB ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment ProcessorPlayerFaction ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal ProcessorPlayerKillCount ProcessorPlayerLevel - ProcessorPlayerMap ProcessorPlayerMiscellaneous ProcessorPlayerPosition ProcessorPlayerQuickKeys + ProcessorPlayerMap ProcessorPlayerMiscellaneous ProcessorPlayerMomentum ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerReputation ProcessorPlayerResurrect ProcessorPlayerShapeshift ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic ) add_openmw_dir (mwmp/processors/world BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer ProcessorDoorState - ProcessorMusicPlay ProcessorVideoPlay ProcessorObjectAnimPlay ProcessorObjectDelete ProcessorObjectLock - ProcessorObjectMove ProcessorObjectPlace ProcessorObjectReset ProcessorObjectRotate ProcessorObjectScale - ProcessorObjectSpawn ProcessorObjectState ProcessorObjectTrap ProcessorScriptLocalShort ProcessorScriptLocalFloat - ProcessorScriptMemberShort ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat + ProcessorMusicPlay ProcessorVideoPlay ProcessorObjectAnimPlay ProcessorObjectAttach ProcessorObjectCollision + ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace ProcessorObjectReset + ProcessorObjectRotate ProcessorObjectScale ProcessorObjectSpawn ProcessorObjectState ProcessorObjectTrap + ProcessorScriptLocalShort ProcessorScriptLocalFloat ProcessorScriptMemberShort ProcessorScriptMemberFloat + ProcessorScriptGlobalShort ProcessorScriptGlobalFloat ) # Main executable diff --git a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp index 3cc12a2a5..9117fbab6 100644 --- a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp @@ -40,6 +40,7 @@ #include "player/ProcessorPlayerLevel.hpp" #include "player/ProcessorPlayerMap.hpp" #include "player/ProcessorPlayerMiscellaneous.hpp" +#include "player/ProcessorPlayerMomentum.hpp" #include "player/ProcessorPlayerPosition.hpp" #include "player/ProcessorPlayerQuickKeys.hpp" #include "player/ProcessorPlayerRegionAuthority.hpp" @@ -60,6 +61,8 @@ #include "world/ProcessorDoorState.hpp" #include "world/ProcessorMusicPlay.hpp" #include "world/ProcessorObjectAnimPlay.hpp" +#include "world/ProcessorObjectAttach.hpp" +#include "world/ProcessorObjectCollision.hpp" #include "world/ProcessorObjectDelete.hpp" #include "world/ProcessorObjectLock.hpp" #include "world/ProcessorObjectMove.hpp" @@ -131,6 +134,7 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorPlayerLevel()); PlayerProcessor::AddProcessor(new ProcessorPlayerMap()); PlayerProcessor::AddProcessor(new ProcessorPlayerMiscellaneous()); + PlayerProcessor::AddProcessor(new ProcessorPlayerMomentum()); PlayerProcessor::AddProcessor(new ProcessorPlayerPosition()); PlayerProcessor::AddProcessor(new ProcessorPlayerQuickKeys()); PlayerProcessor::AddProcessor(new ProcessorPlayerRegionAuthority()); @@ -150,6 +154,8 @@ void ProcessorInitializer() WorldProcessor::AddProcessor(new ProcessorDoorState()); WorldProcessor::AddProcessor(new ProcessorMusicPlay()); WorldProcessor::AddProcessor(new ProcessorObjectAnimPlay()); + WorldProcessor::AddProcessor(new ProcessorObjectAttach()); + WorldProcessor::AddProcessor(new ProcessorObjectCollision()); WorldProcessor::AddProcessor(new ProcessorObjectDelete()); WorldProcessor::AddProcessor(new ProcessorObjectLock()); WorldProcessor::AddProcessor(new ProcessorObjectMove()); diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerMomentum.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerMomentum.hpp new file mode 100644 index 000000000..6d1aa4820 --- /dev/null +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerMomentum.hpp @@ -0,0 +1,32 @@ +#ifndef OPENMW_PROCESSORPLAYERMOMENTUM_HPP +#define OPENMW_PROCESSORPLAYERMOMENTUM_HPP + + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerMomentum : public PlayerProcessor + { + public: + ProcessorPlayerMomentum() + { + BPP_INIT(ID_PLAYER_MOMENTUM) + } + + virtual void Do(PlayerPacket &packet, BasePlayer *player) + { + if (!isLocal()) return; + + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_MOMENTUM about LocalPlayer from server"); + + if (!isRequest()) + { + LocalPlayer &localPlayer = static_cast(*player); + //localPlayer.setMomentum(); + } + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERMOMENTUM_HPP diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp new file mode 100644 index 000000000..0554af1ee --- /dev/null +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectAttach.hpp @@ -0,0 +1,26 @@ +#ifndef OPENMW_PROCESSOROBJECTATTACH_HPP +#define OPENMW_PROCESSOROBJECTATTACH_HPP + +#include "BaseObjectProcessor.hpp" + +namespace mwmp +{ + class ProcessorObjectAttach : public BaseObjectProcessor + { + public: + ProcessorObjectAttach() + { + BPP_INIT(ID_OBJECT_ATTACH) + } + + virtual void Do(WorldPacket &packet, WorldEvent &event) + { + BaseObjectProcessor::Do(packet, event); + + //event.attachObjects(ptrCellStore); + } + + }; +} + +#endif //OPENMW_PROCESSOROBJECTATTACH_HPP diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp new file mode 100644 index 000000000..b14d83430 --- /dev/null +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectCollision.hpp @@ -0,0 +1,26 @@ +#ifndef OPENMW_PROCESSOROBJECTCOLLISION_HPP +#define OPENMW_PROCESSOROBJECTCOLLISION_HPP + +#include "BaseObjectProcessor.hpp" + +namespace mwmp +{ + class ProcessorObjectCollision : public BaseObjectProcessor + { + public: + ProcessorObjectCollision() + { + BPP_INIT(ID_OBJECT_COLLISION) + } + + virtual void Do(WorldPacket &packet, WorldEvent &event) + { + BaseObjectProcessor::Do(packet, event); + + //event.setObjectCollisions(ptrCellStore); + } + + }; +} + +#endif //OPENMW_PROCESSOROBJECTCOLLISION_HPP diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 6437feadb..f9abc1f03 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -188,21 +188,21 @@ add_component_dir (openmw-mp/Packets/Player PacketCellCreate PacketRecordDynamic PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay - PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty PacketPlayerCellChange - PacketPlayerCellState PacketPlayerClass PacketPlayerDeath PacketPlayerEquipment PacketPlayerFaction - PacketPlayerInteraction PacketPlayerInventory PacketPlayerJail PacketPlayerJournal PacketPlayerKillCount PacketPlayerLevel - PacketPlayerMap PacketPlayerMiscellaneous PacketPlayerPosition PacketPlayerQuickKeys PacketPlayerRegionAuthority - PacketPlayerReputation PacketPlayerRest PacketPlayerResurrect PacketPlayerShapeshift PacketPlayerSkill PacketPlayerSpeech - PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic + PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty + PacketPlayerCellChange PacketPlayerCellState PacketPlayerClass PacketPlayerDeath PacketPlayerEquipment + PacketPlayerFaction PacketPlayerInteraction PacketPlayerInventory PacketPlayerJail PacketPlayerJournal + PacketPlayerKillCount PacketPlayerLevel PacketPlayerMap PacketPlayerMiscellaneous PacketPlayerMomentum + PacketPlayerPosition PacketPlayerQuickKeys PacketPlayerRegionAuthority PacketPlayerReputation PacketPlayerRest + PacketPlayerResurrect PacketPlayerShapeshift PacketPlayerSkill PacketPlayerSpeech PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic ) add_component_dir (openmw-mp/Packets/World WorldPacket - PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectDelete PacketDoorDestination - PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace PacketObjectReset PacketObjectRotate - PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap PacketMusicPlay PacketVideoPlay - PacketScriptLocalShort PacketScriptLocalFloat PacketScriptMemberShort PacketScriptMemberFloat PacketScriptGlobalShort - PacketScriptGlobalFloat + PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision + PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace + PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap + PacketMusicPlay PacketVideoPlay PacketScriptLocalShort PacketScriptLocalFloat PacketScriptMemberShort + PacketScriptMemberFloat PacketScriptGlobalShort PacketScriptGlobalFloat ) add_component_dir (fallback diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 9f5cb138d..654f7d75b 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -33,6 +33,7 @@ #include "../Packets/Player/PacketPlayerLevel.hpp" #include "../Packets/Player/PacketPlayerMap.hpp" #include "../Packets/Player/PacketPlayerMiscellaneous.hpp" +#include "../Packets/Player/PacketPlayerMomentum.hpp" #include "../Packets/Player/PacketPlayerPosition.hpp" #include "../Packets/Player/PacketPlayerQuickKeys.hpp" #include "../Packets/Player/PacketPlayerRegionAuthority.hpp" @@ -95,6 +96,7 @@ mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *p AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp index 1b64767e6..0b07409ad 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -1,4 +1,6 @@ #include "../Packets/World/PacketObjectAnimPlay.hpp" +#include "../Packets/World/PacketObjectAttach.hpp" +#include "../Packets/World/PacketObjectCollision.hpp" #include "../Packets/World/PacketObjectDelete.hpp" #include "../Packets/World/PacketObjectLock.hpp" #include "../Packets/World/PacketObjectMove.hpp" @@ -38,6 +40,8 @@ inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::R mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer) { AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index e87272e09..f1f41e8df 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -47,6 +47,7 @@ enum GameMessages ID_PLAYER_LEVEL, ID_PLAYER_MAP, ID_PLAYER_MISCELLANEOUS, + ID_PLAYER_MOMENTUM, ID_PLAYER_POSITION, ID_PLAYER_QUICKKEYS, ID_PLAYER_REGION_AUTHORITY, @@ -76,6 +77,8 @@ enum GameMessages ID_ACTOR_STATS_DYNAMIC, ID_OBJECT_ANIM_PLAY, + ID_OBJECT_ATTACH, + ID_OBJECT_COLLISION, ID_OBJECT_DELETE, ID_OBJECT_LOCK, ID_OBJECT_MOVE, diff --git a/components/openmw-mp/Packets/Player/PacketPlayerMomentum.cpp b/components/openmw-mp/Packets/Player/PacketPlayerMomentum.cpp new file mode 100644 index 000000000..ceaebc0be --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerMomentum.cpp @@ -0,0 +1,16 @@ +#include "PacketPlayerMomentum.hpp" +#include + +using namespace mwmp; + +PacketPlayerMomentum::PacketPlayerMomentum(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_PLAYER_MOMENTUM; + priority = MEDIUM_PRIORITY; +} + +void PacketPlayerMomentum::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + // Placeholder +} diff --git a/components/openmw-mp/Packets/Player/PacketPlayerMomentum.hpp b/components/openmw-mp/Packets/Player/PacketPlayerMomentum.hpp new file mode 100644 index 000000000..36062b744 --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerMomentum.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETPLAYERMOMENTUM_HPP +#define OPENMW_PACKETPLAYERMOMENTUM_HPP + +#include + +namespace mwmp +{ + class PacketPlayerMomentum : public PlayerPacket + { + public: + PacketPlayerMomentum(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETPLAYERMOMENTUM_HPP diff --git a/components/openmw-mp/Packets/World/PacketObjectAttach.cpp b/components/openmw-mp/Packets/World/PacketObjectAttach.cpp new file mode 100644 index 000000000..7404e72f0 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectAttach.cpp @@ -0,0 +1,16 @@ +#include +#include "PacketObjectAttach.hpp" + +using namespace mwmp; + +PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_OBJECT_ATTACH; + hasCellData = true; +} + +void PacketObjectAttach::Object(WorldObject &worldObject, bool send) +{ + WorldPacket::Object(worldObject, send); + // Placeholder +} diff --git a/components/openmw-mp/Packets/World/PacketObjectAttach.hpp b/components/openmw-mp/Packets/World/PacketObjectAttach.hpp new file mode 100644 index 000000000..98e1b53d2 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectAttach.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETOBJECTATTACH_HPP +#define OPENMW_PACKETOBJECTATTACH_HPP + +#include + +namespace mwmp +{ + class PacketObjectAttach : public WorldPacket + { + public: + PacketObjectAttach(RakNet::RakPeerInterface *peer); + + virtual void Object(WorldObject &worldObject, bool send); + }; +} + +#endif //OPENMW_PACKETOBJECTATTACH_HPP diff --git a/components/openmw-mp/Packets/World/PacketObjectCollision.cpp b/components/openmw-mp/Packets/World/PacketObjectCollision.cpp new file mode 100644 index 000000000..deeb6b5a6 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectCollision.cpp @@ -0,0 +1,16 @@ +#include +#include "PacketObjectCollision.hpp" + +using namespace mwmp; + +PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_OBJECT_COLLISION; + hasCellData = true; +} + +void PacketObjectCollision::Object(WorldObject &worldObject, bool send) +{ + WorldPacket::Object(worldObject, send); + // Placeholder +} diff --git a/components/openmw-mp/Packets/World/PacketObjectCollision.hpp b/components/openmw-mp/Packets/World/PacketObjectCollision.hpp new file mode 100644 index 000000000..63c6a9129 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectCollision.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETOBJECTCOLLISION_HPP +#define OPENMW_PACKETOBJECTCOLLISION_HPP + +#include + +namespace mwmp +{ + class PacketObjectCollision : public WorldPacket + { + public: + PacketObjectCollision(RakNet::RakPeerInterface *peer); + + virtual void Object(WorldObject &worldObject, bool send); + }; +} + +#endif //OPENMW_PACKETOBJECTCOLLISION_HPP