[Client] Rename WorldController into CellController to avoid confusion with Networking's WorldPacketController

0.6.1
David Cernat 8 years ago
parent ba8341bfb5
commit 679e790d8d

@ -7,7 +7,7 @@
#include "../mwmp/Main.hpp" #include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp" #include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp" #include "../mwmp/WorldEvent.hpp"
#include "../mwmp/WorldController.hpp" #include "../mwmp/CellController.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
@ -213,7 +213,7 @@ namespace MWGui
void ContainerWindow::openContainer(const MWWorld::Ptr& container, bool loot) void ContainerWindow::openContainer(const MWWorld::Ptr& container, bool loot)
{ {
mwmp::Main::get().getWorldController()->openContainer(container, loot); mwmp::Main::get().getCellController()->openContainer(container, loot);
mPickpocketDetected = false; mPickpocketDetected = false;
mPtr = container; mPtr = container;
@ -258,7 +258,7 @@ namespace MWGui
void ContainerWindow::close() void ContainerWindow::close()
{ {
mwmp::Main::get().getWorldController()->closeContainer(mPtr); mwmp::Main::get().getCellController()->closeContainer(mPtr);
WindowBase::close(); WindowBase::close();
if (dynamic_cast<PickpocketItemModel*>(mModel) if (dynamic_cast<PickpocketItemModel*>(mModel)

@ -5,27 +5,26 @@
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "WorldController.hpp" #include "CellController.hpp"
#include "Main.hpp" #include "Main.hpp"
#include "LocalPlayer.hpp" #include "LocalPlayer.hpp"
mwmp::CellController::CellController()
mwmp::WorldController::WorldController()
{ {
} }
mwmp::WorldController::~WorldController() mwmp::CellController::~CellController()
{ {
} }
int mwmp::WorldController::getCellSize() const int mwmp::CellController::getCellSize() const
{ {
return 8192; return 8192;
} }
MWWorld::CellStore *mwmp::WorldController::getCell(const ESM::Cell& cell) MWWorld::CellStore *mwmp::CellController::getCell(const ESM::Cell& cell)
{ {
MWWorld::CellStore *cellStore; MWWorld::CellStore *cellStore;
@ -47,7 +46,7 @@ MWWorld::CellStore *mwmp::WorldController::getCell(const ESM::Cell& cell)
} }
void mwmp::WorldController::openContainer(const MWWorld::Ptr &container, bool loot) void mwmp::CellController::openContainer(const MWWorld::Ptr &container, bool loot)
{ {
// Record this as the player's current open container // Record this as the player's current open container
mwmp::Main::get().getLocalPlayer()->storeCurrentContainer(container, loot); mwmp::Main::get().getLocalPlayer()->storeCurrentContainer(container, loot);
@ -70,7 +69,7 @@ void mwmp::WorldController::openContainer(const MWWorld::Ptr &container, bool lo
} }
void mwmp::WorldController::closeContainer(const MWWorld::Ptr &container) void mwmp::CellController::closeContainer(const MWWorld::Ptr &container)
{ {
mwmp::Main::get().getLocalPlayer()->clearCurrentContainer(); mwmp::Main::get().getLocalPlayer()->clearCurrentContainer();

@ -1,16 +1,16 @@
#ifndef OPENMW_WORLDCONTROLLER_HPP #ifndef OPENMW_CELLCONTROLLER_HPP
#define OPENMW_WORLDCONTROLLER_HPP #define OPENMW_CELLCONTROLLER_HPP
#include "../mwworld/cellstore.hpp" #include "../mwworld/cellstore.hpp"
namespace mwmp namespace mwmp
{ {
class WorldController class CellController
{ {
public: public:
WorldController(); CellController();
~WorldController(); ~CellController();
int getCellSize() const; int getCellSize() const;
@ -21,4 +21,4 @@ namespace mwmp
}; };
} }
#endif //OPENMW_WORLDCONTROLLER_HPP #endif //OPENMW_CELLCONTROLLER_HPP

@ -26,7 +26,7 @@
#include "Main.hpp" #include "Main.hpp"
#include "GUIController.hpp" #include "GUIController.hpp"
#include "WorldController.hpp" #include "CellController.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
#include <boost/algorithm/clamp.hpp> #include <boost/algorithm/clamp.hpp>
@ -84,7 +84,7 @@ void Players::createPlayer(RakNet::RakNetGUID guid)
// Temporarily spawn or move player to the center of exterior 0,0 whenever setting base info // Temporarily spawn or move player to the center of exterior 0,0 whenever setting base info
ESM::Position spawnPos; ESM::Position spawnPos;
spawnPos.pos[0] = spawnPos.pos[1] = Main::get().getWorldController()->getCellSize() / 2; spawnPos.pos[0] = spawnPos.pos[1] = Main::get().getCellController()->getCellSize() / 2;
spawnPos.pos[2] = 0; spawnPos.pos[2] = 0;
MWWorld::CellStore *cellStore = world->getExterior(0, 0); MWWorld::CellStore *cellStore = world->getExterior(0, 0);
@ -152,7 +152,7 @@ void Players::disconnectPlayer(RakNet::RakNetGUID guid)
// Move player to exterior 0,0 // Move player to exterior 0,0
ESM::Position newPos; ESM::Position newPos;
newPos.pos[0] = newPos.pos[1] = Main::get().getWorldController()->getCellSize() / 2; newPos.pos[0] = newPos.pos[1] = Main::get().getCellController()->getCellSize() / 2;
newPos.pos[2] = 0; newPos.pos[2] = 0;
MWWorld::CellStore *cellStore = world->getExterior(0, 0); MWWorld::CellStore *cellStore = world->getExterior(0, 0);

@ -28,7 +28,7 @@
#include "LocalPlayer.hpp" #include "LocalPlayer.hpp"
#include "Networking.hpp" #include "Networking.hpp"
#include "WorldController.hpp" #include "CellController.hpp"
#include "Main.hpp" #include "Main.hpp"
using namespace mwmp; using namespace mwmp;
@ -668,7 +668,7 @@ void LocalPlayer::addJournalItems()
if (journalItem.type == JournalItem::ENTRY) if (journalItem.type == JournalItem::ENTRY)
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(journalItem.actorCell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(journalItem.actorCell);
if (!ptrCellStore) continue; if (!ptrCellStore) continue;

@ -31,7 +31,7 @@
#include "LocalPlayer.hpp" #include "LocalPlayer.hpp"
#include "DedicatedPlayer.hpp" #include "DedicatedPlayer.hpp"
#include "GUIController.hpp" #include "GUIController.hpp"
#include "WorldController.hpp" #include "CellController.hpp"
using namespace mwmp; using namespace mwmp;
using namespace std; using namespace std;
@ -69,7 +69,7 @@ Main::Main()
mNetworking = new Networking(); mNetworking = new Networking();
mLocalPlayer = new LocalPlayer(); mLocalPlayer = new LocalPlayer();
mGUIController = new GUIController(); mGUIController = new GUIController();
mWorldController = new WorldController(); mCellController = new CellController();
//mLocalPlayer->CharGen(0, 4); //mLocalPlayer->CharGen(0, 4);
server = "mp.tes3mp.com"; server = "mp.tes3mp.com";
@ -208,8 +208,10 @@ void Main::updateWorld(float dt) const
get().getGUIController()->setChatVisible(true); get().getGUIController()->setChatVisible(true);
} }
else else
{
mLocalPlayer->update(); mLocalPlayer->update();
} }
}
const Main &Main::get() const Main &Main::get()
{ {
@ -232,9 +234,9 @@ GUIController *Main::getGUIController() const
return mGUIController; return mGUIController;
} }
WorldController *Main::getWorldController() const CellController *Main::getCellController() const
{ {
return mWorldController; return mCellController;
} }
void Main::pressedKey(int key) void Main::pressedKey(int key)

@ -4,7 +4,7 @@
namespace mwmp namespace mwmp
{ {
class WorldController; class CellController;
class GUIController; class GUIController;
class LocalPlayer; class LocalPlayer;
class Networking; class Networking;
@ -29,7 +29,7 @@ namespace mwmp
Networking *getNetworking() const; Networking *getNetworking() const;
LocalPlayer *getLocalPlayer() const; LocalPlayer *getLocalPlayer() const;
GUIController *getGUIController() const; GUIController *getGUIController() const;
WorldController *getWorldController() const; CellController *getCellController() const;
void updateWorld(float dt) const; void updateWorld(float dt) const;
@ -45,7 +45,7 @@ namespace mwmp
LocalPlayer *mLocalPlayer; LocalPlayer *mLocalPlayer;
GUIController *mGUIController; GUIController *mGUIController;
WorldController *mWorldController; CellController *mCellController;
std::string server; std::string server;
unsigned short port; unsigned short port;
}; };

@ -29,7 +29,7 @@
#include "DedicatedPlayer.hpp" #include "DedicatedPlayer.hpp"
#include "LocalPlayer.hpp" #include "LocalPlayer.hpp"
#include "GUIController.hpp" #include "GUIController.hpp"
#include "WorldController.hpp" #include "CellController.hpp"
#include "Main.hpp" #include "Main.hpp"
using namespace std; using namespace std;
@ -842,7 +842,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
{ {
case ID_ACTOR_LIST: case ID_ACTOR_LIST:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -857,6 +857,10 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_ACTOR_AUTHORITY: case ID_ACTOR_AUTHORITY:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return;
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received ID_ACTOR_AUTHORITY about %s", worldEvent.cell.getDescription().c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received ID_ACTOR_AUTHORITY about %s", worldEvent.cell.getDescription().c_str());
break; break;
} }
@ -867,7 +871,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_CONTAINER: case ID_CONTAINER:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -885,7 +889,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_PLACE: case ID_OBJECT_PLACE:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -896,7 +900,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_DELETE: case ID_OBJECT_DELETE:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -907,7 +911,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_LOCK: case ID_OBJECT_LOCK:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -918,7 +922,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_UNLOCK: case ID_OBJECT_UNLOCK:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -929,7 +933,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_SCALE: case ID_OBJECT_SCALE:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -940,7 +944,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_MOVE: case ID_OBJECT_MOVE:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -951,7 +955,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_ROTATE: case ID_OBJECT_ROTATE:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -962,7 +966,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_OBJECT_ANIM_PLAY: case ID_OBJECT_ANIM_PLAY:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -973,7 +977,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_DOOR_STATE: case ID_DOOR_STATE:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -984,7 +988,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_SCRIPT_LOCAL_SHORT: case ID_SCRIPT_LOCAL_SHORT:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;
@ -995,7 +999,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
case ID_SCRIPT_LOCAL_FLOAT: case ID_SCRIPT_LOCAL_FLOAT:
{ {
MWWorld::CellStore *ptrCellStore = Main::get().getWorldController()->getCell(worldEvent.cell); MWWorld::CellStore *ptrCellStore = Main::get().getCellController()->getCell(worldEvent.cell);
if (!ptrCellStore) return; if (!ptrCellStore) return;

Loading…
Cancel
Save