[General] Rename GameTime packet into WorldTime

pull/437/head
David Cernat 7 years ago
parent 296c69d788
commit da66face25

@ -23,8 +23,8 @@ void WorldstateFunctions::SetHour(unsigned short pid, double hour) noexcept
writeWorldstate.month = -1; writeWorldstate.month = -1;
writeWorldstate.day = -1; writeWorldstate.day = -1;
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_GAME_TIME)->setWorldstate(&writeWorldstate); mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_GAME_TIME)->Send(false); mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
} }
void WorldstateFunctions::SetMonth(unsigned short pid, int month) noexcept void WorldstateFunctions::SetMonth(unsigned short pid, int month) noexcept
@ -38,8 +38,8 @@ void WorldstateFunctions::SetMonth(unsigned short pid, int month) noexcept
writeWorldstate.month = month; writeWorldstate.month = month;
writeWorldstate.day = -1; writeWorldstate.day = -1;
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_GAME_TIME)->setWorldstate(&writeWorldstate); mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_GAME_TIME)->Send(false); mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
} }
@ -54,6 +54,6 @@ void WorldstateFunctions::SetDay(unsigned short pid, int day) noexcept
writeWorldstate.month = -1; writeWorldstate.month = -1;
writeWorldstate.day = day; writeWorldstate.day = day;
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_GAME_TIME)->setWorldstate(&writeWorldstate); mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->setWorldstate(&writeWorldstate);
mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_GAME_TIME)->Send(false); mwmp::Networking::get().getWorldstatePacketController()->GetPacket(ID_WORLD_TIME)->Send(false);
} }

@ -13,7 +13,7 @@ class WorldstateFunctions
public: public:
/** /**
* \brief Set the game hour for a player and send a GameTime packet to that player. * \brief Set the game hour for a player and send a WorldTime packet to that player.
* *
* \param pid The player ID. * \param pid The player ID.
* \param hour The hour. * \param hour The hour.
@ -22,7 +22,7 @@ public:
static void SetHour(unsigned short pid, double hour) noexcept; static void SetHour(unsigned short pid, double hour) noexcept;
/** /**
* \brief Set the game month for a player and send a GameTime packet to that player. * \brief Set the game month for a player and send a WorldTime packet to that player.
* *
* \param pid The player ID. * \param pid The player ID.
* \param month The month. * \param month The month.
@ -31,7 +31,7 @@ public:
static void SetMonth(unsigned short pid, int month) noexcept; static void SetMonth(unsigned short pid, int month) noexcept;
/** /**
* \brief Set the game day for a player and send a GameTime packet to that player. * \brief Set the game day for a player and send a WorldTime packet to that player.
* *
* \param pid The player ID. * \param pid The player ID.
* \param day The day. * \param day The day.

@ -133,7 +133,7 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleComma
ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat
) )
add_openmw_dir (mwmp/processors/worldstate ProcessorGameTime add_openmw_dir (mwmp/processors/worldstate ProcessorWorldTime
) )
# Main executable # Main executable

@ -91,7 +91,7 @@
#include "actor/ProcessorActorTest.hpp" #include "actor/ProcessorActorTest.hpp"
#include "WorldstateProcessor.hpp" #include "WorldstateProcessor.hpp"
#include "worldstate/ProcessorGameTime.hpp" #include "worldstate/ProcessorWorldTime.hpp"
using namespace mwmp; using namespace mwmp;
@ -184,5 +184,5 @@ void ProcessorInitializer()
ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic()); ActorProcessor::AddProcessor(new ProcessorActorStatsDynamic());
ActorProcessor::AddProcessor(new ProcessorActorTest()); ActorProcessor::AddProcessor(new ProcessorActorTest());
WorldstateProcessor::AddProcessor(new ProcessorGameTime()); WorldstateProcessor::AddProcessor(new ProcessorWorldTime());
} }

@ -1,5 +1,5 @@
#ifndef OPENMW_PROCESSORGAMETIME_HPP #ifndef OPENMW_PROCESSORWORLDTIME_HPP
#define OPENMW_PROCESSORGAMETIME_HPP #define OPENMW_PROCESSORWORLDTIME_HPP
#include <apps/openmw/mwbase/world.hpp> #include <apps/openmw/mwbase/world.hpp>
@ -8,12 +8,12 @@
namespace mwmp namespace mwmp
{ {
class ProcessorGameTime : public WorldstateProcessor class ProcessorWorldTime : public WorldstateProcessor
{ {
public: public:
ProcessorGameTime() ProcessorWorldTime()
{ {
BPP_INIT(ID_GAME_TIME) BPP_INIT(ID_WORLD_TIME)
} }
virtual void Do(WorldstatePacket &packet, BaseWorldstate &worldstate) virtual void Do(WorldstatePacket &packet, BaseWorldstate &worldstate)
@ -34,4 +34,4 @@ namespace mwmp
#endif //OPENMW_PROCESSORGAMETIME_HPP #endif //OPENMW_PROCESSORWORLDTIME_HPP

@ -198,7 +198,7 @@ add_component_dir (openmw-mp/Packets/Object
add_component_dir (openmw-mp/Packets/Worldstate add_component_dir (openmw-mp/Packets/Worldstate
WorldstatePacket WorldstatePacket
PacketGameTime PacketWorldTime
) )
add_component_dir (fallback add_component_dir (fallback

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

@ -18,7 +18,7 @@ enum GameMessages
ID_LOADED, ID_LOADED,
ID_GUI_MESSAGEBOX, ID_GUI_MESSAGEBOX,
ID_GAME_TIME, ID_WORLD_TIME,
ID_GAME_WEATHER, ID_GAME_WEATHER,
ID_PLAYER_BASEINFO, ID_PLAYER_BASEINFO,

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

@ -1,15 +1,15 @@
#include "PacketGameTime.hpp" #include "PacketWorldTime.hpp"
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
using namespace mwmp; using namespace mwmp;
PacketGameTime::PacketGameTime(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer) PacketWorldTime::PacketWorldTime(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer)
{ {
packetID = ID_GAME_TIME; packetID = ID_WORLD_TIME;
orderChannel = CHANNEL_SYSTEM; orderChannel = CHANNEL_SYSTEM;
} }
void PacketGameTime::Packet(RakNet::BitStream *bs, bool send) void PacketWorldTime::Packet(RakNet::BitStream *bs, bool send)
{ {
WorldstatePacket::Packet(bs, send); WorldstatePacket::Packet(bs, send);

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETWORLDTIME_HPP
#define OPENMW_PACKETWORLDTIME_HPP
#include <components/openmw-mp/Packets/Worldstate/WorldstatePacket.hpp>
namespace mwmp
{
class PacketWorldTime : public WorldstatePacket
{
public:
PacketWorldTime(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send);
};
}
#endif //OPENMW_PACKETWORLDTIME_HPP
Loading…
Cancel
Save