[General] Turn CellCreate into a Worldstate packet

This commit is contained in:
David Cernat 2018-07-14 23:06:09 +03:00
parent ae55ee7f0b
commit a471f5e452
8 changed files with 22 additions and 25 deletions

View file

@ -112,15 +112,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 ProcessorGameSettings ProcessorGameWeather ProcessorUserDisconnected ProcessorUserMyID ProcessorGameSettings ProcessorGameWeather ProcessorPlayerAnimFlags
ProcessorPlayerAnimFlags ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo ProcessorPlayerAnimPlay ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBaseInfo ProcessorPlayerBehavior
ProcessorPlayerBehavior ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerBook ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerCharClass
ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerDisposition ProcessorPlayerEquipment ProcessorPlayerFaction
ProcessorPlayerFaction ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal ProcessorPlayerInteraction ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal ProcessorPlayerKillCount
ProcessorPlayerKillCount ProcessorPlayerLevel ProcessorPlayerMiscellaneous ProcessorPlayerMomentum ProcessorPlayerLevel ProcessorPlayerMiscellaneous ProcessorPlayerMomentum ProcessorPlayerPosition ProcessorPlayerQuickKeys
ProcessorPlayerPosition ProcessorPlayerQuickKeys ProcessorPlayerReputation ProcessorPlayerResurrect ProcessorPlayerReputation ProcessorPlayerResurrect ProcessorPlayerShapeshift ProcessorPlayerSkill ProcessorPlayerSpeech
ProcessorPlayerShapeshift ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic
ProcessorPlayerTopic
) )
add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleCommand ProcessorContainer
@ -131,8 +130,8 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleComma
ProcessorScriptMemberShort ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat ProcessorScriptMemberShort ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat
) )
add_openmw_dir (mwmp/processors/worldstate ProcessorRecordDynamic ProcessorWorldCollisionOverride ProcessorWorldMap add_openmw_dir (mwmp/processors/worldstate ProcessorCellCreate ProcessorRecordDynamic ProcessorWorldCollisionOverride
ProcessorWorldTime ProcessorWorldMap ProcessorWorldTime
) )
# Main executable # Main executable

View file

@ -5,7 +5,6 @@
#include "player/ProcessorGUIMessageBox.hpp" #include "player/ProcessorGUIMessageBox.hpp"
#include "player/ProcessorHandshake.hpp" #include "player/ProcessorHandshake.hpp"
#include "player/ProcessorUserDisconnected.hpp" #include "player/ProcessorUserDisconnected.hpp"
#include "player/ProcessorCellCreate.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"
@ -89,6 +88,7 @@
#include "actor/ProcessorActorTest.hpp" #include "actor/ProcessorActorTest.hpp"
#include "WorldstateProcessor.hpp" #include "WorldstateProcessor.hpp"
#include "worldstate/ProcessorCellCreate.hpp"
#include "worldstate/ProcessorRecordDynamic.hpp" #include "worldstate/ProcessorRecordDynamic.hpp"
#include "worldstate/ProcessorWorldCollisionOverride.hpp" #include "worldstate/ProcessorWorldCollisionOverride.hpp"
#include "worldstate/ProcessorWorldMap.hpp" #include "worldstate/ProcessorWorldMap.hpp"
@ -102,7 +102,6 @@ void ProcessorInitializer()
PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox()); PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox());
PlayerProcessor::AddProcessor(new ProcessorHandshake()); PlayerProcessor::AddProcessor(new ProcessorHandshake());
PlayerProcessor::AddProcessor(new ProcessorUserDisconnected()); PlayerProcessor::AddProcessor(new ProcessorUserDisconnected());
PlayerProcessor::AddProcessor(new ProcessorCellCreate());
PlayerProcessor::AddProcessor(new ProcessorGameSettings()); PlayerProcessor::AddProcessor(new ProcessorGameSettings());
PlayerProcessor::AddProcessor(new ProcessorGameWeather()); PlayerProcessor::AddProcessor(new ProcessorGameWeather());
PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags());
@ -183,6 +182,7 @@ void ProcessorInitializer()
ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic()); ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic());
ActorProcessor::AddProcessor(new ProcessorActorTest()); ActorProcessor::AddProcessor(new ProcessorActorTest());
WorldstateProcessor::AddProcessor(new ProcessorCellCreate());
WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic()); WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic());
WorldstateProcessor::AddProcessor(new ProcessorWorldCollisionOverride()); WorldstateProcessor::AddProcessor(new ProcessorWorldCollisionOverride());
WorldstateProcessor::AddProcessor(new ProcessorWorldMap()); WorldstateProcessor::AddProcessor(new ProcessorWorldMap());

View file

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

View file

@ -178,8 +178,6 @@ add_component_dir (openmw-mp/Packets/Player
PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketGameWeather PacketHandshake PacketChatMessage PacketGUIBoxes PacketGameSettings PacketGameWeather
PacketCellCreate
PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay
PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty PacketPlayerAttack PacketPlayerAttribute PacketPlayerBehavior PacketPlayerBook PacketPlayerBounty
PacketPlayerCellChange PacketPlayerCellState PacketPlayerClass PacketPlayerDeath PacketPlayerEquipment PacketPlayerCellChange PacketPlayerCellState PacketPlayerClass PacketPlayerDeath PacketPlayerEquipment
@ -203,7 +201,7 @@ add_component_dir (openmw-mp/Packets/Object
add_component_dir (openmw-mp/Packets/Worldstate add_component_dir (openmw-mp/Packets/Worldstate
WorldstatePacket WorldstatePacket
PacketRecordDynamic PacketWorldCollisionOverride PacketWorldMap PacketWorldTime PacketCellCreate PacketRecordDynamic PacketWorldCollisionOverride PacketWorldMap PacketWorldTime
) )
add_component_dir (fallback add_component_dir (fallback

View file

@ -4,7 +4,6 @@
#include "../Packets/Player/PacketHandshake.hpp" #include "../Packets/Player/PacketHandshake.hpp"
#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/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"
@ -60,7 +59,6 @@ mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *p
AddPacket<PacketHandshake>(&packets, peer); AddPacket<PacketHandshake>(&packets, peer);
AddPacket<PacketGUIBoxes>(&packets, peer); AddPacket<PacketGUIBoxes>(&packets, peer);
AddPacket<PacketLoaded>(&packets, peer); AddPacket<PacketLoaded>(&packets, peer);
AddPacket<PacketCellCreate>(&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);

View file

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

View file

@ -3,7 +3,7 @@
using namespace mwmp; using namespace mwmp;
PacketCellCreate::PacketCellCreate(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) PacketCellCreate::PacketCellCreate(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer)
{ {
packetID = ID_CELL_CREATE; packetID = ID_CELL_CREATE;
orderChannel = CHANNEL_SYSTEM; orderChannel = CHANNEL_SYSTEM;
@ -11,7 +11,7 @@ PacketCellCreate::PacketCellCreate(RakNet::RakPeerInterface *peer) : PlayerPacke
void PacketCellCreate::Packet(RakNet::BitStream *bs, bool send) void PacketCellCreate::Packet(RakNet::BitStream *bs, bool send)
{ {
PlayerPacket::Packet(bs, send); WorldstatePacket::Packet(bs, send);
// Placeholder // Placeholder
} }

View file

@ -1,12 +1,12 @@
#ifndef OPENMW_PACKETCELLCREATE_HPP #ifndef OPENMW_PACKETCELLCREATE_HPP
#define OPENMW_PACKETCELLCREATE_HPP #define OPENMW_PACKETCELLCREATE_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 PacketCellCreate: public PlayerPacket class PacketCellCreate: public WorldstatePacket
{ {
public: public:
PacketCellCreate(RakNet::RakPeerInterface *peer); PacketCellCreate(RakNet::RakPeerInterface *peer);