openmw-tes3coop/apps/openmw/mwmp/processors/player/ProcessorUserDisconnected.hpp
David Cernat 27148ce9eb [General] Add placeholders for 12 new packets, to be implemented soon
Additionally, make it slightly clearer who created which previously existing packets.
2017-05-29 04:43:52 +03:00

34 lines
841 B
C++

//
// Created by koncord on 16.04.17.
//
#ifndef OPENMW_PROCESSORUSERDISCONNECTED_HPP
#define OPENMW_PROCESSORUSERDISCONNECTED_HPP
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
#include <apps/openmw/mwbase/environment.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)
PlayerList::disconnectPlayer(guid);
}
};
}
#endif //OPENMW_PROCESSORUSERDISCONNECTED_HPP