Add WorldPacketController to server's Networking

coverity_scan^2
David Cernat 8 years ago
parent 285f89573d
commit f1ec01cc6b

@ -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;

@ -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;

Loading…
Cancel
Save