2017-10-25 04:21:00 +00:00
|
|
|
#ifndef OPENMW_PROCESSORPLAYERQUICKKEYS_HPP
|
|
|
|
#define OPENMW_PROCESSORPLAYERQUICKKEYS_HPP
|
|
|
|
|
|
|
|
|
|
|
|
#include "../PlayerProcessor.hpp"
|
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2019-10-24 19:16:17 +00:00
|
|
|
class ProcessorPlayerQuickKeys final: public PlayerProcessor
|
2017-10-25 04:21:00 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorPlayerQuickKeys()
|
|
|
|
{
|
|
|
|
BPP_INIT(ID_PLAYER_QUICKKEYS)
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
|
|
{
|
|
|
|
if (!isLocal()) return;
|
|
|
|
|
2019-08-19 18:39:33 +00:00
|
|
|
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_PLAYER_QUICKKEYS about LocalPlayer from server");
|
2017-10-25 04:21:00 +00:00
|
|
|
|
|
|
|
if (!isRequest())
|
|
|
|
{
|
|
|
|
LocalPlayer &localPlayer = static_cast<LocalPlayer&>(*player);
|
2018-08-28 02:01:52 +00:00
|
|
|
|
|
|
|
// Because we send PlayerQuickKeys packets from the same OpenMW methods that we use to set the
|
|
|
|
// quick keys received, we need to set a boolean to prevent resending the keys set here
|
|
|
|
localPlayer.isReceivingQuickKeys = true;
|
|
|
|
|
2017-10-25 04:21:00 +00:00
|
|
|
localPlayer.setQuickKeys();
|
2018-08-28 02:01:52 +00:00
|
|
|
|
|
|
|
localPlayer.isReceivingQuickKeys = false;
|
2017-10-25 04:21:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERQUICKKEYS_HPP
|