[General] Turn RecordDynamic into a Worldstate packet

0.6.3
David Cernat 7 years ago
parent 031a80ed5a
commit 0be6de6607

@ -123,23 +123,22 @@ source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR})
set(PROCESSORS_PLAYER set(PROCESSORS_PLAYER
processors/player/ProcessorChatMsg.hpp processors/player/ProcessorGUIMessageBox.hpp processors/player/ProcessorChatMsg.hpp processors/player/ProcessorGUIMessageBox.hpp
processors/player/ProcessorRecordDynamic.hpp processors/player/ProcessorGameWeather.hpp processors/player/ProcessorGameWeather.hpp processors/player/ProcessorPlayerAnimFlags.hpp
processors/player/ProcessorPlayerAnimFlags.hpp processors/player/ProcessorPlayerAnimPlay.hpp processors/player/ProcessorPlayerAnimPlay.hpp processors/player/ProcessorPlayerAttack.hpp
processors/player/ProcessorPlayerAttack.hpp processors/player/ProcessorPlayerAttribute.hpp processors/player/ProcessorPlayerAttribute.hpp processors/player/ProcessorPlayerBook.hpp
processors/player/ProcessorPlayerBook.hpp processors/player/ProcessorPlayerBounty.hpp processors/player/ProcessorPlayerBounty.hpp processors/player/ProcessorPlayerCellChange.hpp
processors/player/ProcessorPlayerCellChange.hpp processors/player/ProcessorPlayerCellState.hpp processors/player/ProcessorPlayerCellState.hpp processors/player/ProcessorPlayerCharClass.hpp
processors/player/ProcessorPlayerCharClass.hpp processors/player/ProcessorPlayerCharGen.hpp processors/player/ProcessorPlayerCharGen.hpp processors/player/ProcessorPlayerDeath.hpp
processors/player/ProcessorPlayerDeath.hpp processors/player/ProcessorPlayerDisposition.hpp processors/player/ProcessorPlayerDisposition.hpp processors/player/ProcessorPlayerEquipment.hpp
processors/player/ProcessorPlayerEquipment.hpp processors/player/ProcessorPlayerFaction.hpp processors/player/ProcessorPlayerFaction.hpp processors/player/ProcessorPlayerInteraction.hpp
processors/player/ProcessorPlayerInteraction.hpp processors/player/ProcessorPlayerInventory.hpp processors/player/ProcessorPlayerInventory.hpp processors/player/ProcessorPlayerJournal.hpp
processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerKillCount.hpp processors/player/ProcessorPlayerKillCount.hpp processors/player/ProcessorPlayerLevel.hpp
processors/player/ProcessorPlayerLevel.hpp processors/player/ProcessorPlayerMap.hpp processors/player/ProcessorPlayerMap.hpp processors/player/ProcessorPlayerMiscellaneous.hpp
processors/player/ProcessorPlayerMiscellaneous.hpp processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerQuickKeys.hpp
processors/player/ProcessorPlayerQuickKeys.hpp processors/player/ProcessorPlayerRest.hpp processors/player/ProcessorPlayerRest.hpp processors/player/ProcessorPlayerResurrect.hpp
processors/player/ProcessorPlayerResurrect.hpp processors/player/ProcessorPlayerShapeshift.hpp processors/player/ProcessorPlayerShapeshift.hpp processors/player/ProcessorPlayerSkill.hpp
processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerSpeech.hpp processors/player/ProcessorPlayerSpeech.hpp processors/player/ProcessorPlayerSpellbook.hpp
processors/player/ProcessorPlayerSpellbook.hpp processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerTopic.hpp
processors/player/ProcessorPlayerTopic.hpp
) )
source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER}) source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER})
@ -159,6 +158,12 @@ set(PROCESSORS_OBJECT
source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT}) source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT})
set(PROCESSORS_WORLDSTATE
processors/worldstate/ProcessorRecordDynamic.hpp
)
source_group(tes3mp-server\\processors\\worldstate FILES ${PROCESSORS_WORLDSTATE})
set(PROCESSORS set(PROCESSORS
processors/ProcessorInitializer.cpp processors/ProcessorInitializer.cpp
processors/PlayerProcessor.cpp processors/PlayerProcessor.cpp

@ -1,7 +1,3 @@
//
// Created by koncord on 31.03.17.
//
#include "ProcessorInitializer.hpp" #include "ProcessorInitializer.hpp"
#include "Networking.hpp" #include "Networking.hpp"
@ -11,7 +7,6 @@
#include "player/ProcessorChatMsg.hpp" #include "player/ProcessorChatMsg.hpp"
#include "player/ProcessorGUIMessageBox.hpp" #include "player/ProcessorGUIMessageBox.hpp"
#include "player/ProcessorGameWeather.hpp" #include "player/ProcessorGameWeather.hpp"
#include "player/ProcessorRecordDynamic.hpp"
#include "player/ProcessorPlayerCharGen.hpp" #include "player/ProcessorPlayerCharGen.hpp"
#include "player/ProcessorPlayerAnimFlags.hpp" #include "player/ProcessorPlayerAnimFlags.hpp"
#include "player/ProcessorPlayerAnimPlay.hpp" #include "player/ProcessorPlayerAnimPlay.hpp"
@ -79,7 +74,8 @@
#include "object/ProcessorScriptGlobalShort.hpp" #include "object/ProcessorScriptGlobalShort.hpp"
#include "object/ProcessorScriptGlobalFloat.hpp" #include "object/ProcessorScriptGlobalFloat.hpp"
#include "object/ProcessorVideoPlay.hpp" #include "object/ProcessorVideoPlay.hpp"
#include "WorldstateProcessor.hpp"
#include "worldstate/ProcessorRecordDynamic.hpp"
using namespace mwmp; using namespace mwmp;
@ -88,7 +84,6 @@ void ProcessorInitializer()
PlayerProcessor::AddProcessor(new ProcessorChatMsg()); PlayerProcessor::AddProcessor(new ProcessorChatMsg());
PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox()); PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox());
PlayerProcessor::AddProcessor(new ProcessorGameWeather()); PlayerProcessor::AddProcessor(new ProcessorGameWeather());
PlayerProcessor::AddProcessor(new ProcessorRecordDynamic());
PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen()); PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimPlay()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimPlay());
@ -156,4 +151,6 @@ void ProcessorInitializer()
ObjectProcessor::AddProcessor(new ProcessorScriptGlobalShort()); ObjectProcessor::AddProcessor(new ProcessorScriptGlobalShort());
ObjectProcessor::AddProcessor(new ProcessorScriptGlobalFloat()); ObjectProcessor::AddProcessor(new ProcessorScriptGlobalFloat());
ObjectProcessor::AddProcessor(new ProcessorVideoPlay()); ObjectProcessor::AddProcessor(new ProcessorVideoPlay());
WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic());
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PROCESSORRECORDDYNAMIC_HPP #ifndef OPENMW_PROCESSORRECORDDYNAMIC_HPP
#define OPENMW_PROCESSORRECORDDYNAMIC_HPP #define OPENMW_PROCESSORRECORDDYNAMIC_HPP
#include "../PlayerProcessor.hpp" #include "../WorldstateProcessor.hpp"
namespace mwmp namespace mwmp
{ {
class ProcessorRecordDynamic : public PlayerProcessor class ProcessorRecordDynamic : public WorldstateProcessor
{ {
public: public:
ProcessorRecordDynamic() ProcessorRecordDynamic()
@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_RECORD_DYNAMIC) BPP_INIT(ID_RECORD_DYNAMIC)
} }
void Do(PlayerPacket &packet, Player &player) override void Do(WorldstatePacket &packet, Player &player, BaseWorldstate &worldstate) override
{ {
DEBUG_PRINTF(strPacketID.c_str()); DEBUG_PRINTF(strPacketID.c_str());

@ -114,15 +114,14 @@ add_openmw_dir (mwmp/processors/actor ProcessorActorAI ProcessorActorAnimFlags P
) )
add_openmw_dir (mwmp/processors/player ProcessorChatMessage ProcessorGUIMessageBox ProcessorHandshake add_openmw_dir (mwmp/processors/player ProcessorChatMessage ProcessorGUIMessageBox ProcessorHandshake
ProcessorUserDisconnected ProcessorUserMyID ProcessorCellCreate ProcessorRecordDynamic ProcessorGameSettings ProcessorUserDisconnected ProcessorUserMyID ProcessorCellCreate ProcessorGameSettings ProcessorGameWeather
ProcessorGameWeather ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo
ProcessorPlayerBaseInfo ProcessorPlayerBehavior ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerBehavior ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState
ProcessorPlayerCellState ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment
ProcessorPlayerEquipment ProcessorPlayerFaction ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerFaction ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal
ProcessorPlayerJournal ProcessorPlayerKillCount ProcessorPlayerLevel ProcessorPlayerMap ProcessorPlayerMiscellaneous ProcessorPlayerKillCount ProcessorPlayerLevel ProcessorPlayerMap ProcessorPlayerMiscellaneous ProcessorPlayerMomentum
ProcessorPlayerMomentum ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerReputation ProcessorPlayerResurrect ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerReputation ProcessorPlayerResurrect ProcessorPlayerShapeshift
ProcessorPlayerShapeshift ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic
ProcessorPlayerTopic
) )
add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer ProcessorDoorDestination add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer ProcessorDoorDestination
@ -133,7 +132,7 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleComma
ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat
) )
add_openmw_dir (mwmp/processors/worldstate ProcessorWorldTime add_openmw_dir (mwmp/processors/worldstate ProcessorRecordDynamic ProcessorWorldTime
) )
# Main executable # Main executable

@ -6,7 +6,6 @@
#include "player/ProcessorHandshake.hpp" #include "player/ProcessorHandshake.hpp"
#include "player/ProcessorUserDisconnected.hpp" #include "player/ProcessorUserDisconnected.hpp"
#include "player/ProcessorCellCreate.hpp" #include "player/ProcessorCellCreate.hpp"
#include "player/ProcessorRecordDynamic.hpp"
#include "player/ProcessorGameSettings.hpp" #include "player/ProcessorGameSettings.hpp"
#include "player/ProcessorGameWeather.hpp" #include "player/ProcessorGameWeather.hpp"
#include "player/ProcessorPlayerAnimFlags.hpp" #include "player/ProcessorPlayerAnimFlags.hpp"
@ -91,6 +90,7 @@
#include "actor/ProcessorActorTest.hpp" #include "actor/ProcessorActorTest.hpp"
#include "WorldstateProcessor.hpp" #include "WorldstateProcessor.hpp"
#include "worldstate/ProcessorRecordDynamic.hpp"
#include "worldstate/ProcessorWorldTime.hpp" #include "worldstate/ProcessorWorldTime.hpp"
using namespace mwmp; using namespace mwmp;
@ -102,7 +102,6 @@ void ProcessorInitializer()
PlayerProcessor::AddProcessor(new ProcessorHandshake()); PlayerProcessor::AddProcessor(new ProcessorHandshake());
PlayerProcessor::AddProcessor(new ProcessorUserDisconnected()); PlayerProcessor::AddProcessor(new ProcessorUserDisconnected());
PlayerProcessor::AddProcessor(new ProcessorCellCreate()); PlayerProcessor::AddProcessor(new ProcessorCellCreate());
PlayerProcessor::AddProcessor(new ProcessorRecordDynamic());
PlayerProcessor::AddProcessor(new ProcessorGameSettings()); PlayerProcessor::AddProcessor(new ProcessorGameSettings());
PlayerProcessor::AddProcessor(new ProcessorGameWeather()); PlayerProcessor::AddProcessor(new ProcessorGameWeather());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags());
@ -184,5 +183,6 @@ void ProcessorInitializer()
ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic()); ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic());
ActorProcessor::AddProcessor(new ProcessorActorTest()); ActorProcessor::AddProcessor(new ProcessorActorTest());
WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic());
WorldstateProcessor::AddProcessor(new ProcessorWorldTime()); WorldstateProcessor::AddProcessor(new ProcessorWorldTime());
} }

@ -1,11 +1,11 @@
#ifndef OPENMW_PROCESSORRECORDDYNAMIC_HPP #ifndef OPENMW_PROCESSORRECORDDYNAMIC_HPP
#define OPENMW_PROCESSORRECORDDYNAMIC_HPP #define OPENMW_PROCESSORRECORDDYNAMIC_HPP
#include "../PlayerProcessor.hpp" #include "../WorldstateProcessor.hpp"
namespace mwmp namespace mwmp
{ {
class ProcessorRecordDynamic : public PlayerProcessor class ProcessorRecordDynamic : public WorldstateProcessor
{ {
public: public:
ProcessorRecordDynamic() ProcessorRecordDynamic()
@ -13,7 +13,7 @@ namespace mwmp
BPP_INIT(ID_RECORD_DYNAMIC) BPP_INIT(ID_RECORD_DYNAMIC)
} }
virtual void Do(PlayerPacket &packet, BasePlayer *player) virtual void Do(WorldstatePacket &packet, BaseWorldstate &worldstate)
{ {
// Placeholder // Placeholder
} }

@ -167,6 +167,7 @@ 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 PacketActorAI PacketActorAnimFlags PacketActorAnimPlay PacketActorList PacketActorAuthority PacketActorTest PacketActorAI PacketActorAnimFlags PacketActorAnimPlay
PacketActorAttack PacketActorCellChange PacketActorDeath PacketActorEquipment PacketActorInteraction PacketActorPosition PacketActorAttack PacketActorCellChange PacketActorDeath PacketActorEquipment PacketActorInteraction PacketActorPosition
PacketActorSpeech PacketActorStatsDynamic PacketActorSpeech PacketActorStatsDynamic
@ -174,9 +175,10 @@ add_component_dir (openmw-mp/Packets/Actor
add_component_dir (openmw-mp/Packets/Player add_component_dir (openmw-mp/Packets/Player
PlayerPacket PlayerPacket
PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketGameWeather PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketGameWeather
PacketCellCreate PacketRecordDynamic PacketCellCreate
PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay
PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty
@ -189,6 +191,7 @@ add_component_dir (openmw-mp/Packets/Player
add_component_dir (openmw-mp/Packets/Object add_component_dir (openmw-mp/Packets/Object
ObjectPacket ObjectPacket
PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision
PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace
PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap
@ -198,7 +201,8 @@ add_component_dir (openmw-mp/Packets/Object
add_component_dir (openmw-mp/Packets/Worldstate add_component_dir (openmw-mp/Packets/Worldstate
WorldstatePacket WorldstatePacket
PacketWorldTime
PacketRecordDynamic PacketWorldTime
) )
add_component_dir (fallback add_component_dir (fallback

@ -5,7 +5,6 @@
#include "../Packets/Player/PacketGUIBoxes.hpp" #include "../Packets/Player/PacketGUIBoxes.hpp"
#include "../Packets/Player/PacketLoaded.hpp" #include "../Packets/Player/PacketLoaded.hpp"
#include "../Packets/Player/PacketCellCreate.hpp" #include "../Packets/Player/PacketCellCreate.hpp"
#include "../Packets/Player/PacketRecordDynamic.hpp"
#include "../Packets/Player/PacketGameSettings.hpp" #include "../Packets/Player/PacketGameSettings.hpp"
#include "../Packets/Player/PacketGameWeather.hpp" #include "../Packets/Player/PacketGameWeather.hpp"
#include "../Packets/Player/PacketPlayerActiveSkills.hpp" #include "../Packets/Player/PacketPlayerActiveSkills.hpp"
@ -63,7 +62,6 @@ mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *p
AddPacket<PacketGUIBoxes>(&packets, peer); AddPacket<PacketGUIBoxes>(&packets, peer);
AddPacket<PacketLoaded>(&packets, peer); AddPacket<PacketLoaded>(&packets, peer);
AddPacket<PacketCellCreate>(&packets, peer); AddPacket<PacketCellCreate>(&packets, peer);
AddPacket<PacketRecordDynamic>(&packets, peer);
AddPacket<PacketGameSettings>(&packets, peer); AddPacket<PacketGameSettings>(&packets, peer);
AddPacket<PacketGameWeather>(&packets, peer); AddPacket<PacketGameWeather>(&packets, peer);
AddPacket<PacketPlayerActiveSkills>(&packets, peer); AddPacket<PacketPlayerActiveSkills>(&packets, peer);

@ -1,3 +1,4 @@
#include "../Packets/Worldstate/PacketRecordDynamic.hpp"
#include "../Packets/Worldstate/PacketWorldTime.hpp" #include "../Packets/Worldstate/PacketWorldTime.hpp"
#include "WorldstatePacketController.hpp" #include "WorldstatePacketController.hpp"
@ -12,6 +13,7 @@ inline void AddPacket(mwmp::WorldstatePacketController::packets_t *packets, RakN
mwmp::WorldstatePacketController::WorldstatePacketController(RakNet::RakPeerInterface *peer) mwmp::WorldstatePacketController::WorldstatePacketController(RakNet::RakPeerInterface *peer)
{ {
AddPacket<PacketRecordDynamic>(&packets, peer);
AddPacket<PacketWorldTime>(&packets, peer); AddPacket<PacketWorldTime>(&packets, peer);
} }

@ -3,15 +3,15 @@
using namespace mwmp; using namespace mwmp;
PacketRecordDynamic::PacketRecordDynamic(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) PacketRecordDynamic::PacketRecordDynamic(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer)
{ {
packetID = ID_RECORD_DYNAMIC; packetID = ID_RECORD_DYNAMIC;
orderChannel = CHANNEL_SYSTEM; orderChannel = CHANNEL_WORLDSTATE;
} }
void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send) void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
{ {
PlayerPacket::Packet(bs, send); WorldstatePacket::Packet(bs, send);
// Placeholder // Placeholder
} }

@ -1,12 +1,12 @@
#ifndef OPENMW_PACKETRECORDDYNAMIC_HPP #ifndef OPENMW_PACKETRECORDDYNAMIC_HPP
#define OPENMW_PACKETRECORDDYNAMIC_HPP #define OPENMW_PACKETRECORDDYNAMIC_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp> #include <components/openmw-mp/Packets/Worldstate/WorldstatePacket.hpp>
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
namespace mwmp namespace mwmp
{ {
class PacketRecordDynamic: public PlayerPacket class PacketRecordDynamic: public WorldstatePacket
{ {
public: public:
PacketRecordDynamic(RakNet::RakPeerInterface *peer); PacketRecordDynamic(RakNet::RakPeerInterface *peer);
Loading…
Cancel
Save