diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index fc92445a8..f835409ce 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -61,31 +61,35 @@ source_group(tes3mp-server FILES ${SERVER} ${SERVER_HEADER}) set(PROCESSORS_ACTOR processors/actor/ProcessorActorAnimFlags.hpp processors/actor/ProcessorActorAnimPlay.hpp processors/actor/ProcessorActorAttack.hpp processors/actor/ProcessorActorCellChange.hpp - processors/actor/ProcessorActorEquipment.hpp processors/actor/ProcessorActorList.hpp - processors/actor/ProcessorActorPosition.hpp processors/actor/ProcessorActorSpeech.hpp - processors/actor/ProcessorActorStatsDynamic.hpp processors/actor/ProcessorActorTest.hpp + processors/actor/ProcessorActorEquipment.hpp processors/actor/ProcessorActorInteraction.hpp + processors/actor/ProcessorActorList.hpp processors/actor/ProcessorActorPosition.hpp + processors/actor/ProcessorActorSpeech.hpp processors/actor/ProcessorActorStatsDynamic.hpp + processors/actor/ProcessorActorTest.hpp ) source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR}) set(PROCESSORS_PLAYER processors/player/ProcessorChatMsg.hpp processors/player/ProcessorGUIMessageBox.hpp - processors/player/ProcessorGameWeather.hpp processors/player/ProcessorPlayerAnimFlags.hpp - processors/player/ProcessorPlayerAnimPlay.hpp processors/player/ProcessorPlayerAttack.hpp - processors/player/ProcessorPlayerAttribute.hpp processors/player/ProcessorPlayerBook.hpp - processors/player/ProcessorPlayerBounty.hpp processors/player/ProcessorPlayerCellChange.hpp - processors/player/ProcessorPlayerCellState.hpp processors/player/ProcessorPlayerCharClass.hpp - processors/player/ProcessorPlayerCharGen.hpp processors/player/ProcessorPlayerDeath.hpp - processors/player/ProcessorPlayerDisposition.hpp processors/player/ProcessorPlayerEquipment.hpp - processors/player/ProcessorPlayerFaction.hpp processors/player/ProcessorPlayerInventory.hpp + processors/player/ProcessorGUIWindow.hpp + + processors/player/ProcessorRecordDynamic.hpp processors/player/ProcessorGameWeather.hpp + processors/player/ProcessorPlayerAnimFlags.hpp processors/player/ProcessorPlayerAnimPlay.hpp + processors/player/ProcessorPlayerAttack.hpp processors/player/ProcessorPlayerAttribute.hpp + processors/player/ProcessorPlayerBook.hpp processors/player/ProcessorPlayerBounty.hpp + processors/player/ProcessorPlayerCellChange.hpp processors/player/ProcessorPlayerCellState.hpp + processors/player/ProcessorPlayerCharClass.hpp processors/player/ProcessorPlayerCharGen.hpp + processors/player/ProcessorPlayerDeath.hpp processors/player/ProcessorPlayerDisposition.hpp + processors/player/ProcessorPlayerEquipment.hpp processors/player/ProcessorPlayerFaction.hpp + processors/player/ProcessorPlayerInteraction.hpp processors/player/ProcessorPlayerInventory.hpp processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerKillCount.hpp processors/player/ProcessorPlayerLevel.hpp processors/player/ProcessorPlayerMap.hpp - processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerQuickKeys.hpp - processors/player/ProcessorPlayerRest.hpp processors/player/ProcessorPlayerResurrect.hpp - processors/player/ProcessorPlayerShapeshift.hpp processors/player/ProcessorPlayerSkill.hpp - processors/player/ProcessorPlayerSpeech.hpp processors/player/ProcessorPlayerSpellbook.hpp - processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerTopic.hpp - processors/player/ProcessorGUIWindow.hpp + processors/player/ProcessorPlayerMiscellaneous.hpp processors/player/ProcessorPlayerPosition.hpp + processors/player/ProcessorPlayerQuickKeys.hpp processors/player/ProcessorPlayerRest.hpp + processors/player/ProcessorPlayerResurrect.hpp processors/player/ProcessorPlayerShapeshift.hpp + processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerSpeech.hpp + processors/player/ProcessorPlayerSpellbook.hpp processors/player/ProcessorPlayerStatsDynamic.hpp + processors/player/ProcessorPlayerTopic.hpp ) source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER}) @@ -99,7 +103,8 @@ set(PROCESSORS_WORLD processors/world/ProcessorObjectSpawn.hpp processors/world/ProcessorObjectState.hpp processors/world/ProcessorObjectTrap.hpp processors/world/ProcessorScriptLocalShort.hpp processors/world/ProcessorScriptLocalFloat.hpp processors/world/ProcessorScriptMemberShort.hpp - processors/world/ProcessorScriptGlobalShort.hpp processors/world/ProcessorVideoPlay.hpp + processors/world/ProcessorScriptMemberFloat.hpp processors/world/ProcessorScriptGlobalShort.hpp + processors/world/ProcessorScriptGlobalFloat.hpp processors/world/ProcessorVideoPlay.hpp ) source_group(tes3mp-server\\processors\\world FILES ${PROCESSORS_WORLD}) diff --git a/apps/openmw-mp/Script/EventController.cpp b/apps/openmw-mp/Script/EventController.cpp index 80289fdc3..531694cc2 100644 --- a/apps/openmw-mp/Script/EventController.cpp +++ b/apps/openmw-mp/Script/EventController.cpp @@ -51,6 +51,7 @@ EventController::EventController(LuaState *luaCtrl) ADD_CORE_EVENT(ON_PLAYER_SKILL), ADD_CORE_EVENT(ON_PLAYER_LEVEL), ADD_CORE_EVENT(ON_PLAYER_BOUNTY), + ADD_CORE_EVENT(ON_PLAYER_REPUTATION), ADD_CORE_EVENT(ON_PLAYER_EQUIPMENT), ADD_CORE_EVENT(ON_PLAYER_INVENTORY), ADD_CORE_EVENT(ON_PLAYER_JOURNAL), @@ -61,7 +62,9 @@ EventController::EventController(LuaState *luaCtrl) ADD_CORE_EVENT(ON_PLAYER_TOPIC), ADD_CORE_EVENT(ON_PLAYER_DISPOSITION), ADD_CORE_EVENT(ON_PLAYER_BOOK), + ADD_CORE_EVENT(ON_PLAYER_MISCELLANEOUS), ADD_CORE_EVENT(ON_PLAYER_MAP), + ADD_CORE_EVENT(ON_PLAYER_INTERACTION), ADD_CORE_EVENT(ON_PLAYER_REST), ADD_CORE_EVENT(ON_PLAYER_SENDMESSAGE), ADD_CORE_EVENT(ON_PLAYER_ENDCHARGEN), diff --git a/apps/openmw-mp/Script/EventController.hpp b/apps/openmw-mp/Script/EventController.hpp index e2db3a0e6..1091bae20 100644 --- a/apps/openmw-mp/Script/EventController.hpp +++ b/apps/openmw-mp/Script/EventController.hpp @@ -27,6 +27,7 @@ namespace CoreEvent ON_PLAYER_SKILL, ON_PLAYER_LEVEL, ON_PLAYER_BOUNTY, + ON_PLAYER_REPUTATION, ON_PLAYER_EQUIPMENT, ON_PLAYER_INVENTORY, ON_PLAYER_JOURNAL, @@ -37,7 +38,9 @@ namespace CoreEvent ON_PLAYER_TOPIC, ON_PLAYER_DISPOSITION, ON_PLAYER_BOOK, + ON_PLAYER_MISCELLANEOUS, ON_PLAYER_MAP, + ON_PLAYER_INTERACTION, ON_PLAYER_REST, ON_PLAYER_SENDMESSAGE, ON_PLAYER_ENDCHARGEN, diff --git a/apps/openmw-mp/processors/actor/ProcessorActorInteraction.hpp b/apps/openmw-mp/processors/actor/ProcessorActorInteraction.hpp new file mode 100644 index 000000000..2bd6811e8 --- /dev/null +++ b/apps/openmw-mp/processors/actor/ProcessorActorInteraction.hpp @@ -0,0 +1,27 @@ +#ifndef OPENMW_PROCESSORACTORINTERACTION_HPP +#define OPENMW_PROCESSORACTORINTERACTION_HPP + +#include "../ActorProcessor.hpp" + +namespace mwmp +{ + class ProcessorActorInteraction final : public ActorProcessor + { + public: + ProcessorActorInteraction() + { + BPP_INIT(ID_ACTOR_INTERACTION) + } + + void Do(ActorPacket &packet, const std::shared_ptr &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_PROCESSORACTORINTERACTION_HPP diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp index 44d65a533..b0f0fe11c 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerAttack.hpp @@ -1,7 +1,3 @@ -// -// Created by koncord on 01.04.17. -// - #ifndef OPENMW_PROCESSORPLAYERATTACK_HPP #define OPENMW_PROCESSORPLAYERATTACK_HPP diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerInteraction.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerInteraction.hpp new file mode 100644 index 000000000..41d755803 --- /dev/null +++ b/apps/openmw-mp/processors/player/ProcessorPlayerInteraction.hpp @@ -0,0 +1,25 @@ +#ifndef OPENMW_PROCESSORPLAYERINTERACTION_HPP +#define OPENMW_PROCESSORPLAYERINTERACTION_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerInteraction final : public PlayerProcessor + { + public: + ProcessorPlayerInteraction() + { + BPP_INIT(ID_PLAYER_INTERACTION) + } + + void Do(PlayerPacket &packet, const std::shared_ptr &player) override + { + DEBUG_PRINTF(strPacketID.c_str()); + + Networking::get().getState().getEventCtrl().Call(player); + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERINTERACTION_HPP diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerMiscellaneous.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerMiscellaneous.hpp new file mode 100644 index 000000000..050c57f4a --- /dev/null +++ b/apps/openmw-mp/processors/player/ProcessorPlayerMiscellaneous.hpp @@ -0,0 +1,25 @@ +#ifndef OPENMW_PROCESSORPLAYERMISCELLANEOUS_HPP +#define OPENMW_PROCESSORPLAYERMISCELLANEOUS_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerMiscellaneous final : public PlayerProcessor + { + public: + ProcessorPlayerMiscellaneous() + { + BPP_INIT(ID_PLAYER_MISCELLANEOUS) + } + + void Do(PlayerPacket &packet, const std::shared_ptr &player) override + { + DEBUG_PRINTF(strPacketID.c_str()); + + Networking::get().getState().getEventCtrl().Call(player); + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERMISCELLANEOUS_HPP diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerQuickKeys.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerQuickKeys.hpp index 812b7b2d8..9dd7703cc 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerQuickKeys.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerQuickKeys.hpp @@ -5,7 +5,7 @@ namespace mwmp { - class ProcessorPlayerQuickKeys : public PlayerProcessor + class ProcessorPlayerQuickKeys final : public PlayerProcessor { public: ProcessorPlayerQuickKeys() diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerReputation.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerReputation.hpp new file mode 100644 index 000000000..b0187627b --- /dev/null +++ b/apps/openmw-mp/processors/player/ProcessorPlayerReputation.hpp @@ -0,0 +1,23 @@ +#ifndef OPENMW_PROCESSORPLAYERREPUTATION_HPP +#define OPENMW_PROCESSORPLAYERREPUTATION_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerReputation final : public PlayerProcessor + { + public: + ProcessorPlayerReputation() + { + BPP_INIT(ID_PLAYER_REPUTATION) + } + + void Do(PlayerPacket &packet, const std::shared_ptr &player) override + { + Networking::get().getState().getEventCtrl().Call(player); + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERREPUTATION_HPP diff --git a/apps/openmw-mp/processors/player/ProcessorRecordDynamic.hpp b/apps/openmw-mp/processors/player/ProcessorRecordDynamic.hpp new file mode 100644 index 000000000..9be6a75c1 --- /dev/null +++ b/apps/openmw-mp/processors/player/ProcessorRecordDynamic.hpp @@ -0,0 +1,25 @@ +#ifndef OPENMW_PROCESSORPLAYERRECORDDYNAMIC_HPP +#define OPENMW_PROCESSORPLAYERRECORDDYNAMIC_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerRecordDynamic final : public PlayerProcessor + { + public: + ProcessorPlayerRecordDynamic() + { + BPP_INIT(ID_RECORD_DYNAMIC) + } + + void Do(PlayerPacket &packet, const std::shared_ptr &player) override + { + DEBUG_PRINTF(strPacketID.c_str()); + + Script::Call(player.getId()); + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERRECORDDYNAMIC_HPP diff --git a/apps/openmw-mp/processors/world/ProcessorScriptGlobalFloat.hpp b/apps/openmw-mp/processors/world/ProcessorScriptGlobalFloat.hpp new file mode 100644 index 000000000..56d9c6375 --- /dev/null +++ b/apps/openmw-mp/processors/world/ProcessorScriptGlobalFloat.hpp @@ -0,0 +1,18 @@ +#ifndef OPENMW_PROCESSORSCRIPTGLOBALFLOAT_HPP +#define OPENMW_PROCESSORSCRIPTGLOBALFLOAT_HPP + +#include "../WorldProcessor.hpp" + +namespace mwmp +{ + class ProcessorScriptGlobalFloat final : public WorldProcessor + { + public: + ProcessorScriptGlobalFloat() + { + BPP_INIT(ID_SCRIPT_GLOBAL_FLOAT) + } + }; +} + +#endif //OPENMW_PROCESSORSCRIPTGLOBALFLOAT_HPP diff --git a/apps/openmw-mp/processors/world/ProcessorScriptMemberFloat.hpp b/apps/openmw-mp/processors/world/ProcessorScriptMemberFloat.hpp new file mode 100644 index 000000000..83b97b8ad --- /dev/null +++ b/apps/openmw-mp/processors/world/ProcessorScriptMemberFloat.hpp @@ -0,0 +1,18 @@ +#ifndef OPENMW_PROCESSORSCRIPTMEMBERFLOAT_HPP +#define OPENMW_PROCESSORSCRIPTMEMBERFLOAT_HPP + +#include "../WorldProcessor.hpp" + +namespace mwmp +{ + class ProcessorScriptMemberFloat final : public WorldProcessor + { + public: + ProcessorScriptMemberFloat() + { + BPP_INIT(ID_SCRIPT_MEMBER_FLOAT) + } + }; +} + +#endif //OPENMW_PROCESSORSCRIPTMEMBERFLOAT_HPP diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 5fc25dc86..731ed9c93 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -108,25 +108,27 @@ add_openmw_dir(mwmp/processors BaseClientPacketProcessor PlayerProcessor WorldPr ) add_openmw_dir (mwmp/processors/actor ProcessorActorAI ProcessorActorAnimFlags ProcessorActorAnimPlay ProcessorActorAttack - ProcessorActorAuthority ProcessorActorCellChange ProcessorActorDeath ProcessorActorEquipment ProcessorActorList - ProcessorActorPosition ProcessorActorSpeech ProcessorActorStatsDynamic ProcessorActorTest + ProcessorActorAuthority ProcessorActorCellChange ProcessorActorDeath ProcessorActorEquipment ProcessorActorInteraction + ProcessorActorList ProcessorActorPosition ProcessorActorSpeech ProcessorActorStatsDynamic ProcessorActorTest ) add_openmw_dir (mwmp/processors/player ProcessorChatMessage ProcessorGUIMessageBox ProcessorHandshake - ProcessorUserDisconnected ProcessorUserMyID ProcessorGameSettings ProcessorGameTime ProcessorGameWeather - ProcessorPlayerBaseInfo ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute - ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerCharClass - ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment ProcessorPlayerFaction + ProcessorUserDisconnected ProcessorUserMyID ProcessorCellCreate ProcessorRecordDynamic ProcessorGameSettings + ProcessorGameTime ProcessorGameWeather ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay ProcessorPlayerAttack + ProcessorPlayerAttribute ProcessorPlayerBaseInfo ProcessorPlayerBehavior ProcessorPlayerBook ProcessorPlayerBounty + ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath + ProcessorPlayerDisposition ProcessorPlayerEquipment ProcessorPlayerFaction ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal ProcessorPlayerKillCount ProcessorPlayerLevel - ProcessorPlayerMap ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerResurrect ProcessorPlayerShapeshift - ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic + ProcessorPlayerMap ProcessorPlayerMiscellaneous 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 ProcessorObjectRotate ProcessorObjectScale ProcessorObjectSpawn - ProcessorObjectState ProcessorObjectTrap ProcessorScriptLocalShort ProcessorScriptLocalFloat ProcessorScriptMemberShort - ProcessorScriptGlobalShort + 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 ad3e36152..3cc12a2a5 100644 --- a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp @@ -11,33 +11,39 @@ #include "player/ProcessorGUIWindow.hpp" #include "player/ProcessorHandshake.hpp" #include "player/ProcessorUserDisconnected.hpp" +#include "player/ProcessorCellCreate.hpp" +#include "player/ProcessorRecordDynamic.hpp" #include "player/ProcessorGameSettings.hpp" #include "player/ProcessorGameTime.hpp" #include "player/ProcessorGameWeather.hpp" -#include "player/ProcessorPlayerBaseInfo.hpp" -#include "player/ProcessorPlayerCharGen.hpp" #include "player/ProcessorPlayerAnimFlags.hpp" #include "player/ProcessorPlayerAnimPlay.hpp" #include "player/ProcessorPlayerAttack.hpp" #include "player/ProcessorPlayerAttribute.hpp" +#include "player/ProcessorPlayerBaseInfo.hpp" +#include "player/ProcessorPlayerBehavior.hpp" #include "player/ProcessorPlayerBook.hpp" #include "player/ProcessorPlayerBounty.hpp" #include "player/ProcessorPlayerCellChange.hpp" #include "player/ProcessorPlayerCellState.hpp" #include "player/ProcessorPlayerCharClass.hpp" +#include "player/ProcessorPlayerCharGen.hpp" #include "player/ProcessorPlayerDeath.hpp" #include "player/ProcessorPlayerDisposition.hpp" #include "player/ProcessorPlayerEquipment.hpp" #include "player/ProcessorPlayerFaction.hpp" +#include "player/ProcessorPlayerInteraction.hpp" #include "player/ProcessorPlayerInventory.hpp" #include "player/ProcessorPlayerJail.hpp" #include "player/ProcessorPlayerJournal.hpp" #include "player/ProcessorPlayerKillCount.hpp" #include "player/ProcessorPlayerLevel.hpp" #include "player/ProcessorPlayerMap.hpp" +#include "player/ProcessorPlayerMiscellaneous.hpp" #include "player/ProcessorPlayerPosition.hpp" #include "player/ProcessorPlayerQuickKeys.hpp" #include "player/ProcessorPlayerRegionAuthority.hpp" +#include "player/ProcessorPlayerReputation.hpp" #include "player/ProcessorPlayerRest.hpp" #include "player/ProcessorPlayerResurrect.hpp" #include "player/ProcessorPlayerShapeshift.hpp" @@ -50,6 +56,7 @@ #include "WorldProcessor.hpp" #include "world/ProcessorConsoleCommand.hpp" #include "world/ProcessorContainer.hpp" +#include "world/ProcessorDoorDestination.hpp" #include "world/ProcessorDoorState.hpp" #include "world/ProcessorMusicPlay.hpp" #include "world/ProcessorObjectAnimPlay.hpp" @@ -57,6 +64,7 @@ #include "world/ProcessorObjectLock.hpp" #include "world/ProcessorObjectMove.hpp" #include "world/ProcessorObjectPlace.hpp" +#include "world/ProcessorObjectReset.hpp" #include "world/ProcessorObjectRotate.hpp" #include "world/ProcessorObjectScale.hpp" #include "world/ProcessorObjectSpawn.hpp" @@ -65,7 +73,9 @@ #include "world/ProcessorScriptLocalShort.hpp" #include "world/ProcessorScriptLocalFloat.hpp" #include "world/ProcessorScriptMemberShort.hpp" +#include "world/ProcessorScriptMemberFloat.hpp" #include "world/ProcessorScriptGlobalShort.hpp" +#include "world/ProcessorScriptGlobalFloat.hpp" #include "world/ProcessorVideoPlay.hpp" #include "actor/ProcessorActorAI.hpp" @@ -76,6 +86,7 @@ #include "actor/ProcessorActorCellChange.hpp" #include "actor/ProcessorActorDeath.hpp" #include "actor/ProcessorActorEquipment.hpp" +#include "actor/ProcessorActorInteraction.hpp" #include "actor/ProcessorActorList.hpp" #include "actor/ProcessorActorPosition.hpp" #include "actor/ProcessorActorSpeech.hpp" @@ -91,33 +102,39 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorGUIWindow()); PlayerProcessor::AddProcessor(new ProcessorHandshake()); PlayerProcessor::AddProcessor(new ProcessorUserDisconnected()); + PlayerProcessor::AddProcessor(new ProcessorCellCreate()); + PlayerProcessor::AddProcessor(new ProcessorRecordDynamic()); PlayerProcessor::AddProcessor(new ProcessorGameSettings()); PlayerProcessor::AddProcessor(new ProcessorGameTime()); PlayerProcessor::AddProcessor(new ProcessorGameWeather()); - PlayerProcessor::AddProcessor(new ProcessorPlayerBaseInfo()); - PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimPlay()); PlayerProcessor::AddProcessor(new ProcessorPlayerAttack()); PlayerProcessor::AddProcessor(new ProcessorPlayerAttribute()); + PlayerProcessor::AddProcessor(new ProcessorPlayerBaseInfo()); + PlayerProcessor::AddProcessor(new ProcessorPlayerBehavior()); PlayerProcessor::AddProcessor(new ProcessorPlayerBook()); PlayerProcessor::AddProcessor(new ProcessorPlayerBounty()); PlayerProcessor::AddProcessor(new ProcessorPlayerCellChange()); PlayerProcessor::AddProcessor(new ProcessorPlayerCellState()); PlayerProcessor::AddProcessor(new ProcessorPlayerCharClass()); + PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen()); PlayerProcessor::AddProcessor(new ProcessorPlayerDeath()); PlayerProcessor::AddProcessor(new ProcessorPlayerDisposition()); PlayerProcessor::AddProcessor(new ProcessorPlayerEquipment()); PlayerProcessor::AddProcessor(new ProcessorPlayerFaction()); + PlayerProcessor::AddProcessor(new ProcessorPlayerInteraction()); PlayerProcessor::AddProcessor(new ProcessorPlayerInventory()); PlayerProcessor::AddProcessor(new ProcessorPlayerJail()); PlayerProcessor::AddProcessor(new ProcessorPlayerJournal()); PlayerProcessor::AddProcessor(new ProcessorPlayerKillCount()); PlayerProcessor::AddProcessor(new ProcessorPlayerLevel()); PlayerProcessor::AddProcessor(new ProcessorPlayerMap()); + PlayerProcessor::AddProcessor(new ProcessorPlayerMiscellaneous()); PlayerProcessor::AddProcessor(new ProcessorPlayerPosition()); PlayerProcessor::AddProcessor(new ProcessorPlayerQuickKeys()); PlayerProcessor::AddProcessor(new ProcessorPlayerRegionAuthority()); + PlayerProcessor::AddProcessor(new ProcessorPlayerReputation()); PlayerProcessor::AddProcessor(new ProcessorPlayerRest()); PlayerProcessor::AddProcessor(new ProcessorPlayerResurrect()); PlayerProcessor::AddProcessor(new ProcessorPlayerShapeshift()); @@ -129,6 +146,7 @@ void ProcessorInitializer() WorldProcessor::AddProcessor(new ProcessorConsoleCommand()); WorldProcessor::AddProcessor(new ProcessorContainer()); + WorldProcessor::AddProcessor(new ProcessorDoorDestination()); WorldProcessor::AddProcessor(new ProcessorDoorState()); WorldProcessor::AddProcessor(new ProcessorMusicPlay()); WorldProcessor::AddProcessor(new ProcessorObjectAnimPlay()); @@ -136,6 +154,7 @@ void ProcessorInitializer() WorldProcessor::AddProcessor(new ProcessorObjectLock()); WorldProcessor::AddProcessor(new ProcessorObjectMove()); WorldProcessor::AddProcessor(new ProcessorObjectPlace()); + WorldProcessor::AddProcessor(new ProcessorObjectReset()); WorldProcessor::AddProcessor(new ProcessorObjectRotate()); WorldProcessor::AddProcessor(new ProcessorObjectScale()); WorldProcessor::AddProcessor(new ProcessorObjectSpawn()); @@ -144,7 +163,9 @@ void ProcessorInitializer() WorldProcessor::AddProcessor(new ProcessorScriptLocalShort()); WorldProcessor::AddProcessor(new ProcessorScriptLocalFloat()); WorldProcessor::AddProcessor(new ProcessorScriptMemberShort()); + WorldProcessor::AddProcessor(new ProcessorScriptMemberFloat()); WorldProcessor::AddProcessor(new ProcessorScriptGlobalShort()); + WorldProcessor::AddProcessor(new ProcessorScriptGlobalFloat()); WorldProcessor::AddProcessor(new ProcessorVideoPlay()); ActorProcessor::AddProcessor(new ProcessorActorAI()); @@ -155,6 +176,7 @@ void ProcessorInitializer() ActorProcessor::AddProcessor(new ProcessorActorCellChange()); ActorProcessor::AddProcessor(new ProcessorActorDeath()); ActorProcessor::AddProcessor(new ProcessorActorEquipment()); + ActorProcessor::AddProcessor(new ProcessorActorInteraction()); ActorProcessor::AddProcessor(new ProcessorActorList()); ActorProcessor::AddProcessor(new ProcessorActorPosition()); ActorProcessor::AddProcessor(new ProcessorActorSpeech()); diff --git a/apps/openmw/mwmp/processors/actor/ProcessorActorInteraction.hpp b/apps/openmw/mwmp/processors/actor/ProcessorActorInteraction.hpp new file mode 100644 index 000000000..6d7dd2a85 --- /dev/null +++ b/apps/openmw/mwmp/processors/actor/ProcessorActorInteraction.hpp @@ -0,0 +1,25 @@ +#ifndef OPENMW_PROCESSORACTORINTERACTION_HPP +#define OPENMW_PROCESSORACTORINTERACTION_HPP + +#include "../ActorProcessor.hpp" +#include "apps/openmw/mwmp/Main.hpp" +#include "apps/openmw/mwmp/CellController.hpp" + +namespace mwmp +{ + class ProcessorActorInteraction final: public ActorProcessor + { + public: + ProcessorActorInteraction() + { + BPP_INIT(ID_ACTOR_INTERACTION); + } + + virtual void Do(ActorPacket &packet, ActorList &actorList) + { + //Main::get().getCellController()->readInteraction(actorList); + } + }; +} + +#endif //OPENMW_PROCESSORACTORINTERACTION_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorCellCreate.hpp b/apps/openmw/mwmp/processors/player/ProcessorCellCreate.hpp new file mode 100644 index 000000000..227ab902b --- /dev/null +++ b/apps/openmw/mwmp/processors/player/ProcessorCellCreate.hpp @@ -0,0 +1,23 @@ +#ifndef OPENMW_PROCESSORCELLCREATE_HPP +#define OPENMW_PROCESSORCELLCREATE_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorCellCreate final: public PlayerProcessor + { + public: + ProcessorCellCreate() + { + BPP_INIT(ID_CELL_CREATE) + } + + virtual void Do(PlayerPacket &packet, BasePlayer *player) + { + // Placeholder + } + }; +} + +#endif //OPENMW_PROCESSORCELLCREATE_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp index 9e62a3e2f..e176b501f 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerAttack.hpp @@ -1,19 +1,9 @@ -// -// Created by koncord on 16.04.17. -// - #ifndef OPENMW_PROCESSORPLAYERATTACK_HPP #define OPENMW_PROCESSORPLAYERATTACK_HPP #include "apps/openmw/mwmp/Main.hpp" #include "../PlayerProcessor.hpp" #include "apps/openmw/mwmp/MechanicsHelper.hpp" -#include "apps/openmw/mwbase/world.hpp" -#include "apps/openmw/mwworld/containerstore.hpp" -#include "apps/openmw/mwworld/inventorystore.hpp" -#include "apps/openmw/mwmechanics/combat.hpp" - -#include "apps/openmw/mwbase/environment.hpp" namespace mwmp { diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerBehavior.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerBehavior.hpp new file mode 100644 index 000000000..7fb22844d --- /dev/null +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerBehavior.hpp @@ -0,0 +1,30 @@ +#ifndef OPENMW_PROCESSORPLAYERBEHAVIOR_HPP +#define OPENMW_PROCESSORPLAYERBEHAVIOR_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerBehavior final: public PlayerProcessor + { + public: + ProcessorPlayerBehavior() + { + BPP_INIT(ID_PLAYER_BEHAVIOR) + } + + virtual void Do(PlayerPacket &packet, BasePlayer *player) + { + if (isLocal()) + { + //static_cast(player)->setBehavior(); + } + else if (player != 0) + { + //static_cast(player)->setBehavior(); + } + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERBEHAVIOR_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerInteraction.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerInteraction.hpp new file mode 100644 index 000000000..c46cee555 --- /dev/null +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerInteraction.hpp @@ -0,0 +1,27 @@ +#ifndef OPENMW_PROCESSORPLAYERINTERACTION_HPP +#define OPENMW_PROCESSORPLAYERINTERACTION_HPP + +#include "apps/openmw/mwmp/Main.hpp" +#include "../PlayerProcessor.hpp" +#include "apps/openmw/mwmp/MechanicsHelper.hpp" + +namespace mwmp +{ + class ProcessorPlayerInteraction final: public PlayerProcessor + { + public: + ProcessorPlayerInteraction() + { + BPP_INIT(ID_PLAYER_INTERACTION) + } + + virtual void Do(PlayerPacket &packet, BasePlayer *player) + { + //if (player != 0) + // MechanicsHelper::processInteraction(player->interaction, static_cast(player)->getPtr()); + } + }; +} + + +#endif //OPENMW_PROCESSORPLAYERINTERACTION_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp index fa6f30ca5..5afeef9b1 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerLevel.hpp @@ -1,7 +1,3 @@ -// -// Created by koncord on 16.04.17. -// - #ifndef OPENMW_PROCESSORPLAYERLEVEL_HPP #define OPENMW_PROCESSORPLAYERLEVEL_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerMiscellaneous.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerMiscellaneous.hpp new file mode 100644 index 000000000..62e365459 --- /dev/null +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerMiscellaneous.hpp @@ -0,0 +1,32 @@ +#ifndef OPENMW_PROCESSORPLAYERMISCELLANEOUS_HPP +#define OPENMW_PROCESSORPLAYERMISCELLANEOUS_HPP + + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerMiscellaneous final: public PlayerProcessor + { + public: + ProcessorPlayerMiscellaneous() + { + BPP_INIT(ID_PLAYER_MISCELLANEOUS) + } + + virtual void Do(PlayerPacket &packet, BasePlayer *player) + { + if (!isLocal()) return; + + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_MISCELLANEOUS about LocalPlayer from server"); + + if (!isRequest()) + { + LocalPlayer &localPlayer = static_cast(*player); + //localPlayer.setMiscellaneous(); + } + } + }; +} + +#endif //OPENMW_PROCESSORPLAYERMISCELLANEOUS_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerQuickKeys.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerQuickKeys.hpp index 5515162a6..2ecc80d39 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerQuickKeys.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerQuickKeys.hpp @@ -6,7 +6,7 @@ namespace mwmp { - class ProcessorPlayerQuickKeys : public PlayerProcessor + class ProcessorPlayerQuickKeys final: public PlayerProcessor { public: ProcessorPlayerQuickKeys() diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerReputation.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerReputation.hpp new file mode 100644 index 000000000..bb8d633f1 --- /dev/null +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerReputation.hpp @@ -0,0 +1,38 @@ +#ifndef OPENMW_PROCESSORPLAYERREPUTATION_HPP +#define OPENMW_PROCESSORPLAYERREPUTATION_HPP + + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorPlayerReputation final: public PlayerProcessor + { + public: + ProcessorPlayerReputation() + { + BPP_INIT(ID_PLAYER_REPUTATION) + } + + virtual void Do(PlayerPacket &packet, BasePlayer *player) + { + if (isLocal()) + { + //if (isRequest()) + // static_cast(player)->updateReputation(true); + //else + // static_cast(player)->setReputation(); + } + else if (player != 0) + { + MWWorld::Ptr ptrPlayer = static_cast(player)->getPtr(); + MWMechanics::NpcStats *ptrNpcStats = &ptrPlayer.getClass().getNpcStats(ptrPlayer); + + ptrNpcStats->setReputation(player->npcStats.mReputation); + } + } + }; +} + + +#endif //OPENMW_PROCESSORPLAYERREPUTATION_HPP diff --git a/apps/openmw/mwmp/processors/player/ProcessorRecordDynamic.hpp b/apps/openmw/mwmp/processors/player/ProcessorRecordDynamic.hpp new file mode 100644 index 000000000..17d1a0650 --- /dev/null +++ b/apps/openmw/mwmp/processors/player/ProcessorRecordDynamic.hpp @@ -0,0 +1,23 @@ +#ifndef OPENMW_PROCESSORRECORDDYNAMIC_HPP +#define OPENMW_PROCESSORRECORDDYNAMIC_HPP + +#include "../PlayerProcessor.hpp" + +namespace mwmp +{ + class ProcessorRecordDynamic final: public PlayerProcessor + { + public: + ProcessorRecordDynamic() + { + BPP_INIT(ID_RECORD_DYNAMIC) + } + + virtual void Do(PlayerPacket &packet, BasePlayer *player) + { + // Placeholder + } + }; +} + +#endif //OPENMW_PROCESSORRECORDDYNAMIC_HPP diff --git a/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp b/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp new file mode 100644 index 000000000..9cfb268b0 --- /dev/null +++ b/apps/openmw/mwmp/processors/world/ProcessorDoorDestination.hpp @@ -0,0 +1,25 @@ +#ifndef OPENMW_PROCESSDOORDESTINATION_HPP +#define OPENMW_PROCESSDOORDESTINATION_HPP + +#include "BaseObjectProcessor.hpp" + +namespace mwmp +{ + class ProcessorDoorDestination final : public BaseObjectProcessor + { + public: + ProcessorDoorDestination() + { + BPP_INIT(ID_DOOR_DESTINATION) + } + + virtual void Do(WorldPacket &packet, WorldEvent &event) + { + BaseObjectProcessor::Do(packet, event); + + //event.setDoorDestinations(ptrCellStore); + } + }; +} + +#endif //OPENMW_PROCESSDOORDESTINATION_HPP diff --git a/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp b/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp new file mode 100644 index 000000000..b5236c697 --- /dev/null +++ b/apps/openmw/mwmp/processors/world/ProcessorObjectReset.hpp @@ -0,0 +1,26 @@ +#ifndef OPENMW_PROCESSOROBJECTRESET_HPP +#define OPENMW_PROCESSOROBJECTRESET_HPP + +#include "BaseObjectProcessor.hpp" + +namespace mwmp +{ + class ProcessorObjectReset : public BaseObjectProcessor + { + public: + ProcessorObjectReset() + { + BPP_INIT(ID_OBJECT_RESET) + } + + virtual void Do(WorldPacket &packet, WorldEvent &event) + { + BaseObjectProcessor::Do(packet, event); + + //event.resetObjects(ptrCellStore); + } + + }; +} + +#endif //OPENMW_PROCESSOROBJECTRESET_HPP diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp new file mode 100644 index 000000000..d0b1b0573 --- /dev/null +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptGlobalFloat.hpp @@ -0,0 +1,24 @@ +#ifndef OPENMW_PROCESSORSCRIPTGLOBALFLOAT_HPP +#define OPENMW_PROCESSORSCRIPTGLOBALFLOAT_HPP + +#include "../WorldProcessor.hpp" + +namespace mwmp +{ + class ProcessorScriptGlobalFloat final: public WorldProcessor + { + public: + ProcessorScriptGlobalFloat() + { + BPP_INIT(ID_SCRIPT_GLOBAL_FLOAT) + } + + virtual void Do(WorldPacket &packet, WorldEvent &event) + { + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); + //event.setGlobalFloats(); + } + }; +} + +#endif //OPENMW_PROCESSORSCRIPTGLOBALFLOAT_HPP diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp index f900268ef..0f9e05ca7 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalFloat.hpp @@ -5,7 +5,7 @@ namespace mwmp { - class ProcessorScriptLocalFloat : public BaseObjectProcessor + class ProcessorScriptLocalFloat final: public BaseObjectProcessor { public: ProcessorScriptLocalFloat() diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp index 13b3008b5..aac28f167 100644 --- a/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptLocalShort.hpp @@ -5,7 +5,7 @@ namespace mwmp { - class ProcessorScriptLocalShort : public BaseObjectProcessor + class ProcessorScriptLocalShort final: public BaseObjectProcessor { public: ProcessorScriptLocalShort() diff --git a/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp new file mode 100644 index 000000000..fa656f5aa --- /dev/null +++ b/apps/openmw/mwmp/processors/world/ProcessorScriptMemberFloat.hpp @@ -0,0 +1,24 @@ +#ifndef OPENMW_PROCESSORSCRIPTMEMBERFLOAT_HPP +#define OPENMW_PROCESSORSCRIPTMEMBERFLOAT_HPP + +#include "../WorldProcessor.hpp" + +namespace mwmp +{ + class ProcessorScriptMemberFloat final: public WorldProcessor + { + public: + ProcessorScriptMemberFloat() + { + BPP_INIT(ID_SCRIPT_MEMBER_FLOAT) + } + + virtual void Do(WorldPacket &packet, WorldEvent &event) + { + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str()); + //event.setMemberFloats(); + } + }; +} + +#endif //OPENMW_PROCESSORSCRIPTMEMBERFLOAT_HPP diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index cbb77bec3..6437feadb 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -176,27 +176,33 @@ add_component_dir (openmw-mp/Packets add_component_dir (openmw-mp/Packets/Actor ActorPacket PacketActorList PacketActorAuthority PacketActorTest PacketActorAI PacketActorAnimFlags PacketActorAnimPlay - PacketActorAttack PacketActorCellChange PacketActorDeath PacketActorEquipment PacketActorPosition PacketActorSpeech - PacketActorStatsDynamic + PacketActorAttack PacketActorCellChange PacketActorDeath PacketActorEquipment PacketActorInteraction PacketActorPosition + PacketActorSpeech PacketActorStatsDynamic ) add_component_dir (openmw-mp/Packets/Player PlayerPacket - PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketGameTime PacketGameWeather + PacketHandshake PacketChatMessage PacketGUIBoxes PacketGUIWindow PacketGameSettings PacketGameTime + PacketGameWeather + + PacketCellCreate PacketRecordDynamic + PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay - PacketPlayerAttack PacketPlayerAttribute PacketPlayerBook PacketPlayerBounty PacketPlayerCellChange + PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty PacketPlayerCellChange PacketPlayerCellState PacketPlayerClass PacketPlayerDeath PacketPlayerEquipment PacketPlayerFaction - PacketPlayerInventory PacketPlayerJail PacketPlayerJournal PacketPlayerKillCount PacketPlayerLevel - PacketPlayerMap PacketPlayerPosition PacketPlayerQuickKeys PacketPlayerRegionAuthority PacketPlayerRest - PacketPlayerResurrect PacketPlayerShapeshift PacketPlayerSkill PacketPlayerSpeech PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic PacketGUIWindow + PacketPlayerInteraction PacketPlayerInventory PacketPlayerJail PacketPlayerJournal PacketPlayerKillCount PacketPlayerLevel + PacketPlayerMap PacketPlayerMiscellaneous PacketPlayerPosition PacketPlayerQuickKeys PacketPlayerRegionAuthority + PacketPlayerReputation PacketPlayerRest PacketPlayerResurrect PacketPlayerShapeshift PacketPlayerSkill PacketPlayerSpeech + PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic ) add_component_dir (openmw-mp/Packets/World WorldPacket - PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectDelete PacketDoorState PacketObjectLock - PacketObjectMove PacketObjectPlace PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState - PacketObjectTrap PacketMusicPlay PacketVideoPlay PacketScriptLocalShort PacketScriptLocalFloat - PacketScriptMemberShort PacketScriptGlobalShort + PacketConsoleCommand PacketContainer PacketObjectAnimPlay 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/ActorPacketController.cpp b/components/openmw-mp/Controllers/ActorPacketController.cpp index 304717de7..29275b75f 100644 --- a/components/openmw-mp/Controllers/ActorPacketController.cpp +++ b/components/openmw-mp/Controllers/ActorPacketController.cpp @@ -8,6 +8,7 @@ #include "../Packets/Actor/PacketActorCellChange.hpp" #include "../Packets/Actor/PacketActorDeath.hpp" #include "../Packets/Actor/PacketActorEquipment.hpp" +#include "../Packets/Actor/PacketActorInteraction.hpp" #include "../Packets/Actor/PacketActorPosition.hpp" #include "../Packets/Actor/PacketActorStatsDynamic.hpp" #include "../Packets/Actor/PacketActorSpeech.hpp" @@ -36,6 +37,7 @@ mwmp::ActorPacketController::ActorPacketController(RakNet::RakPeerInterface *pee 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/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 85d0c3a8a..9f5cb138d 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -5,15 +5,18 @@ #include "../Packets/Player/PacketGUIBoxes.hpp" #include "../Packets/Player/PacketGUIWindow.hpp" #include "../Packets/Player/PacketLoaded.hpp" +#include "../Packets/Player/PacketCellCreate.hpp" +#include "../Packets/Player/PacketRecordDynamic.hpp" #include "../Packets/Player/PacketGameSettings.hpp" #include "../Packets/Player/PacketGameTime.hpp" #include "../Packets/Player/PacketGameWeather.hpp" #include "../Packets/Player/PacketPlayerActiveSkills.hpp" -#include "../Packets/Player/PacketPlayerBaseInfo.hpp" #include "../Packets/Player/PacketPlayerAnimFlags.hpp" #include "../Packets/Player/PacketPlayerAnimPlay.hpp" #include "../Packets/Player/PacketPlayerAttack.hpp" #include "../Packets/Player/PacketPlayerAttribute.hpp" +#include "../Packets/Player/PacketPlayerBaseInfo.hpp" +#include "../Packets/Player/PacketPlayerBehavior.hpp" #include "../Packets/Player/PacketPlayerBook.hpp" #include "../Packets/Player/PacketPlayerBounty.hpp" #include "../Packets/Player/PacketPlayerCellChange.hpp" @@ -22,15 +25,18 @@ #include "../Packets/Player/PacketPlayerDeath.hpp" #include "../Packets/Player/PacketPlayerEquipment.hpp" #include "../Packets/Player/PacketPlayerFaction.hpp" +#include "../Packets/Player/PacketPlayerInteraction.hpp" #include "../Packets/Player/PacketPlayerInventory.hpp" #include "../Packets/Player/PacketPlayerJail.hpp" #include "../Packets/Player/PacketPlayerJournal.hpp" #include "../Packets/Player/PacketPlayerKillCount.hpp" #include "../Packets/Player/PacketPlayerLevel.hpp" #include "../Packets/Player/PacketPlayerMap.hpp" +#include "../Packets/Player/PacketPlayerMiscellaneous.hpp" #include "../Packets/Player/PacketPlayerPosition.hpp" #include "../Packets/Player/PacketPlayerQuickKeys.hpp" #include "../Packets/Player/PacketPlayerRegionAuthority.hpp" +#include "../Packets/Player/PacketPlayerReputation.hpp" #include "../Packets/Player/PacketPlayerRest.hpp" #include "../Packets/Player/PacketPlayerResurrect.hpp" #include "../Packets/Player/PacketPlayerShapeshift.hpp" @@ -59,34 +65,40 @@ 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); AddPacket(&packets, peer); AddPacket(&packets, peer); - AddPacket(&packets, peer); - AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); 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 661e02f62..1b64767e6 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -3,6 +3,7 @@ #include "../Packets/World/PacketObjectLock.hpp" #include "../Packets/World/PacketObjectMove.hpp" #include "../Packets/World/PacketObjectPlace.hpp" +#include "../Packets/World/PacketObjectReset.hpp" #include "../Packets/World/PacketObjectRotate.hpp" #include "../Packets/World/PacketObjectScale.hpp" #include "../Packets/World/PacketObjectSpawn.hpp" @@ -10,6 +11,7 @@ #include "../Packets/World/PacketObjectTrap.hpp" #include "../Packets/World/PacketContainer.hpp" +#include "../Packets/World/PacketDoorDestination.hpp" #include "../Packets/World/PacketDoorState.hpp" #include "../Packets/World/PacketMusicPlay.hpp" #include "../Packets/World/PacketVideoPlay.hpp" @@ -18,7 +20,9 @@ #include "../Packets/World/PacketScriptLocalShort.hpp" #include "../Packets/World/PacketScriptLocalFloat.hpp" #include "../Packets/World/PacketScriptMemberShort.hpp" +#include "../Packets/World/PacketScriptMemberFloat.hpp" #include "../Packets/World/PacketScriptGlobalShort.hpp" +#include "../Packets/World/PacketScriptGlobalFloat.hpp" #include "WorldPacketController.hpp" @@ -38,6 +42,7 @@ mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *pee AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); @@ -45,6 +50,7 @@ mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *pee AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); @@ -53,7 +59,9 @@ mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *pee 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 bc21e8486..e87272e09 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -23,6 +23,7 @@ enum GameMessages ID_GAME_WEATHER, ID_PLAYER_BASEINFO, + ID_PLAYER_BEHAVIOR, ID_PLAYER_CHARGEN, ID_PLAYER_ACTIVESKILLS, ID_PLAYER_ANIM_FLAGS, @@ -38,15 +39,18 @@ enum GameMessages ID_PLAYER_DISPOSITION, ID_PLAYER_EQUIPMENT, ID_PLAYER_FACTION, + ID_PLAYER_INTERACTION, ID_PLAYER_INVENTORY, ID_PLAYER_JAIL, ID_PLAYER_JOURNAL, ID_PLAYER_KILL_COUNT, ID_PLAYER_LEVEL, ID_PLAYER_MAP, + ID_PLAYER_MISCELLANEOUS, ID_PLAYER_POSITION, ID_PLAYER_QUICKKEYS, ID_PLAYER_REGION_AUTHORITY, + ID_PLAYER_REPUTATION, ID_PLAYER_RESURRECT, ID_PLAYER_REST, ID_PLAYER_SHAPESHIFT, @@ -66,6 +70,7 @@ enum GameMessages ID_ACTOR_CELL_CHANGE, ID_ACTOR_DEATH, ID_ACTOR_EQUIPMENT, + ID_ACTOR_INTERACTION, ID_ACTOR_POSITION, ID_ACTOR_SPEECH, ID_ACTOR_STATS_DYNAMIC, @@ -75,14 +80,19 @@ enum GameMessages ID_OBJECT_LOCK, ID_OBJECT_MOVE, ID_OBJECT_PLACE, + ID_OBJECT_RESET, ID_OBJECT_ROTATE, ID_OBJECT_SCALE, ID_OBJECT_SPAWN, ID_OBJECT_STATE, ID_OBJECT_TRAP, + + ID_CELL_CREATE, + ID_RECORD_DYNAMIC, ID_CONSOLE_COMMAND, ID_CONTAINER, + ID_DOOR_DESTINATION, ID_DOOR_STATE, ID_MUSIC_PLAY, ID_VIDEO_PLAY, @@ -90,7 +100,9 @@ enum GameMessages ID_SCRIPT_LOCAL_SHORT, ID_SCRIPT_LOCAL_FLOAT, ID_SCRIPT_MEMBER_SHORT, + ID_SCRIPT_MEMBER_FLOAT, ID_SCRIPT_GLOBAL_SHORT, + ID_SCRIPT_GLOBAL_FLOAT, ID_GAME_SETTINGS, ID_GAME_PREINIT diff --git a/components/openmw-mp/Packets/Actor/PacketActorInteraction.cpp b/components/openmw-mp/Packets/Actor/PacketActorInteraction.cpp new file mode 100644 index 000000000..0f58a817f --- /dev/null +++ b/components/openmw-mp/Packets/Actor/PacketActorInteraction.cpp @@ -0,0 +1,15 @@ +#include +#include +#include "PacketActorInteraction.hpp" + +using namespace mwmp; + +PacketActorInteraction::PacketActorInteraction(RakNet::RakPeerInterface *peer) : ActorPacket(peer) +{ + packetID = ID_ACTOR_INTERACTION; +} + +void PacketActorInteraction::Actor(BaseActor &actor, bool send) +{ + // Placeholder +} diff --git a/components/openmw-mp/Packets/Actor/PacketActorInteraction.hpp b/components/openmw-mp/Packets/Actor/PacketActorInteraction.hpp new file mode 100644 index 000000000..fecc3382c --- /dev/null +++ b/components/openmw-mp/Packets/Actor/PacketActorInteraction.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETACTORINTERACTION_HPP +#define OPENMW_PACKETACTORINTERACTION_HPP + +#include + +namespace mwmp +{ + class PacketActorInteraction : public ActorPacket + { + public: + PacketActorInteraction(RakNet::RakPeerInterface *peer); + + virtual void Actor(BaseActor &actor, bool send); + }; +} + +#endif //OPENMW_PACKETACTORINTERACTION_HPP diff --git a/components/openmw-mp/Packets/Player/PacketCellCreate.cpp b/components/openmw-mp/Packets/Player/PacketCellCreate.cpp new file mode 100644 index 000000000..8090c6491 --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketCellCreate.cpp @@ -0,0 +1,17 @@ +#include "PacketCellCreate.hpp" +#include + +using namespace mwmp; + +PacketCellCreate::PacketCellCreate(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_CELL_CREATE; + orderChannel = CHANNEL_SYSTEM; +} + +void PacketCellCreate::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Player/PacketCellCreate.hpp b/components/openmw-mp/Packets/Player/PacketCellCreate.hpp new file mode 100644 index 000000000..64bfde32a --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketCellCreate.hpp @@ -0,0 +1,18 @@ +#ifndef OPENMW_PACKETCELLCREATE_HPP +#define OPENMW_PACKETCELLCREATE_HPP + +#include +#include + +namespace mwmp +{ + class PacketCellCreate: public PlayerPacket + { + public: + PacketCellCreate(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETCELLCREATE_HPP diff --git a/components/openmw-mp/Packets/Player/PacketPlayerBehavior.cpp b/components/openmw-mp/Packets/Player/PacketPlayerBehavior.cpp new file mode 100644 index 000000000..72cf5f8ef --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerBehavior.cpp @@ -0,0 +1,16 @@ +#include "PacketPlayerBehavior.hpp" +#include + +using namespace mwmp; + +PacketPlayerBehavior::PacketPlayerBehavior(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_PLAYER_BEHAVIOR; +} + +void PacketPlayerBehavior::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Player/PacketPlayerBehavior.hpp b/components/openmw-mp/Packets/Player/PacketPlayerBehavior.hpp new file mode 100644 index 000000000..2e17f315e --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerBehavior.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETPLAYERBEHAVIOR_HPP +#define OPENMW_PACKETPLAYERBEHAVIOR_HPP + +#include + +namespace mwmp +{ + class PacketPlayerBehavior : public PlayerPacket + { + public: + PacketPlayerBehavior(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETPLAYERBEHAVIOR_HPP diff --git a/components/openmw-mp/Packets/Player/PacketPlayerInteraction.cpp b/components/openmw-mp/Packets/Player/PacketPlayerInteraction.cpp new file mode 100644 index 000000000..fa2edc90f --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerInteraction.cpp @@ -0,0 +1,16 @@ +#include "PacketPlayerInteraction.hpp" +#include + +using namespace mwmp; + +PacketPlayerInteraction::PacketPlayerInteraction(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_PLAYER_INTERACTION; +} + +void PacketPlayerInteraction::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Player/PacketPlayerInteraction.hpp b/components/openmw-mp/Packets/Player/PacketPlayerInteraction.hpp new file mode 100644 index 000000000..7bd6eabac --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerInteraction.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETPLAYERINTERACTION_HPP +#define OPENMW_PACKETPLAYERINTERACTION_HPP + +#include + +namespace mwmp +{ + class PacketPlayerInteraction : public PlayerPacket + { + public: + PacketPlayerInteraction(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETPLAYERINTERACTION_HPP diff --git a/components/openmw-mp/Packets/Player/PacketPlayerMiscellaneous.cpp b/components/openmw-mp/Packets/Player/PacketPlayerMiscellaneous.cpp new file mode 100644 index 000000000..6a6aa40f8 --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerMiscellaneous.cpp @@ -0,0 +1,16 @@ +#include "PacketPlayerMiscellaneous.hpp" +#include + +using namespace mwmp; + +PacketPlayerMiscellaneous::PacketPlayerMiscellaneous(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_PLAYER_MISCELLANEOUS; +} + +void PacketPlayerMiscellaneous::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Player/PacketPlayerMiscellaneous.hpp b/components/openmw-mp/Packets/Player/PacketPlayerMiscellaneous.hpp new file mode 100644 index 000000000..b3c178cba --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerMiscellaneous.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETPLAYERMISCELLANEOUS_HPP +#define OPENMW_PACKETPLAYERMISCELLANEOUS_HPP + +#include + +namespace mwmp +{ + class PacketPlayerMiscellaneous : public PlayerPacket + { + public: + PacketPlayerMiscellaneous(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETPLAYERMISCELLANEOUS_HPP diff --git a/components/openmw-mp/Packets/Player/PacketPlayerReputation.cpp b/components/openmw-mp/Packets/Player/PacketPlayerReputation.cpp new file mode 100644 index 000000000..291846ef9 --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerReputation.cpp @@ -0,0 +1,16 @@ +#include "PacketPlayerReputation.hpp" +#include + +using namespace mwmp; + +PacketPlayerReputation::PacketPlayerReputation(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_PLAYER_REPUTATION; +} + +void PacketPlayerReputation::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Player/PacketPlayerReputation.hpp b/components/openmw-mp/Packets/Player/PacketPlayerReputation.hpp new file mode 100644 index 000000000..d4b8128e4 --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketPlayerReputation.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETPLAYERREPUTATION_HPP +#define OPENMW_PACKETPLAYERREPUTATION_HPP + +#include + +namespace mwmp +{ + class PacketPlayerReputation : public PlayerPacket + { + public: + PacketPlayerReputation(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETPLAYERREPUTATION_HPP diff --git a/components/openmw-mp/Packets/Player/PacketRecordDynamic.cpp b/components/openmw-mp/Packets/Player/PacketRecordDynamic.cpp new file mode 100644 index 000000000..4ed8364eb --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketRecordDynamic.cpp @@ -0,0 +1,17 @@ +#include "PacketRecordDynamic.hpp" +#include + +using namespace mwmp; + +PacketRecordDynamic::PacketRecordDynamic(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) +{ + packetID = ID_RECORD_DYNAMIC; + orderChannel = CHANNEL_SYSTEM; +} + +void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send) +{ + PlayerPacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Player/PacketRecordDynamic.hpp b/components/openmw-mp/Packets/Player/PacketRecordDynamic.hpp new file mode 100644 index 000000000..d58f936c3 --- /dev/null +++ b/components/openmw-mp/Packets/Player/PacketRecordDynamic.hpp @@ -0,0 +1,18 @@ +#ifndef OPENMW_PACKETRECORDDYNAMIC_HPP +#define OPENMW_PACKETRECORDDYNAMIC_HPP + +#include +#include + +namespace mwmp +{ + class PacketRecordDynamic: public PlayerPacket + { + public: + PacketRecordDynamic(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETRECORDDYNAMIC_HPP diff --git a/components/openmw-mp/Packets/World/PacketDoorDestination.cpp b/components/openmw-mp/Packets/World/PacketDoorDestination.cpp new file mode 100644 index 000000000..41f3c2764 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketDoorDestination.cpp @@ -0,0 +1,16 @@ +#include +#include "PacketDoorDestination.hpp" + +using namespace mwmp; + +PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_DOOR_DESTINATION; + hasCellData = true; +} + +void PacketDoorDestination::Object(WorldObject &worldObject, bool send) +{ + WorldPacket::Object(worldObject, send); + // Placeholder +} diff --git a/components/openmw-mp/Packets/World/PacketDoorDestination.hpp b/components/openmw-mp/Packets/World/PacketDoorDestination.hpp new file mode 100644 index 000000000..329476259 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketDoorDestination.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETDOORDESTINATION_HPP +#define OPENMW_PACKETDOORDESTINATION_HPP + +#include + +namespace mwmp +{ + class PacketDoorDestination : public WorldPacket + { + public: + PacketDoorDestination(RakNet::RakPeerInterface *peer); + + virtual void Object(WorldObject &worldObject, bool send); + }; +} + +#endif //OPENMW_PACKETDOORDESTINATION_HPP diff --git a/components/openmw-mp/Packets/World/PacketObjectReset.cpp b/components/openmw-mp/Packets/World/PacketObjectReset.cpp new file mode 100644 index 000000000..7fcce2e39 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectReset.cpp @@ -0,0 +1,16 @@ +#include +#include "PacketObjectReset.hpp" + +using namespace mwmp; + +PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_OBJECT_RESET; + hasCellData = true; +} + +void PacketObjectReset::Object(WorldObject &worldObject, bool send) +{ + WorldPacket::Object(worldObject, send); + // Placeholder +} diff --git a/components/openmw-mp/Packets/World/PacketObjectReset.hpp b/components/openmw-mp/Packets/World/PacketObjectReset.hpp new file mode 100644 index 000000000..58df1e6fb --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectReset.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETOBJECTRESET_HPP +#define OPENMW_PACKETOBJECTRESET_HPP + +#include + +namespace mwmp +{ + class PacketObjectReset : public WorldPacket + { + public: + PacketObjectReset(RakNet::RakPeerInterface *peer); + + virtual void Object(WorldObject &worldObject, bool send); + }; +} + +#endif //OPENMW_PACKETOBJECTRESET_HPP diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.cpp b/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.cpp new file mode 100644 index 000000000..c4a65a267 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.cpp @@ -0,0 +1,15 @@ +#include +#include "PacketScriptGlobalFloat.hpp" + +using namespace mwmp; + +PacketScriptGlobalFloat::PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_SCRIPT_GLOBAL_FLOAT; +} + +void PacketScriptGlobalFloat::Object(WorldObject &worldObject, bool send) +{ + RW(worldObject.varName, send); + RW(worldObject.floatVal, send); +} diff --git a/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.hpp b/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.hpp new file mode 100644 index 000000000..a457ff7dc --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketScriptGlobalFloat.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP +#define OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP + +#include + +namespace mwmp +{ + class PacketScriptGlobalFloat : public WorldPacket + { + public: + PacketScriptGlobalFloat(RakNet::RakPeerInterface *peer); + + virtual void Object(WorldObject &worldObject, bool send); + }; +} + +#endif //OPENMW_PACKETSCRIPTGLOBALFLOAT_HPP diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberFloat.cpp b/components/openmw-mp/Packets/World/PacketScriptMemberFloat.cpp new file mode 100644 index 000000000..61161054d --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketScriptMemberFloat.cpp @@ -0,0 +1,16 @@ +#include +#include "PacketScriptMemberFloat.hpp" + +using namespace mwmp; + +PacketScriptMemberFloat::PacketScriptMemberFloat(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_SCRIPT_MEMBER_FLOAT; +} + +void PacketScriptMemberFloat::Object(WorldObject &worldObject, bool send) +{ + RW(worldObject.refId, send); + RW(worldObject.index, send); + RW(worldObject.floatVal, send); +} diff --git a/components/openmw-mp/Packets/World/PacketScriptMemberFloat.hpp b/components/openmw-mp/Packets/World/PacketScriptMemberFloat.hpp new file mode 100644 index 000000000..2b6f9ae2a --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketScriptMemberFloat.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETSCRIPTMEMBERFLOAT_HPP +#define OPENMW_PACKETSCRIPTMEMBERFLOAT_HPP + +#include + +namespace mwmp +{ + class PacketScriptMemberFloat : public WorldPacket + { + public: + PacketScriptMemberFloat(RakNet::RakPeerInterface *peer); + + virtual void Object(WorldObject &obj, bool send); + }; +} + +#endif //OPENMW_PACKETSCRIPTMEMBERFLOAT_HPP diff --git a/components/sceneutil/optimizer.cpp b/components/sceneutil/optimizer.cpp index e7d5b3a40..b86744599 100644 --- a/components/sceneutil/optimizer.cpp +++ b/components/sceneutil/optimizer.cpp @@ -800,6 +800,13 @@ bool Optimizer::RemoveRedundantNodesVisitor::isOperationPermissible(osg::Node& n isOperationPermissibleForObject(&node); } +void Optimizer::RemoveRedundantNodesVisitor::apply(osg::LOD& lod) +{ + // don't remove any direct children of the LOD because they are used to define each LOD level. + for (unsigned int i=0; i