1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 00:15:32 +00:00

Add WorldPacketController to server's Networking

This commit is contained in:
David Cernat 2016-10-19 20:51:51 +03:00
parent 285f89573d
commit f1ec01cc6b
2 changed files with 13 additions and 1 deletions

View file

@ -27,8 +27,11 @@ Networking::Networking(RakNet::RakPeerInterface *peer)
players = Players::GetPlayers();
playerController = new PlayerPacketController(peer);
worldController = new WorldPacketController(peer);
playerController->SetStream(0, &bsOut); // set send stream
// Set send stream
playerController->SetStream(0, &bsOut);
worldController->SetStream(0, &bsOut);
running = true;
exitCode = 0;
@ -416,6 +419,11 @@ PlayerPacketController *Networking::GetPlayerController() const
return playerController;
}
WorldPacketController *Networking::GetWorldController() const
{
return worldController;
}
const Networking &Networking::Get()
{
return *sThis;

View file

@ -6,6 +6,7 @@
#define OPENMW_NETWORKING_HPP
#include <components/openmw-mp/Controllers/PlayerPacketController.hpp>
#include <components/openmw-mp/Controllers/WorldPacketController.hpp>
#include "Player.hpp"
namespace mwmp
@ -28,6 +29,8 @@ namespace mwmp
void StopServer(int code);
PlayerPacketController *GetPlayerController() const;
WorldPacketController *GetWorldController() const;
static const Networking &Get();
static Networking *GetPtr();
@ -38,6 +41,7 @@ namespace mwmp
TPlayers *players;
PlayerPacketController *playerController;
WorldPacketController *worldController;
bool running;
int exitCode;