[Client] Simplify Processors
parent
cc2250815d
commit
67aba35d37
@ -0,0 +1,18 @@
|
||||
//
|
||||
// Created by koncord on 18.04.17.
|
||||
//
|
||||
|
||||
#include "BaseClientPacketProcessor.hpp"
|
||||
#include "Main.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
RakNet::RakNetGUID BaseClientPacketProcessor::guid;
|
||||
RakNet::RakNetGUID BaseClientPacketProcessor::myGuid;
|
||||
RakNet::SystemAddress BaseClientPacketProcessor::serverAddr;
|
||||
bool BaseClientPacketProcessor::request;
|
||||
|
||||
LocalPlayer *BaseClientPacketProcessor::getLocalPlayer()
|
||||
{
|
||||
return Main::get().getLocalPlayer();
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
//
|
||||
// Created by koncord on 18.04.17.
|
||||
//
|
||||
|
||||
#ifndef OPENMW_BASECLIENTPACKETPROCESSOR_HPP
|
||||
#define OPENMW_BASECLIENTPACKETPROCESSOR_HPP
|
||||
|
||||
#include <components/openmw-mp/Base/BasePacketProcessor.hpp>
|
||||
#include "LocalPlayer.hpp"
|
||||
#include "DedicatedPlayer.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class BaseClientPacketProcessor : public BasePacketProcessor
|
||||
{
|
||||
public:
|
||||
static void SetServerAddr(RakNet::SystemAddress addr)
|
||||
{
|
||||
serverAddr = addr;
|
||||
}
|
||||
|
||||
protected:
|
||||
inline bool isRequest()
|
||||
{
|
||||
return request;
|
||||
}
|
||||
|
||||
inline bool isLocal()
|
||||
{
|
||||
return guid == myGuid;
|
||||
}
|
||||
|
||||
LocalPlayer *getLocalPlayer();
|
||||
|
||||
protected:
|
||||
static RakNet::RakNetGUID guid, myGuid;
|
||||
static RakNet::SystemAddress serverAddr;
|
||||
|
||||
static bool request;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_BASECLIENTPACKETPROCESSOR_HPP
|
Loading…
Reference in New Issue