mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:53:51 +00:00
141eb8b7c2
Additionally, delete DedicatedPlayers who disconnect. Previously, all disconnected DedicatedPlayers were still kept in memory, but never used again. There was code that suggested they were meant to be reused upon reconnecting, but that reuse had never actually been implemented, and would probably not be that useful anyway.
34 lines
823 B
C++
34 lines
823 B
C++
//
|
|
// Created by koncord on 16.04.17.
|
|
//
|
|
|
|
#ifndef OPENMW_PROCESSORUSERDISCONNECTED_HPP
|
|
#define OPENMW_PROCESSORUSERDISCONNECTED_HPP
|
|
|
|
|
|
#include "../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::deletePlayer(guid);
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSORUSERDISCONNECTED_HPP
|