2017-07-10 09:33:53 +00:00
|
|
|
#ifndef OPENMW_PROCESSORPLAYERJAIL_HPP
|
|
|
|
#define OPENMW_PROCESSORPLAYERJAIL_HPP
|
|
|
|
|
2017-07-11 10:34:09 +00:00
|
|
|
#include "apps/openmw/mwbase/environment.hpp"
|
|
|
|
#include "apps/openmw/mwgui/windowmanagerimp.hpp"
|
|
|
|
|
2017-07-10 09:33:53 +00:00
|
|
|
#include "../PlayerProcessor.hpp"
|
|
|
|
#include "apps/openmw/mwmp/Main.hpp"
|
|
|
|
#include "apps/openmw/mwmp/Networking.hpp"
|
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2019-10-24 19:16:17 +00:00
|
|
|
class ProcessorPlayerJail final: public PlayerProcessor
|
2017-07-10 09:33:53 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorPlayerJail()
|
|
|
|
{
|
|
|
|
BPP_INIT(ID_PLAYER_JAIL)
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
|
|
|
{
|
2019-08-19 18:39:33 +00:00
|
|
|
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_PLAYER_JAIL from server");
|
2017-07-10 09:33:53 +00:00
|
|
|
|
|
|
|
if (isLocal())
|
|
|
|
{
|
2017-07-11 10:34:09 +00:00
|
|
|
// Apply death penalties
|
|
|
|
if (player->jailDays > 0)
|
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWindowManager()->goToJail(player->jailDays);
|
|
|
|
}
|
2017-07-10 09:33:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_PROCESSORPLAYERJAIL_HPP
|