[General] Add placeholders for PlayerJail, ObjectState & ConsoleCommand

pull/249/merge
David Cernat 8 years ago
parent 4e74910fdb
commit 3529f9b090

@ -144,10 +144,10 @@ set(PROCESSORS_WORLD
processors/world/ProcessorObjectDelete.hpp processors/world/ProcessorObjectLock.hpp
processors/world/ProcessorObjectMove.hpp processors/world/ProcessorObjectPlace.hpp
processors/world/ProcessorObjectRotate.hpp processors/world/ProcessorObjectScale.hpp
processors/world/ProcessorObjectSpawn.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/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
)
source_group(tes3mp-server\\processors\\world FILES ${PROCESSORS_WORLD})

@ -63,6 +63,7 @@
#include "world/ProcessorObjectRotate.hpp"
#include "world/ProcessorObjectScale.hpp"
#include "world/ProcessorObjectSpawn.hpp"
#include "world/ProcessorObjectState.hpp"
#include "world/ProcessorObjectTrap.hpp"
#include "world/ProcessorScriptLocalShort.hpp"
#include "world/ProcessorScriptLocalFloat.hpp"
@ -130,6 +131,7 @@ void ProcessorInitializer()
WorldProcessor::AddProcessor(new ProcessorObjectRotate());
WorldProcessor::AddProcessor(new ProcessorObjectScale());
WorldProcessor::AddProcessor(new ProcessorObjectSpawn());
WorldProcessor::AddProcessor(new ProcessorObjectState());
WorldProcessor::AddProcessor(new ProcessorObjectTrap());
WorldProcessor::AddProcessor(new ProcessorScriptLocalShort());
WorldProcessor::AddProcessor(new ProcessorScriptLocalFloat());

@ -0,0 +1,27 @@
#ifndef OPENMW_PROCESSOROBJECTSTATE_HPP
#define OPENMW_PROCESSOROBJECTSTATE_HPP
#include "../WorldProcessor.hpp"
namespace mwmp
{
class ProcessorObjectState : public WorldProcessor
{
public:
ProcessorObjectState()
{
BPP_INIT(ID_OBJECT_STATE)
}
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectState")>(player.getId(), event.cell.getDescription().c_str());
}
};
}
#endif //OPENMW_PROCESSOROBJECTSTATE_HPP

@ -111,20 +111,21 @@ add_openmw_dir (mwmp/processors/actor ProcessorActorAI ProcessorActorAnimFlags P
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 ProcessorPlayerInventory
ProcessorPlayerJournal ProcessorPlayerKillCount ProcessorPlayerLevel ProcessorPlayerMap ProcessorPlayerPosition
ProcessorPlayerResurrect ProcessorPlayerSkill ProcessorPlayerSpeech ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic
ProcessorPlayerTopic
)
add_openmw_dir (mwmp/processors/world BaseObjectProcessor ProcessorContainer ProcessorDoorState ProcessorMusicPlay
ProcessorVideoPlay ProcessorObjectAnimPlay ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove
ProcessorObjectPlace ProcessorObjectRotate ProcessorObjectScale ProcessorObjectSpawn ProcessorObjectTrap
ProcessorScriptLocalShort ProcessorScriptLocalFloat ProcessorScriptMemberShort ProcessorScriptGlobalShort
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
ProcessorPlayerInventory ProcessorPlayerJail ProcessorPlayerJournal ProcessorPlayerKillCount ProcessorPlayerLevel
ProcessorPlayerMap ProcessorPlayerPosition ProcessorPlayerResurrect 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
)
# Main executable

@ -29,6 +29,7 @@
#include "player/ProcessorPlayerEquipment.hpp"
#include "player/ProcessorPlayerFaction.hpp"
#include "player/ProcessorPlayerInventory.hpp"
#include "player/ProcessorPlayerJail.hpp"
#include "player/ProcessorPlayerJournal.hpp"
#include "player/ProcessorPlayerKillCount.hpp"
#include "player/ProcessorPlayerLevel.hpp"
@ -44,6 +45,7 @@
#include "player/ProcessorPlayerTopic.hpp"
#include "WorldProcessor.hpp"
#include "world/ProcessorConsoleCommand.hpp"
#include "world/ProcessorContainer.hpp"
#include "world/ProcessorDoorState.hpp"
#include "world/ProcessorMusicPlay.hpp"
@ -55,6 +57,7 @@
#include "world/ProcessorObjectRotate.hpp"
#include "world/ProcessorObjectScale.hpp"
#include "world/ProcessorObjectSpawn.hpp"
#include "world/ProcessorObjectState.hpp"
#include "world/ProcessorObjectTrap.hpp"
#include "world/ProcessorScriptLocalShort.hpp"
#include "world/ProcessorScriptLocalFloat.hpp"

@ -0,0 +1,30 @@
#ifndef OPENMW_PROCESSORPLAYERJAIL_HPP
#define OPENMW_PROCESSORPLAYERJAIL_HPP
#include "../PlayerProcessor.hpp"
#include "apps/openmw/mwmp/Main.hpp"
#include "apps/openmw/mwmp/Networking.hpp"
namespace mwmp
{
class ProcessorPlayerJail : public PlayerProcessor
{
public:
ProcessorPlayerJail()
{
BPP_INIT(ID_PLAYER_JAIL)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_JAIL from server");
if (isLocal())
{
// To be filled in
}
}
};
}
#endif //OPENMW_PROCESSORPLAYERJAIL_HPP

@ -0,0 +1,24 @@
#ifndef OPENMW_PROCESSORCONSOLECOMMAND_HPP
#define OPENMW_PROCESSORCONSOLECOMMAND_HPP
#include "../WorldProcessor.hpp"
namespace mwmp
{
class ProcessorConsoleCommand : public WorldProcessor
{
public:
ProcessorConsoleCommand()
{
BPP_INIT(ID_CONSOLE_COMMAND)
}
virtual void Do(WorldPacket &packet, WorldEvent &event)
{
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
//event.runConsoleCommand();
}
};
}
#endif //OPENMW_PROCESSORCONSOLECOMMAND_HPP

@ -0,0 +1,25 @@
#ifndef OPENMW_PROCESSOROBJECTSTATE_HPP
#define OPENMW_PROCESSOROBJECTSTATE_HPP
#include "BaseObjectProcessor.hpp"
namespace mwmp
{
class ProcessorObjectState : public BaseObjectProcessor
{
public:
ProcessorObjectState()
{
BPP_INIT(ID_OBJECT_STATE)
}
virtual void Do(WorldPacket &packet, WorldEvent &event)
{
BaseObjectProcessor::Do(packet, event);
//event.setObjectStates(ptrCellStore);
}
};
}
#endif //OPENMW_PROCESSOROBJECTSTATE_HPP

@ -180,16 +180,17 @@ add_component_dir (openmw-mp/Packets/Player
PacketPlayerBaseInfo PacketPlayerCharGen PacketPlayerActiveSkills PacketPlayerAnimFlags PacketPlayerAnimPlay
PacketPlayerAttack PacketPlayerAttribute PacketPlayerBook PacketPlayerBounty PacketPlayerCellChange
PacketPlayerCellState PacketPlayerClass PacketPlayerDeath PacketPlayerEquipment PacketPlayerFaction
PacketPlayerInventory PacketPlayerJournal PacketPlayerKillCount PacketPlayerLevel PacketPlayerMap
PacketPlayerPosition PacketPlayerRegionAuthority PacketPlayerRest PacketPlayerResurrect PacketPlayerSkill
PacketPlayerSpeech PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic
PacketPlayerInventory PacketPlayerJail PacketPlayerJournal PacketPlayerKillCount PacketPlayerLevel
PacketPlayerMap PacketPlayerPosition PacketPlayerRegionAuthority PacketPlayerRest PacketPlayerResurrect
PacketPlayerSkill PacketPlayerSpeech PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerTopic
)
add_component_dir (openmw-mp/Packets/World
WorldPacket
PacketContainer PacketObjectAnimPlay PacketObjectDelete PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace
PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectTrap PacketMusicPlay PacketVideoPlay
PacketScriptLocalShort PacketScriptLocalFloat PacketScriptMemberShort PacketScriptGlobalShort
PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectDelete PacketDoorState PacketObjectLock
PacketObjectMove PacketObjectPlace PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState
PacketObjectTrap PacketMusicPlay PacketVideoPlay PacketScriptLocalShort PacketScriptLocalFloat
PacketScriptMemberShort PacketScriptGlobalShort
)
add_component_dir (fallback

@ -253,6 +253,8 @@ namespace mwmp
int deathPenaltyJailDays;
bool ignoreJailTeleportation;
int jailDays;
unsigned int resurrectType;
};
}

@ -22,6 +22,7 @@
#include "../Packets/Player/PacketPlayerEquipment.hpp"
#include "../Packets/Player/PacketPlayerFaction.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"
@ -73,6 +74,7 @@ mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *p
AddPacket<PacketPlayerEquipment>(&packets, peer);
AddPacket<PacketPlayerFaction>(&packets, peer);
AddPacket<PacketPlayerInventory>(&packets, peer);
AddPacket<PacketPlayerJail>(&packets, peer);
AddPacket<PacketPlayerJournal>(&packets, peer);
AddPacket<PacketPlayerKillCount>(&packets, peer);
AddPacket<PacketPlayerLevel>(&packets, peer);

@ -6,6 +6,7 @@
#include "../Packets/World/PacketObjectRotate.hpp"
#include "../Packets/World/PacketObjectScale.hpp"
#include "../Packets/World/PacketObjectSpawn.hpp"
#include "../Packets/World/PacketObjectState.hpp"
#include "../Packets/World/PacketObjectTrap.hpp"
#include "../Packets/World/PacketContainer.hpp"
@ -13,6 +14,7 @@
#include "../Packets/World/PacketMusicPlay.hpp"
#include "../Packets/World/PacketVideoPlay.hpp"
#include "../Packets/World/PacketConsoleCommand.hpp"
#include "../Packets/World/PacketScriptLocalShort.hpp"
#include "../Packets/World/PacketScriptLocalFloat.hpp"
#include "../Packets/World/PacketScriptMemberShort.hpp"
@ -38,6 +40,7 @@ mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *pee
AddPacket<PacketObjectRotate>(&packets, peer);
AddPacket<PacketObjectScale>(&packets, peer);
AddPacket<PacketObjectSpawn>(&packets, peer);
AddPacket<PacketObjectState>(&packets, peer);
AddPacket<PacketObjectTrap>(&packets, peer);
AddPacket<PacketContainer>(&packets, peer);
@ -45,6 +48,7 @@ mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *pee
AddPacket<PacketMusicPlay>(&packets, peer);
AddPacket<PacketVideoPlay>(&packets, peer);
AddPacket<PacketConsoleCommand>(&packets, peer);
AddPacket<PacketScriptLocalShort>(&packets, peer);
AddPacket<PacketScriptLocalFloat>(&packets, peer);
AddPacket<PacketScriptMemberShort>(&packets, peer);

@ -38,6 +38,7 @@ enum GameMessages
ID_PLAYER_EQUIPMENT,
ID_PLAYER_FACTION,
ID_PLAYER_INVENTORY,
ID_PLAYER_JAIL,
ID_PLAYER_JOURNAL,
ID_PLAYER_KILL_COUNT,
ID_PLAYER_LEVEL,
@ -74,8 +75,10 @@ enum GameMessages
ID_OBJECT_ROTATE,
ID_OBJECT_SCALE,
ID_OBJECT_SPAWN,
ID_OBJECT_STATE,
ID_OBJECT_TRAP,
ID_CONSOLE_COMMAND,
ID_CONTAINER,
ID_DOOR_STATE,
ID_MUSIC_PLAY,

@ -0,0 +1,17 @@
#include "PacketPlayerJail.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Log.hpp>
using namespace mwmp;
PacketPlayerJail::PacketPlayerJail(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_PLAYER_JAIL;
}
void PacketPlayerJail::Packet(RakNet::BitStream *bs, bool send)
{
PlayerPacket::Packet(bs, send);
RW(player->jailDays, send);
}

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

@ -0,0 +1,14 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketConsoleCommand.hpp"
using namespace mwmp;
PacketConsoleCommand::PacketConsoleCommand(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_CONSOLE_COMMAND;
}
void PacketConsoleCommand::Object(WorldObject &worldObject, bool send)
{
WorldPacket::Object(worldObject, send);
}

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETCONSOLECOMMAND_HPP
#define OPENMW_PACKETCONSOLECOMMAND_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
namespace mwmp
{
class PacketConsoleCommand : public WorldPacket
{
public:
PacketConsoleCommand(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &obj, bool send);
};
}
#endif //OPENMW_PACKETCONSOLECOMMAND_HPP

@ -0,0 +1,10 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketObjectState.hpp"
using namespace mwmp;
PacketObjectState::PacketObjectState(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_OBJECT_STATE;
hasCellData = true;
}

@ -0,0 +1,15 @@
#ifndef OPENMW_PACKETOBJECTSTATE_HPP
#define OPENMW_PACKETOBJECTSTATE_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
namespace mwmp
{
class PacketObjectState : public WorldPacket
{
public:
PacketObjectState(RakNet::RakPeerInterface *peer);
};
}
#endif //OPENMW_PACKETOBJECTSTATE_HPP
Loading…
Cancel
Save