Don't do spatial logging on the server
This commit is contained in:
parent
152af87655
commit
efa3872396
@ -21,5 +21,7 @@
|
||||
"buttonClickSound" : [ "/sfx/interface/button/click.wav" ],
|
||||
"buttonReleaseSound" : [ "/sfx/interface/button/release.wav" ],
|
||||
"buttonHoverSound" : [ "/sfx/interface/button/hover.wav" ],
|
||||
"buttonHoverOffSound" : [ "/sfx/interface/button/hover_off.wav" ]
|
||||
"buttonHoverOffSound" : [ "/sfx/interface/button/hover_off.wav" ],
|
||||
|
||||
"debugSpatialClearTime" : 0.0
|
||||
}
|
@ -179,10 +179,15 @@ Deque<SpatialLogger::LogText> SpatialLogger::getText(char const* space, bool and
|
||||
}
|
||||
|
||||
void SpatialLogger::clear() {
|
||||
decltype(s_lines) lines;
|
||||
decltype(s_points) points;
|
||||
decltype(s_logText) logText;
|
||||
{
|
||||
MutexLocker locker(s_mutex);
|
||||
s_lines.clear();
|
||||
s_points.clear();
|
||||
s_logText.clear();
|
||||
lines = move(s_lines);
|
||||
points = move(s_points);
|
||||
logText = move(s_logText);
|
||||
} // Move while locked to deallocate contents while unlocked.
|
||||
}
|
||||
|
||||
Mutex SpatialLogger::s_mutex;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "StarChatBubbleSeparation.hpp"
|
||||
#include "StarLogging.hpp"
|
||||
//#include "StarLogging.hpp"
|
||||
|
||||
namespace Star {
|
||||
|
||||
|
@ -814,11 +814,10 @@ void MainInterface::render() {
|
||||
renderMonsterHealthBar();
|
||||
renderSpecialDamageBar();
|
||||
renderMainBar();
|
||||
renderDebug();
|
||||
|
||||
renderWindows();
|
||||
renderCursor();
|
||||
|
||||
renderDebug();
|
||||
}
|
||||
|
||||
Vec2F MainInterface::cursorWorldPosition() const {
|
||||
|
@ -30,6 +30,10 @@ TitleScreen::TitleScreen(PlayerStoragePtr playerStorage, MixerPtr mixer)
|
||||
auto randomWorld = m_celestialDatabase->findRandomWorld(10, 50, [this](CelestialCoordinate const& coordinate) {
|
||||
return is<TerrestrialWorldParameters>(m_celestialDatabase->parameters(coordinate)->visitableParameters());
|
||||
}).take();
|
||||
|
||||
if (auto name = m_celestialDatabase->name(randomWorld))
|
||||
Logger::info("Title world is {} @ CelestialWorld:{}", Text::stripEscapeCodes(*name), randomWorld);
|
||||
|
||||
SkyParameters skyParameters(randomWorld, m_celestialDatabase);
|
||||
m_skyBackdrop = make_shared<Sky>(skyParameters, true);
|
||||
|
||||
|
@ -80,6 +80,7 @@ void DamageManager::update() {
|
||||
for (auto& damageSource : causingEntity->damageSources()) {
|
||||
if (damageSource.trackSourceEntity)
|
||||
damageSource.translate(causingEntity->position());
|
||||
|
||||
if (auto poly = damageSource.damageArea.ptr<PolyF>())
|
||||
SpatialLogger::logPoly("world", *poly, Color::Orange.toRgba());
|
||||
else if (auto line = damageSource.damageArea.ptr<Line2F>())
|
||||
|
@ -479,10 +479,10 @@ void Monster::update(uint64_t) {
|
||||
m_networkedAnimatorDynamicTarget.updatePosition(position());
|
||||
|
||||
m_scriptedAnimator.update();
|
||||
}
|
||||
|
||||
SpatialLogger::logPoly("world", m_movementController->collisionBody(), { 255, 0, 0, 255 });
|
||||
}
|
||||
}
|
||||
|
||||
void Monster::render(RenderCallback* renderCallback) {
|
||||
for (auto& drawable : m_networkedAnimator.drawables(position())) {
|
||||
|
@ -442,6 +442,7 @@ void Npc::update(uint64_t) {
|
||||
tickShared();
|
||||
}
|
||||
|
||||
if (world()->isClient())
|
||||
SpatialLogger::logPoly("world", m_movementController->collisionBody(), {0, 255, 0, 255});
|
||||
}
|
||||
|
||||
|
@ -959,6 +959,8 @@ void Player::update(uint64_t) {
|
||||
else
|
||||
m_humanoid->setDance({});
|
||||
|
||||
bool isClient = world()->isClient();
|
||||
if (isClient)
|
||||
m_armor->setupHumanoidClothingDrawables(*m_humanoid, forceNude());
|
||||
|
||||
m_tools->suppressItems(!canUseTool());
|
||||
@ -971,7 +973,9 @@ void Player::update(uint64_t) {
|
||||
if (m_movementController->facingDirection() == Direction::Left)
|
||||
m_effectsAnimator->scaleTransformationGroup("flip", Vec2F(-1, 1));
|
||||
|
||||
if (world()->isClient()) {
|
||||
|
||||
|
||||
if (isClient) {
|
||||
m_effectsAnimator->update(WorldTimestep, &m_effectsAnimatorDynamicTarget);
|
||||
m_effectsAnimatorDynamicTarget.updatePosition(position() + m_techController->parentOffset());
|
||||
} else {
|
||||
@ -1009,6 +1013,7 @@ void Player::update(uint64_t) {
|
||||
|
||||
m_pendingMoves.clear();
|
||||
|
||||
if (isClient)
|
||||
SpatialLogger::logPoly("world", m_movementController->collisionBody(), isMaster() ? Color::Orange.toRgba() : Color::Yellow.toRgba());
|
||||
}
|
||||
|
||||
|
@ -344,6 +344,7 @@ void Projectile::update(uint64_t) {
|
||||
tickShared();
|
||||
}
|
||||
|
||||
if (world()->isClient())
|
||||
SpatialLogger::logPoly("world", m_movementController->collisionBody(), Color::Red.toRgba());
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,12 @@ void Stagehand::update(uint64_t) {
|
||||
if (isMaster() && m_scripted)
|
||||
m_scriptComponent.update(m_scriptComponent.updateDt());
|
||||
|
||||
SpatialLogger::logPoly("world", PolyF(metaBoundBox().translated(position())), {0, 255, 255, 255});
|
||||
SpatialLogger::logPoint("world", position(), {0, 255, 255, 255});
|
||||
if (world()->isClient()) {
|
||||
auto boundBox = metaBoundBox().translated(position());
|
||||
SpatialLogger::logPoly("world", PolyF(boundBox), { 0, 255, 255, 255 });
|
||||
SpatialLogger::logLine("world", boundBox.min(), boundBox.max(), {0, 255, 255, 255});
|
||||
SpatialLogger::logLine("world", { boundBox.xMin(), boundBox.yMax() }, { boundBox.xMax(), boundBox.yMin() }, {0, 255, 255, 255});
|
||||
}
|
||||
}
|
||||
|
||||
bool Stagehand::shouldDestroy() const {
|
||||
|
@ -315,6 +315,7 @@ void Vehicle::update(uint64_t) {
|
||||
if (world()->isClient())
|
||||
m_scriptedAnimator.update();
|
||||
|
||||
if (world()->isClient())
|
||||
SpatialLogger::logPoly("world", m_movementController.collisionBody(), {255, 255, 0, 255});
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,8 @@ void ActiveItem::update(FireMode fireMode, bool shifting, HashSet<MoveControlTyp
|
||||
}
|
||||
}
|
||||
|
||||
if (world()->isClient()) {
|
||||
bool isClient = world()->isClient();
|
||||
if (isClient) {
|
||||
m_itemAnimator.update(WorldTimestep, &m_itemAnimatorDynamicTarget);
|
||||
m_scriptedAnimator.update(m_scriptedAnimator.updateDt());
|
||||
} else {
|
||||
@ -151,9 +152,11 @@ void ActiveItem::update(FireMode fireMode, bool shifting, HashSet<MoveControlTyp
|
||||
|
||||
for (auto shieldPoly : shieldPolys()) {
|
||||
shieldPoly.translate(owner()->position());
|
||||
if (isClient)
|
||||
SpatialLogger::logPoly("world", shieldPoly, {255, 255, 0, 255});
|
||||
}
|
||||
|
||||
if (isClient) {
|
||||
for (auto forceRegion : forceRegions()) {
|
||||
if (auto dfr = forceRegion.ptr<DirectionalForceRegion>())
|
||||
SpatialLogger::logPoly("world", dfr->region, { 155, 0, 255, 255 });
|
||||
@ -161,6 +164,7 @@ void ActiveItem::update(FireMode fireMode, bool shifting, HashSet<MoveControlTyp
|
||||
SpatialLogger::logPoint("world", rfr->center, { 155, 0, 255, 255 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<DamageSource> ActiveItem::damageSources() const {
|
||||
List<DamageSource> damageSources = m_damageSources.get();
|
||||
|
Loading…
Reference in New Issue
Block a user