|
|
|
@ -15,6 +15,7 @@
|
|
|
|
|
|
|
|
|
|
#include "Networking.hpp"
|
|
|
|
|
#include "MasterClient.hpp"
|
|
|
|
|
#include "Cell.hpp"
|
|
|
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
|
using namespace std;
|
|
|
|
@ -29,6 +30,8 @@ Networking::Networking(RakNet::RakPeerInterface *peer)
|
|
|
|
|
this->peer = peer;
|
|
|
|
|
players = Players::getPlayers();
|
|
|
|
|
|
|
|
|
|
CellController::Create();
|
|
|
|
|
|
|
|
|
|
playerController = new PlayerPacketController(peer);
|
|
|
|
|
worldController = new WorldPacketController(peer);
|
|
|
|
|
|
|
|
|
@ -46,6 +49,8 @@ Networking::~Networking()
|
|
|
|
|
{
|
|
|
|
|
Script::Call<Script::CallbackIdentity("OnServerExit")>(false);
|
|
|
|
|
|
|
|
|
|
CellController::Destroy();
|
|
|
|
|
|
|
|
|
|
sThis = 0;
|
|
|
|
|
delete playerController;
|
|
|
|
|
LOG_QUIT();
|
|
|
|
@ -180,6 +185,8 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
|
|
|
|
|
|
|
|
|
myPacket->Read(player);
|
|
|
|
|
|
|
|
|
|
CellController::Get()->update(player);
|
|
|
|
|
|
|
|
|
|
Script::Call<Script::CallbackIdentity("OnPlayerCellState")>(player->getId());
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|