openmw-tes3coop/apps/openmw/mwmp/processors/player/ProcessorUserDisconnected.hpp

34 lines
795 B
C++
Raw Normal View History

2017-04-16 07:00:25 +00:00
//
// Created by koncord on 16.04.17.
//
#ifndef OPENMW_PROCESSORUSERDISCONNECTED_HPP
#define OPENMW_PROCESSORUSERDISCONNECTED_HPP
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
#include "apps/openmw/mwstate/statemanagerimp.hpp"
namespace mwmp
{
class ProcessorUserDisconnected : public PlayerProcessor
{
public:
ProcessorUserDisconnected()
{
BPP_INIT(ID_USER_DISCONNECTED)
avoidReading = true;
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
MWBase::Environment::get().getStateManager()->requestQuit();
else if (player != 0)
2017-04-18 04:17:58 +00:00
PlayerList::disconnectPlayer(guid);
2017-04-16 07:00:25 +00:00
}
};
}
#endif //OPENMW_PROCESSORUSERDISCONNECTED_HPP