From cea1425db12e3e299ce88a91afb7f6c4b36ba615 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 4 Mar 2017 14:55:35 +0800 Subject: [PATCH] [Client] Remove redundant newlines & keep ~120 columns --- apps/openmw-mp/Cell.cpp | 3 +- apps/openmw-mp/Networking.cpp | 3 +- apps/openmw/mwgui/container.cpp | 18 +-- apps/openmw/mwgui/hud.cpp | 4 +- apps/openmw/mwmp/DedicatedPlayer.cpp | 15 +- apps/openmw/mwmp/LocalPlayer.cpp | 4 +- apps/openmw/mwmp/Main.cpp | 2 +- apps/openmw/mwmp/Networking.cpp | 63 +++----- apps/openmw/mwmp/WorldController.cpp | 12 +- apps/openmw/mwmp/WorldEvent.cpp | 144 ++++++------------ apps/openmw/mwscript/interpretercontext.cpp | 21 +-- .../mwscript/transformationextensions.cpp | 4 +- apps/openmw/mwworld/actiontake.cpp | 4 +- apps/openmw/mwworld/worldimp.cpp | 20 +-- 14 files changed, 107 insertions(+), 210 deletions(-) diff --git a/apps/openmw-mp/Cell.cpp b/apps/openmw-mp/Cell.cpp index db95a69d5..1b02bd541 100644 --- a/apps/openmw-mp/Cell.cpp +++ b/apps/openmw-mp/Cell.cpp @@ -33,8 +33,7 @@ void Cell::removePlayer(Player *player) auto it2 = find(player->cells.begin(), player->cells.end(), this); if (it2 != player->cells.end()) { - LOG_APPEND(Log::LOG_INFO, "- Removing %s from Player %s", getDescription().c_str(), - player->npc.mName.c_str()); + LOG_APPEND(Log::LOG_INFO, "- Removing %s from Player %s", getDescription().c_str(), player->npc.mName.c_str()); player->cells.erase(it2); } diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 88431b18f..b071d0eb1 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -182,8 +182,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) } else { - LOG_APPEND(Log::LOG_INFO, "- Started information exchange with %s", - other->npc.mName.c_str()); + LOG_APPEND(Log::LOG_INFO, "- Started information exchange with %s", other->npc.mName.c_str()); playerController->GetPacket(ID_PLAYER_DYNAMICSTATS)->Send(other, pl->guid); playerController->GetPacket(ID_PLAYER_ATTRIBUTE)->Send(other, pl->guid); diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 7ad7e007a..0c4a136c3 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -129,11 +129,8 @@ namespace MWGui mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str(), - containerItem.refId.c_str(), - containerItem.count); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), + containerItem.refId.c_str(), containerItem.count); /* End of tes3mp addition */ @@ -193,11 +190,8 @@ namespace MWGui mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str(), - containerItem.refId.c_str(), - containerItem.count); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), + containerItem.refId.c_str(), containerItem.count); /* End of tes3mp addition */ @@ -339,9 +333,7 @@ namespace MWGui mwmp::Main::get().getNetworking()->getWorldPacket(ID_CONTAINER)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str()); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str()); /* End of tes3mp addition */ diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 35cd9e46f..013e6ac6f 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -96,9 +96,7 @@ namespace MWGui mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_PLACE)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_PLACE\n- cellRef: %s, %i\n- count: %i", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldObject.count); + worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.count); /* End of tes3mp addition */ diff --git a/apps/openmw/mwmp/DedicatedPlayer.cpp b/apps/openmw/mwmp/DedicatedPlayer.cpp index 65d5bc92b..589e4ce47 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.cpp +++ b/apps/openmw/mwmp/DedicatedPlayer.cpp @@ -90,8 +90,7 @@ void Players::createPlayer(RakNet::RakNetGUID guid) if (dedicPlayer->state == 0) { - LOG_APPEND(Log::LOG_INFO, "- Creating new reference pointer for %s", - dedicPlayer->npc.mName.c_str()); + LOG_APPEND(Log::LOG_INFO, "- Creating new reference pointer for %s", dedicPlayer->npc.mName.c_str()); MWWorld::Ptr tmp = world->placeObject(dedicPlayer->reference->getPtr(), cellStore, spawnPos); @@ -103,8 +102,7 @@ void Players::createPlayer(RakNet::RakNetGUID guid) } else { - LOG_APPEND(Log::LOG_INFO, "- Updating reference pointer for %s", - dedicPlayer->npc.mName.c_str()); + LOG_APPEND(Log::LOG_INFO, "- Updating reference pointer for %s", dedicPlayer->npc.mName.c_str()); dedicPlayer->ptr.getBase()->canChangeCell = true; dedicPlayer->updatePtr(world->moveObject(dedicPlayer->ptr, cellStore, spawnPos.pos[0], spawnPos.pos[1], spawnPos.pos[2])); @@ -297,8 +295,7 @@ void DedicatedPlayer::updatePtr(MWWorld::Ptr newPtr) DedicatedPlayer *Players::newPlayer(RakNet::RakNetGUID guid) { - LOG_APPEND(Log::LOG_INFO, "- Creating new DedicatedPlayer with guid %lu", - guid.g); + LOG_APPEND(Log::LOG_INFO, "- Creating new DedicatedPlayer with guid %lu", guid.g); players[guid] = new DedicatedPlayer(guid); players[guid]->state = 0; @@ -472,10 +469,8 @@ void DedicatedPlayer::updateCell() MWWorld::CellStore *cellStore; - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server says %s (%s) moved to %s", - ptr.getBase()->mRef.getRefId().c_str(), - this->npc.mName.c_str(), - cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server says %s (%s) moved to %s", ptr.getBase()->mRef.getRefId().c_str(), + this->npc.mName.c_str(), cell.getDescription().c_str()); try { diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 1e45c9206..1d109b2f8 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -346,9 +346,7 @@ void LocalPlayer::updateCell(bool forceUpdate) { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_PLAYER_CELL_CHANGE to server"); - LOG_APPEND(Log::LOG_INFO, "- Moved from %s to %s", - cell.getDescription().c_str(), - ptrCell->getDescription().c_str()); + LOG_APPEND(Log::LOG_INFO, "- Moved from %s to %s", cell.getDescription().c_str(), ptrCell->getDescription().c_str()); cell = *ptrCell; diff --git a/apps/openmw/mwmp/Main.cpp b/apps/openmw/mwmp/Main.cpp index a7bde28f4..78da9830f 100644 --- a/apps/openmw/mwmp/Main.cpp +++ b/apps/openmw/mwmp/Main.cpp @@ -148,7 +148,7 @@ bool Main::init(std::vector &content, Files::Collections &collectio pMain->port = atoi(addr.substr(delim_pos + 1).c_str()); } get().mLocalPlayer->passw = passw; - + pMain->mNetworking->connect(pMain->server, pMain->port, content, collections); RestoreMgr(mgr); return pMain->mNetworking->isConnected(); diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 50b3a8199..8d52b03f5 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -146,7 +146,7 @@ void Networking::connect(const std::string &ip, unsigned short port, std::vector queue = false; LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONNECTION_REQUESTED_ACCEPTED from %s", - serverAddr.ToString()); + serverAddr.ToString()); break; } @@ -157,7 +157,8 @@ void Networking::connect(const std::string &ip, unsigned short port, std::vector case ID_CONNECTION_LOST: throw runtime_error("ID_CONNECTION_LOST.\n"); default: - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Connection message with identifier %i has arrived in initialization.", packet->data[0]); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Connection message with identifier %i has arrived in initialization.", + packet->data[0]); } } } @@ -380,14 +381,10 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) //cout << "Player: " << pl->Npc()->mName << " pressed: " << (pl->getAttack()->pressed == 1) << endl; if (pl->attack.pressed == 0) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Attack success: %s", - pl->attack.success ? "true" : "false"); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Attack success: %s", pl->attack.success ? "true" : "false"); if (pl->attack.success == 1) - { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Damage: %f", - pl->attack.damage); - } + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Damage: %f", pl->attack.damage); } MWMechanics::CreatureStats &stats = pl->getPtr().getClass().getNpcStats(pl->getPtr()); @@ -431,8 +428,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) } else { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "SpellId: %s", - pl->attack.refid.c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "SpellId: %s", pl->attack.refid.c_str()); LOG_APPEND(Log::LOG_VERBOSE, " - success: %d", pl->attack.success); } } @@ -688,9 +684,8 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) { myPacket->Packet(&bsIn, getLocalPlayer(), false); - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "ID_GUI_MESSAGEBOX, Type %d, MSG %s", - getLocalPlayer()->guiMessageBox.type, - getLocalPlayer()->guiMessageBox.label.c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "ID_GUI_MESSAGEBOX, Type %d, MSG %s", getLocalPlayer()->guiMessageBox.type, + getLocalPlayer()->guiMessageBox.label.c_str()); int messageBoxType = getLocalPlayer()->guiMessageBox.type; @@ -740,8 +735,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) break; } default: - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Unhandled PlayerPacket with identifier %i has arrived", - packet->data[0]); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Unhandled PlayerPacket with identifier %i has arrived", packet->data[0]); } } @@ -768,8 +762,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received ID_CONTAINER about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received ID_CONTAINER about %s", worldEvent.cell.getDescription().c_str()); LOG_APPEND(Log::LOG_VERBOSE, "- action: %i", worldEvent.action); // If we've received a request for information, comply with it @@ -787,8 +780,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_PLACE about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_PLACE about %s", worldEvent.cell.getDescription().c_str()); worldEvent.placeObjects(ptrCellStore); break; @@ -799,8 +791,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_DELETE about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_DELETE about %s", worldEvent.cell.getDescription().c_str()); worldEvent.deleteObjects(ptrCellStore); break; @@ -811,8 +802,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_LOCK about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_LOCK about %s", worldEvent.cell.getDescription().c_str()); worldEvent.lockObjects(ptrCellStore); break; @@ -823,8 +813,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_UNLOCK about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_UNLOCK about %s", worldEvent.cell.getDescription().c_str()); worldEvent.unlockObjects(ptrCellStore); break; @@ -835,8 +824,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_SCALE about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_SCALE about %s", worldEvent.cell.getDescription().c_str()); worldEvent.scaleObjects(ptrCellStore); break; @@ -847,8 +835,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_MOVE about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_MOVE about %s", worldEvent.cell.getDescription().c_str()); worldEvent.moveObjects(ptrCellStore); break; @@ -859,8 +846,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ROTATE about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ROTATE about %s", worldEvent.cell.getDescription().c_str()); worldEvent.rotateObjects(ptrCellStore); break; @@ -871,8 +857,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ANIM_PLAY about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ANIM_PLAY about %s", worldEvent.cell.getDescription().c_str()); worldEvent.animateObjects(ptrCellStore); break; @@ -883,8 +868,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_DOOR_STATE about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_DOOR_STATE about %s", worldEvent.cell.getDescription().c_str()); worldEvent.activateDoors(ptrCellStore); break; @@ -895,8 +879,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_SHORT about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_SHORT about %s", worldEvent.cell.getDescription().c_str()); worldEvent.setLocalShorts(ptrCellStore); break; @@ -907,8 +890,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) if (!ptrCellStore) return; - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_FLOAT about %s", - worldEvent.cell.getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_FLOAT about %s", worldEvent.cell.getDescription().c_str()); worldEvent.setLocalFloats(ptrCellStore); break; @@ -942,8 +924,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet) break; } default: - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Unhandled WorldPacket with identifier %i has arrived", - packet->data[0]); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Unhandled WorldPacket with identifier %i has arrived", packet->data[0]); } } diff --git a/apps/openmw/mwmp/WorldController.cpp b/apps/openmw/mwmp/WorldController.cpp index 783bc19cc..9ad2b7ebc 100644 --- a/apps/openmw/mwmp/WorldController.cpp +++ b/apps/openmw/mwmp/WorldController.cpp @@ -53,8 +53,7 @@ void mwmp::WorldController::openContainer(const MWWorld::Ptr &container, bool lo mwmp::Main::get().getLocalPlayer()->storeCurrentContainer(container, loot); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Container \"%s\" (%d) is opened. Loot: %s", - container.getCellRef().getRefId().c_str(), - container.getCellRef().getRefNum().mIndex, + container.getCellRef().getRefId().c_str(), container.getCellRef().getRefNum().mIndex, loot ? "true" : "false"); MWWorld::ContainerStore &cont = container.getClass().getContainerStore(container); @@ -78,15 +77,14 @@ void mwmp::WorldController::closeContainer(const MWWorld::Ptr &container) // If the player died while in a container, the container's Ptr could be invalid now if (!container.isEmpty()) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Container \"%s\" (%d) is closed.", - container.getCellRef().getRefId().c_str(), - container.getCellRef().getRefNum().mIndex); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Container \"%s\" (%d) is closed.", container.getCellRef().getRefId().c_str(), + container.getCellRef().getRefNum().mIndex); MWWorld::ContainerStore &cont = container.getClass().getContainerStore(container); for (MWWorld::ContainerStoreIterator iter = cont.begin(); iter != cont.end(); iter++) { - LOG_APPEND(Log::LOG_VERBOSE, " - Item. Refid: \"%s\" Count: %d", - iter->getCellRef().getRefId().c_str(), iter->getRefData().getCount()); + LOG_APPEND(Log::LOG_VERBOSE, " - Item. Refid: \"%s\" Count: %d", iter->getCellRef().getRefId().c_str(), + iter->getRefData().getCount()); } } diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index 811a163ac..2a32c73ac 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -85,17 +85,14 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); MWWorld::ContainerStore& containerStore = ptrFound.getClass().getContainerStore(ptrFound); @@ -164,11 +161,8 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i\n- charge: %i\n- count: %i", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldObject.charge, - worldObject.count); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i\n- charge: %i\n- count: %i", worldObject.refId.c_str(), + worldObject.refNumIndex, worldObject.charge, worldObject.count); MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), worldObject.refId, 1); MWWorld::Ptr newPtr = ref.getPtr(); @@ -200,17 +194,14 @@ void WorldEvent::deleteObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); MWBase::Environment::get().getWorld()->deleteObject(ptrFound); } @@ -225,17 +216,14 @@ void WorldEvent::lockObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); ptrFound.getClass().lock(ptrFound, worldObject.lockLevel); } @@ -250,17 +238,14 @@ void WorldEvent::unlockObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); ptrFound.getClass().unlock(ptrFound); } @@ -275,17 +260,14 @@ void WorldEvent::scaleObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); MWBase::Environment::get().getWorld()->scaleObject(ptrFound, worldObject.scale); } @@ -300,20 +282,17 @@ void WorldEvent::moveObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); - MWBase::Environment::get().getWorld()->moveObject(ptrFound, - worldObject.pos.pos[0], worldObject.pos.pos[1], worldObject.pos.pos[2]); + MWBase::Environment::get().getWorld()->moveObject(ptrFound, worldObject.pos.pos[0], worldObject.pos.pos[1], + worldObject.pos.pos[2]); } } } @@ -326,17 +305,14 @@ void WorldEvent::rotateObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); MWBase::Environment::get().getWorld()->rotateObject(ptrFound, worldObject.pos.rot[0], worldObject.pos.rot[1], worldObject.pos.rot[2]); @@ -352,20 +328,18 @@ void WorldEvent::animateObjects(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); - MWBase::Environment::get().getMechanicsManager()->playAnimationGroup(ptrFound, - worldObject.animGroup, worldObject.animMode, std::numeric_limits::max(), true); + MWBase::MechanicsManager * mechanicsManager = MWBase::Environment::get().getMechanicsManager(); + mechanicsManager->playAnimationGroup(ptrFound, worldObject.animGroup, worldObject.animMode, + std::numeric_limits::max(), true); } } } @@ -378,17 +352,14 @@ void WorldEvent::activateDoors(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", - worldObject.refId.c_str(), - worldObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i", worldObject.refId.c_str(), worldObject.refNumIndex); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); ptrFound.getClass().setDoorState(ptrFound, worldObject.doorState); MWBase::Environment::get().getWorld()->saveDoorState(ptrFound, worldObject.doorState); @@ -404,8 +375,7 @@ void WorldEvent::playMusic() { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s", - worldObject.filename.c_str()); + LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s", worldObject.filename.c_str()); MWBase::Environment::get().getSoundManager()->streamMusic(worldObject.filename); } @@ -419,9 +389,8 @@ void WorldEvent::playVideo() { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s\n- allowSkipping: %s", - worldObject.filename.c_str(), - worldObject.allowSkipping ? "true" : "false"); + LOG_APPEND(Log::LOG_VERBOSE, "- filename: %s\n- allowSkipping: %s", worldObject.filename.c_str(), + worldObject.allowSkipping ? "true" : "false"); MWBase::Environment::get().getWindowManager()->playVideo(worldObject.filename, worldObject.allowSkipping); } @@ -435,19 +404,15 @@ void WorldEvent::setLocalShorts(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i\n- index: %i\n- shortVal: %i", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldObject.index, - worldObject.shortVal); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i\n- index: %i\n- shortVal: %i", worldObject.refId.c_str(), + worldObject.refNumIndex, worldObject.index, worldObject.shortVal); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); ptrFound.getRefData().getLocals().mShorts.at(worldObject.index) = worldObject.shortVal; } @@ -462,19 +427,15 @@ void WorldEvent::setLocalFloats(MWWorld::CellStore* cellStore) { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i\n- index: %i\n- floatVal: %f", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldObject.index, - worldObject.floatVal); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s, %i\n- index: %i\n- floatVal: %f", worldObject.refId.c_str(), + worldObject.refNumIndex, worldObject.index, worldObject.floatVal); MWWorld::Ptr ptrFound = cellStore->searchExact(worldObject.refId, worldObject.refNumIndex); if (ptrFound) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); ptrFound.getRefData().getLocals().mFloats.at(worldObject.index) = worldObject.floatVal; } @@ -489,19 +450,16 @@ void WorldEvent::setMemberShorts() { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s\n- index: %i\n- shortVal: %i\n", - worldObject.refId.c_str(), - worldObject.index, - worldObject.shortVal); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s\n- index: %i\n- shortVal: %i\n", worldObject.refId.c_str(), + worldObject.index, worldObject.shortVal); // Mimic the way a Ptr is fetched in InterpreterContext for similar situations MWWorld::Ptr ptrFound = MWBase::Environment::get().getWorld()->searchPtr(worldObject.refId, false); if (!ptrFound.isEmpty()) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", - ptrFound.getCellRef().getRefId().c_str(), - ptrFound.getCellRef().getRefNum()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Found %s, %i", ptrFound.getCellRef().getRefId().c_str(), + ptrFound.getCellRef().getRefNum()); std::string scriptId = ptrFound.getClass().getScript(ptrFound); @@ -521,9 +479,7 @@ void WorldEvent::setGlobalShorts() { worldObject = objectChanges.objects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s\n- shortVal: %i", - worldObject.varName.c_str(), - worldObject.shortVal); + LOG_APPEND(Log::LOG_VERBOSE, "- varName: %s\n- shortVal: %i", worldObject.varName.c_str(), worldObject.shortVal); MWBase::Environment::get().getWorld()->setGlobalInt(worldObject.varName, worldObject.shortVal); } diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 7172b5dea..25a2cda44 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -215,11 +215,8 @@ namespace MWScript mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_LOCAL_SHORT)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_SHORT\n- cellRef: %s, %i\n- cell: %s\n- index: %i\n- shortVal: %i", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str(), - worldObject.index, - worldObject.shortVal); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), + worldObject.index, worldObject.shortVal); } /* End of tes3mp addition @@ -263,11 +260,8 @@ namespace MWScript mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_LOCAL_FLOAT)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_LOCAL_FLOAT\n- cellRef: %s, %i\n- cell: %s\n- index: %i\n- floatVal: %f", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str(), - worldObject.index, - worldObject.floatVal); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), + worldObject.index, worldObject.floatVal); } /* End of tes3mp addition @@ -333,8 +327,7 @@ namespace MWScript mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_GLOBAL_SHORT)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_GLOBAL_SHORT\n- varName: %s\n- shortVal: %i", - worldObject.varName.c_str(), - worldObject.shortVal); + worldObject.varName.c_str(), worldObject.shortVal); } /* End of tes3mp addition @@ -679,9 +672,7 @@ namespace MWScript mwmp::Main::get().getNetworking()->getWorldPacket(ID_SCRIPT_MEMBER_SHORT)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_MEMBER_SHORT\n- cellRef: %s\n- index: %i\n- shortVal: %i", - worldObject.refId.c_str(), - worldObject.index, - worldObject.shortVal); + worldObject.refId.c_str(), worldObject.index, worldObject.shortVal); } /* End of tes3mp addition diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 612663b5a..1fcf070d8 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -581,9 +581,7 @@ namespace MWScript mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_PLACE)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_PLACE\n- cellRef: %s, %i\n- count: %i", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldObject.count); + worldObject.refId.c_str(), worldObject.refNumIndex, worldObject.count); /* End of tes3mp addition */ diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index 29eb419eb..dd559e44b 100644 --- a/apps/openmw/mwworld/actiontake.cpp +++ b/apps/openmw/mwworld/actiontake.cpp @@ -45,9 +45,7 @@ namespace MWWorld mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_DELETE about\n- cellRef: %s, %i\n- cell: %s", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str()); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str()); mwmp::Main::get().getLocalPlayer()->sendInventory(); /* diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index c9ef6b987..990ab65ab 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1172,11 +1172,9 @@ namespace MWWorld // tes3mp debug start if (currCell != newCell) { - LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Tick: %s was %s move from %s to %s", - ptr.getBase()->mRef.getRefId().c_str(), - ptr.getBase()->canChangeCell ? "allowed" : "denied", - currCell->getCell()->getDescription().c_str(), - newCell->getCell()->getDescription().c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Tick: %s was %s move from %s to %s", ptr.getBase()->mRef.getRefId().c_str(), + ptr.getBase()->canChangeCell ? "allowed" : "denied", currCell->getCell()->getDescription().c_str(), + newCell->getCell()->getDescription().c_str()); } // tes3mp debug end @@ -2337,10 +2335,8 @@ namespace MWWorld mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Door activation 1\n- cellRef: %s, %i\n- cell: %s\n- state: %s", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str(), - worldObject.doorState ? "true" : "false"); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), + worldObject.doorState ? "true" : "false"); /* End of tes3mp addition */ @@ -2368,10 +2364,8 @@ namespace MWWorld mwmp::Main::get().getNetworking()->getWorldPacket(ID_DOOR_STATE)->Send(worldEvent); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Door activation 2\n- cellRef: %s, %i\n- cell: %s\n- state: %s", - worldObject.refId.c_str(), - worldObject.refNumIndex, - worldEvent->cell.getDescription().c_str(), - worldObject.doorState ? "true" : "false"); + worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(), + worldObject.doorState ? "true" : "false"); /* End of tes3mp addition */