mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
[Server] Use CellController in Networking
This commit is contained in:
parent
8887a267c7
commit
08f78e21c1
1 changed files with 7 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "Networking.hpp"
|
#include "Networking.hpp"
|
||||||
#include "MasterClient.hpp"
|
#include "MasterClient.hpp"
|
||||||
|
#include "Cell.hpp"
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -29,6 +30,8 @@ Networking::Networking(RakNet::RakPeerInterface *peer)
|
||||||
this->peer = peer;
|
this->peer = peer;
|
||||||
players = Players::getPlayers();
|
players = Players::getPlayers();
|
||||||
|
|
||||||
|
CellController::Create();
|
||||||
|
|
||||||
playerController = new PlayerPacketController(peer);
|
playerController = new PlayerPacketController(peer);
|
||||||
worldController = new WorldPacketController(peer);
|
worldController = new WorldPacketController(peer);
|
||||||
|
|
||||||
|
@ -46,6 +49,8 @@ Networking::~Networking()
|
||||||
{
|
{
|
||||||
Script::Call<Script::CallbackIdentity("OnServerExit")>(false);
|
Script::Call<Script::CallbackIdentity("OnServerExit")>(false);
|
||||||
|
|
||||||
|
CellController::Destroy();
|
||||||
|
|
||||||
sThis = 0;
|
sThis = 0;
|
||||||
delete playerController;
|
delete playerController;
|
||||||
LOG_QUIT();
|
LOG_QUIT();
|
||||||
|
@ -180,6 +185,8 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
myPacket->Read(player);
|
myPacket->Read(player);
|
||||||
|
|
||||||
|
CellController::Get()->update(player);
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnPlayerCellState")>(player->getId());
|
Script::Call<Script::CallbackIdentity("OnPlayerCellState")>(player->getId());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue