terse entity-edit logging

This commit is contained in:
Seth Alves 2015-10-14 09:31:44 -07:00
parent 2a9b1c0fc3
commit 77bb11675d
12 changed files with 331 additions and 3 deletions

View file

@ -163,6 +163,19 @@ void AnimationPropertyGroup::debugDump() const {
qDebug() << "currentFrame:" << getCurrentFrame() << " has changed:" << currentFrameChanged();
}
void AnimationPropertyGroup::listChangedProperties(QList<QString>& out) {
if (urlChanged()) {
out << "animation-url";
}
if (fpsChanged()) {
out << "animation-fps";
}
if (currentFrameChanged()) {
out << "animation-currentFrame";
}
}
bool AnimationPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,

View file

@ -37,6 +37,7 @@ public:
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,

View file

@ -54,6 +54,30 @@ void AtmospherePropertyGroup::debugDump() const {
qDebug() << " Has Stars:" << getHasStars() << " has changed:" << hasStarsChanged();
}
void AtmospherePropertyGroup::listChangedProperties(QList<QString>& out) {
if (centerChanged()) {
out << "center";
}
if (innerRadiusChanged()) {
out << "innerRadius";
}
if (outerRadiusChanged()) {
out << "outerRadius";
}
if (mieScatteringChanged()) {
out << "mieScattering";
}
if (rayleighScatteringChanged()) {
out << "rayleighScattering";
}
if (scatteringWavelengthsChanged()) {
out << "scatteringWavelengths";
}
if (hasStarsChanged()) {
out << "hasStars";
}
}
bool AtmospherePropertyGroup::appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,

View file

@ -53,6 +53,7 @@ public:
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
@ -87,7 +88,7 @@ public:
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
bool& somethingChanged);
static const glm::vec3 DEFAULT_CENTER;
static const float DEFAULT_INNER_RADIUS;
static const float DEFAULT_OUTER_RADIUS;

View file

@ -1519,3 +1519,254 @@ void EntityItemProperties::setSimulationOwner(const QByteArray& data) {
_simulationOwnerChanged = true;
}
}
QList<QString> EntityItemProperties::listChangedProperties() {
QList<QString> out;
if (containsPositionChange()) {
out += "posistion";
}
if (dimensionsChanged()) {
out += "dimensions";
}
if (velocityChanged()) {
out += "velocity";
}
if (nameChanged()) {
out += "name";
}
if (visibleChanged()) {
out += "visible";
}
if (rotationChanged()) {
out += "rotation";
}
if (densityChanged()) {
out += "density";
}
if (gravityChanged()) {
out += "gravity";
}
if (accelerationChanged()) {
out += "acceleration";
}
if (dampingChanged()) {
out += "damping";
}
if (restitutionChanged()) {
out += "restitution";
}
if (frictionChanged()) {
out += "friction";
}
if (lifetimeChanged()) {
out += "lifetime";
}
if (scriptChanged()) {
out += "script";
}
if (scriptTimestampChanged()) {
out += "scriptTimestamp";
}
if (collisionSoundURLChanged()) {
out += "collisionSoundURL";
}
if (colorChanged()) {
out += "color";
}
if (colorSpreadChanged()) {
out += "colorSpread";
}
if (colorStartChanged()) {
out += "colorStart";
}
if (colorFinishChanged()) {
out += "colorFinish";
}
if (alphaChanged()) {
out += "alpha";
}
if (alphaSpreadChanged()) {
out += "alphaSpread";
}
if (alphaStartChanged()) {
out += "alphaStart";
}
if (alphaFinishChanged()) {
out += "alphaFinish";
}
if (modelURLChanged()) {
out += "modelURL";
}
if (compoundShapeURLChanged()) {
out += "compoundShapeURL";
}
if (registrationPointChanged()) {
out += "registrationPoint";
}
if (angularVelocityChanged()) {
out += "angularVelocity";
}
if (angularDampingChanged()) {
out += "angularDamping";
}
if (ignoreForCollisionsChanged()) {
out += "ignoreForCollisions";
}
if (collisionsWillMoveChanged()) {
out += "collisionsWillMove";
}
if (isSpotlightChanged()) {
out += "isSpotlight";
}
if (intensityChanged()) {
out += "intensity";
}
if (exponentChanged()) {
out += "exponent";
}
if (cutoffChanged()) {
out += "cutoff";
}
if (lockedChanged()) {
out += "locked";
}
if (texturesChanged()) {
out += "textures";
}
if (userDataChanged()) {
out += "userData";
}
if (simulationOwnerChanged()) {
out += "simulationOwner";
}
if (textChanged()) {
out += "text";
}
if (lineHeightChanged()) {
out += "lineHeight";
}
if (textColorChanged()) {
out += "textColor";
}
if (backgroundColorChanged()) {
out += "backgroundColor";
}
if (shapeTypeChanged()) {
out += "shapeType";
}
if (maxParticlesChanged()) {
out += "maxParticles";
}
if (lifespanChanged()) {
out += "lifespan";
}
if (isEmittingChanged()) {
out += "isEmitting";
}
if (emitRateChanged()) {
out += "emitRate";
}
if (emitSpeedChanged()) {
out += "emitSpeed";
}
if (speedSpreadChanged()) {
out += "speedSpread";
}
if (emitOrientationChanged()) {
out += "emitOrientation";
}
if (emitDimensionsChanged()) {
out += "emitDimensions";
}
if (emitRadiusStartChanged()) {
out += "emitRadiusStart";
}
if (polarStartChanged()) {
out += "polarStart";
}
if (polarFinishChanged()) {
out += "polarFinish";
}
if (azimuthStartChanged()) {
out += "azimuthStart";
}
if (azimuthFinishChanged()) {
out += "azimuthFinish";
}
if (emitAccelerationChanged()) {
out += "emitAcceleration";
}
if (accelerationSpreadChanged()) {
out += "accelerationSpread";
}
if (particleRadiusChanged()) {
out += "particleRadius";
}
if (radiusSpreadChanged()) {
out += "radiusSpread";
}
if (radiusStartChanged()) {
out += "radiusStart";
}
if (radiusFinishChanged()) {
out += "radiusFinish";
}
if (marketplaceIDChanged()) {
out += "marketplaceID";
}
if (backgroundModeChanged()) {
out += "backgroundMode";
}
if (voxelVolumeSizeChanged()) {
out += "voxelVolumeSize";
}
if (voxelDataChanged()) {
out += "voxelData";
}
if (voxelSurfaceStyleChanged()) {
out += "voxelSurfaceStyle";
}
if (hrefChanged()) {
out += "href";
}
if (descriptionChanged()) {
out += "description";
}
if (actionDataChanged()) {
out += "actionData";
}
if (xTextureURLChanged()) {
out += "xTextureURL";
}
if (yTextureURLChanged()) {
out += "yTextureURL";
}
if (zTextureURLChanged()) {
out += "zTextureURL";
}
if (xNNeighborIDChanged()) {
out += "xNNeighborID";
}
if (yNNeighborIDChanged()) {
out += "yNNeighborID";
}
if (zNNeighborIDChanged()) {
out += "zNNeighborID";
}
if (xPNeighborIDChanged()) {
out += "xPNeighborID";
}
if (yPNeighborIDChanged()) {
out += "yPNeighborID";
}
if (zPNeighborIDChanged()) {
out += "zPNeighborID";
}
getAnimation().listChangedProperties(out);
getAtmosphere().listChangedProperties(out);
getSkybox().listChangedProperties(out);
getStage().listChangedProperties(out);
return out;
}

View file

@ -253,6 +253,8 @@ public:
void setActionDataDirty() { _actionDataChanged = true; }
QList<QString> listChangedProperties();
private:
QUuid _id;
bool _idSet;

View file

@ -610,8 +610,11 @@ int EntityTree::processEditPacketData(NLPacket& packet, const unsigned char* edi
// if the EntityItem exists, then update it
startLogging = usecTimestampNow();
if (wantEditLogging()) {
qCDebug(entities) << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID;
qCDebug(entities) << " properties:" << properties;
// qCDebug(entities) << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID;
// qCDebug(entities) << " properties:" << properties;
qCDebug(entities) << "edit" << entityItemID.toString() << properties.listChangedProperties();
}
endLogging = usecTimestampNow();

View file

@ -57,6 +57,7 @@ public:
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const = 0;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) = 0;
virtual void debugDump() const { }
virtual void listChangedProperties(QList<QString>& out) { }
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,

View file

@ -33,6 +33,15 @@ void SkyboxPropertyGroup::debugDump() const {
qDebug() << " URL:" << getURL() << " has changed:" << urlChanged();
}
void SkyboxPropertyGroup::listChangedProperties(QList<QString>& out) {
if (colorChanged()) {
out << "skybox-color";
}
if (urlChanged()) {
out << "skybox-url";
}
}
bool SkyboxPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,

View file

@ -33,6 +33,7 @@ public:
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,

View file

@ -66,6 +66,27 @@ void StagePropertyGroup::debugDump() const {
qDebug() << " _automaticHourDay:" << _automaticHourDay;
}
void StagePropertyGroup::listChangedProperties(QList<QString>& out) {
if (sunModelEnabledChanged()) {
out << "stage-sunModelEnabled";
}
if (latitudeChanged()) {
out << "stage-latitude";
}
if (altitudeChanged()) {
out << "stage-altitude";
}
if (dayChanged()) {
out << "stage-day";
}
if (hourChanged()) {
out << "stage-hour";
}
if (automaticHourDayChanged()) {
out << "stage-automaticHourDay";
}
}
bool StagePropertyGroup::appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,
EntityPropertyFlags& propertyFlags,

View file

@ -33,6 +33,7 @@ public:
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
virtual void debugDump() const;
virtual void listChangedProperties(QList<QString>& out);
virtual bool appendToEditPacket(OctreePacketData* packetData,
EntityPropertyFlags& requestedProperties,