forked from mirror/openmw-tes3mp
[General] Add placeholders for PlayerJail, ObjectState & ConsoleCommand
parent
4e74910fdb
commit
3529f9b090
@ -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
|
@ -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
|
@ -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…
Reference in New Issue