|
|
@ -64,7 +64,7 @@ void Cell::updateLocal(bool forceUpdate)
|
|
|
|
// If the cell this actor has moved to is under our authority, move them to it
|
|
|
|
// If the cell this actor has moved to is under our authority, move them to it
|
|
|
|
if (cellController->hasLocalAuthority(actor->cell))
|
|
|
|
if (cellController->hasLocalAuthority(actor->cell))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Moving LocalActor %s to our authority in %s",
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "- Moving LocalActor %s to our authority in %s",
|
|
|
|
mapIndex.c_str(), actor->cell.getDescription().c_str());
|
|
|
|
mapIndex.c_str(), actor->cell.getDescription().c_str());
|
|
|
|
Cell *newCell = cellController->getCell(actor->cell);
|
|
|
|
Cell *newCell = cellController->getCell(actor->cell);
|
|
|
|
newCell->localActors[mapIndex] = actor;
|
|
|
|
newCell->localActors[mapIndex] = actor;
|
|
|
@ -72,7 +72,7 @@ void Cell::updateLocal(bool forceUpdate)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Deleting LocalActor %s which is no longer under our authority",
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "- Deleting LocalActor %s which is no longer under our authority",
|
|
|
|
mapIndex.c_str(), getDescription().c_str());
|
|
|
|
mapIndex.c_str(), getDescription().c_str());
|
|
|
|
cellController->removeLocalActorRecord(mapIndex);
|
|
|
|
cellController->removeLocalActorRecord(mapIndex);
|
|
|
|
delete actor;
|
|
|
|
delete actor;
|
|
|
@ -310,7 +310,7 @@ void Cell::readCellChange(ActorList& actorList)
|
|
|
|
// Is a packet mistakenly moving the actor to the cell it's already in? If so, ignore it
|
|
|
|
// Is a packet mistakenly moving the actor to the cell it's already in? If so, ignore it
|
|
|
|
if (Misc::StringUtils::ciEqual(getDescription(), baseActor.cell.getDescription()))
|
|
|
|
if (Misc::StringUtils::ciEqual(getDescription(), baseActor.cell.getDescription()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server says DedicatedActor %s moved to %s, but it was already there",
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Server says DedicatedActor %s moved to %s, but it was already there",
|
|
|
|
mapIndex.c_str(), getDescription().c_str());
|
|
|
|
mapIndex.c_str(), getDescription().c_str());
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -322,7 +322,7 @@ void Cell::readCellChange(ActorList& actorList)
|
|
|
|
dedicatedActor->position = baseActor.position;
|
|
|
|
dedicatedActor->position = baseActor.position;
|
|
|
|
dedicatedActor->direction = baseActor.direction;
|
|
|
|
dedicatedActor->direction = baseActor.direction;
|
|
|
|
|
|
|
|
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server says DedicatedActor %s moved to %s",
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Server says DedicatedActor %s moved to %s",
|
|
|
|
mapIndex.c_str(), dedicatedActor->cell.getDescription().c_str());
|
|
|
|
mapIndex.c_str(), dedicatedActor->cell.getDescription().c_str());
|
|
|
|
|
|
|
|
|
|
|
|
MWWorld::CellStore *newStore = cellController->getCellStore(dedicatedActor->cell);
|
|
|
|
MWWorld::CellStore *newStore = cellController->getCellStore(dedicatedActor->cell);
|
|
|
@ -331,7 +331,7 @@ void Cell::readCellChange(ActorList& actorList)
|
|
|
|
// If the cell this actor has moved to is active and not under our authority, move them to it
|
|
|
|
// If the cell this actor has moved to is active and not under our authority, move them to it
|
|
|
|
if (cellController->isActiveWorldCell(dedicatedActor->cell) && !cellController->hasLocalAuthority(dedicatedActor->cell))
|
|
|
|
if (cellController->isActiveWorldCell(dedicatedActor->cell) && !cellController->hasLocalAuthority(dedicatedActor->cell))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Moving DedicatedActor %s to our active cell %s",
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "- Moving DedicatedActor %s to our active cell %s",
|
|
|
|
mapIndex.c_str(), dedicatedActor->cell.getDescription().c_str());
|
|
|
|
mapIndex.c_str(), dedicatedActor->cell.getDescription().c_str());
|
|
|
|
cellController->initializeCell(dedicatedActor->cell);
|
|
|
|
cellController->initializeCell(dedicatedActor->cell);
|
|
|
|
Cell *newCell = cellController->getCell(dedicatedActor->cell);
|
|
|
|
Cell *newCell = cellController->getCell(dedicatedActor->cell);
|
|
|
@ -342,7 +342,7 @@ void Cell::readCellChange(ActorList& actorList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (cellController->hasLocalAuthority(dedicatedActor->cell))
|
|
|
|
if (cellController->hasLocalAuthority(dedicatedActor->cell))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Creating new LocalActor based on %s in %s",
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "- Creating new LocalActor based on %s in %s",
|
|
|
|
mapIndex.c_str(), dedicatedActor->cell.getDescription().c_str());
|
|
|
|
mapIndex.c_str(), dedicatedActor->cell.getDescription().c_str());
|
|
|
|
Cell *newCell = cellController->getCell(dedicatedActor->cell);
|
|
|
|
Cell *newCell = cellController->getCell(dedicatedActor->cell);
|
|
|
|
LocalActor *localActor = new LocalActor();
|
|
|
|
LocalActor *localActor = new LocalActor();
|
|
|
@ -359,7 +359,7 @@ void Cell::readCellChange(ActorList& actorList)
|
|
|
|
cellController->setLocalActorRecord(mapIndex, newCell->getDescription());
|
|
|
|
cellController->setLocalActorRecord(mapIndex, newCell->getDescription());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Deleting DedicatedActor %s which is no longer needed",
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "- Deleting DedicatedActor %s which is no longer needed",
|
|
|
|
mapIndex.c_str(), getDescription().c_str());
|
|
|
|
mapIndex.c_str(), getDescription().c_str());
|
|
|
|
cellController->removeDedicatedActorRecord(mapIndex);
|
|
|
|
cellController->removeDedicatedActorRecord(mapIndex);
|
|
|
|
delete dedicatedActor;
|
|
|
|
delete dedicatedActor;
|
|
|
@ -386,7 +386,7 @@ void Cell::initializeLocalActor(const MWWorld::Ptr& ptr)
|
|
|
|
|
|
|
|
|
|
|
|
Main::get().getCellController()->setLocalActorRecord(mapIndex, getDescription());
|
|
|
|
Main::get().getCellController()->setLocalActorRecord(mapIndex, getDescription());
|
|
|
|
|
|
|
|
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Initialized LocalActor %s in %s", mapIndex.c_str(), getDescription().c_str());
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "- Initialized LocalActor %s in %s", mapIndex.c_str(), getDescription().c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Cell::initializeLocalActors()
|
|
|
|
void Cell::initializeLocalActors()
|
|
|
@ -420,7 +420,7 @@ void Cell::initializeDedicatedActor(const MWWorld::Ptr& ptr)
|
|
|
|
|
|
|
|
|
|
|
|
Main::get().getCellController()->setDedicatedActorRecord(mapIndex, getDescription());
|
|
|
|
Main::get().getCellController()->setDedicatedActorRecord(mapIndex, getDescription());
|
|
|
|
|
|
|
|
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Initialized DedicatedActor %s in %s", mapIndex.c_str(), getDescription().c_str());
|
|
|
|
LOG_APPEND(Log::LOG_VERBOSE, "- Initialized DedicatedActor %s in %s", mapIndex.c_str(), getDescription().c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Cell::initializeDedicatedActors(ActorList& actorList)
|
|
|
|
void Cell::initializeDedicatedActors(ActorList& actorList)
|
|
|
|