Sync most changes from May 9, 2020 libremetaverse into -core
This commit is contained in:
parent
c3ff59a2b5
commit
a3cb5c595c
18 changed files with 919 additions and 830 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -425,7 +425,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return (obj is Color4) && this == (Color4)obj;
|
return (obj is Color4 color4) && this == color4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Color4 other)
|
public bool Equals(Color4 other)
|
||||||
|
|
|
||||||
|
|
@ -986,7 +986,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return (obj is Matrix4) ? this.Equals((Matrix4)obj) : false;
|
return (obj is Matrix4 matrix4) && this.Equals(matrix4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Matrix4 other)
|
public bool Equals(Matrix4 other)
|
||||||
|
|
|
||||||
|
|
@ -675,7 +675,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return (obj is Quaternion) ? this == (Quaternion)obj : false;
|
return (obj is Quaternion quaternion) && this == quaternion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Quaternion other)
|
public bool Equals(Quaternion other)
|
||||||
|
|
|
||||||
|
|
@ -344,7 +344,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return (obj is Vector2) ? this == ((Vector2)obj) : false;
|
return (obj is Vector2 vector2) && this == vector2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Vector2 other)
|
public bool Equals(Vector2 other)
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return (obj is Vector3d) ? this == (Vector3d)obj : false;
|
return (obj is Vector3d v3d) && this == v3d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Vector3d other)
|
public bool Equals(Vector3d other)
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return (obj is Vector4) ? this == (Vector4)obj : false;
|
return (obj is Vector4 vector4) && this == vector4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Vector4 other)
|
public bool Equals(Vector4 other)
|
||||||
|
|
|
||||||
|
|
@ -110,13 +110,13 @@ namespace OpenMetaverse.Assets
|
||||||
{
|
{
|
||||||
// Right now we're nastily obtaining the UUID from the filename
|
// Right now we're nastily obtaining the UUID from the filename
|
||||||
string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
|
string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
|
||||||
int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR);
|
int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR, StringComparison.Ordinal);
|
||||||
|
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
{
|
{
|
||||||
Logger.Log(String.Format(
|
Logger.Log(
|
||||||
"[OarFile]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping",
|
$"[OarFile]: Could not find extension information in asset path {assetPath} since it's missing the separator " +
|
||||||
assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR), Helpers.LogLevel.Warning);
|
$"{ArchiveConstants.ASSET_EXTENSION_SEPARATOR}. Skipping", Helpers.LogLevel.Warning);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ namespace OpenMetaverse.Assets
|
||||||
String text = Utils.BytesToString(AssetData);
|
String text = Utils.BytesToString(AssetData);
|
||||||
if (text.ToLower().Contains("callingcard version 2"))
|
if (text.ToLower().Contains("callingcard version 2"))
|
||||||
{
|
{
|
||||||
AvatarID = new UUID(text.Substring(text.IndexOf("avatar_id") + 10, 36));
|
AvatarID = new UUID(text.Substring(text.IndexOf("avatar_id", StringComparison.Ordinal) + 10, 36));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,9 @@ namespace OpenMetaverse.Assets
|
||||||
String text = Utils.BytesToString(AssetData);
|
String text = Utils.BytesToString(AssetData);
|
||||||
if (text.ToLower().Contains("landmark version 2"))
|
if (text.ToLower().Contains("landmark version 2"))
|
||||||
{
|
{
|
||||||
RegionID = new UUID(text.Substring(text.IndexOf("region_id") + 10, 36));
|
RegionID = new UUID(text.Substring(text.IndexOf("region_id", StringComparison.Ordinal) + 10, 36));
|
||||||
String vecDelim = " ";
|
String vecDelim = " ";
|
||||||
String[] vecStrings = text.Substring(text.IndexOf("local_pos") + 10).Split(vecDelim.ToCharArray());
|
String[] vecStrings = text.Substring(text.IndexOf("local_pos", StringComparison.Ordinal) + 10).Split(vecDelim.ToCharArray());
|
||||||
if (vecStrings.Length == 3)
|
if (vecStrings.Length == 3)
|
||||||
{
|
{
|
||||||
Position = new Vector3(float.Parse(vecStrings[0], System.Globalization.CultureInfo.InvariantCulture), float.Parse(vecStrings[1], System.Globalization.CultureInfo.InvariantCulture), float.Parse(vecStrings[2], System.Globalization.CultureInfo.InvariantCulture));
|
Position = new Vector3(float.Parse(vecStrings[0], System.Globalization.CultureInfo.InvariantCulture), float.Parse(vecStrings[1], System.Globalization.CultureInfo.InvariantCulture), float.Parse(vecStrings[2], System.Globalization.CultureInfo.InvariantCulture));
|
||||||
|
|
|
||||||
|
|
@ -342,11 +342,11 @@ namespace OpenMetaverse.Assets
|
||||||
}
|
}
|
||||||
else if (key == "name")
|
else if (key == "name")
|
||||||
{
|
{
|
||||||
name = val.Remove(val.LastIndexOf("|"));
|
name = val.Remove(val.LastIndexOf("|", StringComparison.Ordinal));
|
||||||
}
|
}
|
||||||
else if (key == "desc")
|
else if (key == "desc")
|
||||||
{
|
{
|
||||||
description = val.Remove(val.LastIndexOf("|"));
|
description = val.Remove(val.LastIndexOf("|", StringComparison.Ordinal));
|
||||||
}
|
}
|
||||||
else if (key == "creation_date")
|
else if (key == "creation_date")
|
||||||
{
|
{
|
||||||
|
|
@ -388,7 +388,7 @@ namespace OpenMetaverse.Assets
|
||||||
{
|
{
|
||||||
BodyText += lines[i++] + "\n";
|
BodyText += lines[i++] + "\n";
|
||||||
}
|
}
|
||||||
BodyText = BodyText.Remove(BodyText.LastIndexOf("}"));
|
BodyText = BodyText.Remove(BodyText.LastIndexOf("}", StringComparison.Ordinal));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,8 @@ namespace OpenMetaverse
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj is GridRegion)
|
if (obj is GridRegion region)
|
||||||
return Equals((GridRegion)obj);
|
return Equals(region);
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -811,7 +811,8 @@ namespace OpenMetaverse
|
||||||
}
|
}
|
||||||
|
|
||||||
// find stale entries (people who left the sim)
|
// find stale entries (people who left the sim)
|
||||||
List<UUID> removedEntries = e.Simulator.avatarPositions.FindAll(delegate(UUID findID) { return !coarseEntries.ContainsKey(findID); });
|
List<UUID> removedEntries = e.Simulator.avatarPositions.FindAll(
|
||||||
|
findID => !coarseEntries.ContainsKey(findID));
|
||||||
|
|
||||||
// anyone who was not listed in the previous update
|
// anyone who was not listed in the previous update
|
||||||
List<UUID> newEntries = new List<UUID>();
|
List<UUID> newEntries = new List<UUID>();
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace OpenMetaverse.Messages
|
||||||
|
|
||||||
public static OSD FromIP(IPAddress address)
|
public static OSD FromIP(IPAddress address)
|
||||||
{
|
{
|
||||||
if (address != null && address != IPAddress.Any)
|
if (address != null && !Equals(address, IPAddress.Any))
|
||||||
return OSD.FromBinary(address.GetAddressBytes());
|
return OSD.FromBinary(address.GetAddressBytes());
|
||||||
else
|
else
|
||||||
return new OSD();
|
return new OSD();
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,8 @@ namespace OpenMetaverse
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="e">A ParticleUpdateEventArgs object containing
|
/// <param name="e">A ParticleUpdateEventArgs object containing
|
||||||
/// the data sent from the simulator</param>
|
/// the data sent from the simulator</param>
|
||||||
protected virtual void OnParticleUpdate(ParticleUpdateEventArgs e) {
|
protected virtual void OnParticleUpdate(ParticleUpdateEventArgs e)
|
||||||
|
{
|
||||||
EventHandler<ParticleUpdateEventArgs> handler = m_ParticleUpdate;
|
EventHandler<ParticleUpdateEventArgs> handler = m_ParticleUpdate;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
handler(this, e);
|
handler(this, e);
|
||||||
|
|
@ -305,7 +306,8 @@ namespace OpenMetaverse
|
||||||
#endregion AvatarUpdate event
|
#endregion AvatarUpdate event
|
||||||
|
|
||||||
#region TerseObjectUpdate event
|
#region TerseObjectUpdate event
|
||||||
public event EventHandler<ParticleUpdateEventArgs> ParticleUpdate {
|
public event EventHandler<ParticleUpdateEventArgs> ParticleUpdate
|
||||||
|
{
|
||||||
add { lock (m_ParticleUpdateLock) { m_ParticleUpdate += value; } }
|
add { lock (m_ParticleUpdateLock) { m_ParticleUpdate += value; } }
|
||||||
remove { lock (m_ParticleUpdateLock) { m_ParticleUpdate -= value; } }
|
remove { lock (m_ParticleUpdateLock) { m_ParticleUpdate -= value; } }
|
||||||
}
|
}
|
||||||
|
|
@ -1685,16 +1687,18 @@ namespace OpenMetaverse
|
||||||
{
|
{
|
||||||
ObjectMediaNavigateMessage req = new ObjectMediaNavigateMessage
|
ObjectMediaNavigateMessage req = new ObjectMediaNavigateMessage
|
||||||
{
|
{
|
||||||
PrimID = primID, URL = newURL, Face = face
|
PrimID = primID,
|
||||||
|
URL = newURL,
|
||||||
|
Face = face
|
||||||
};
|
};
|
||||||
|
|
||||||
request.OnComplete += (client, result, error) =>
|
request.OnComplete += (client, result, error) =>
|
||||||
|
{
|
||||||
|
if (error != null)
|
||||||
{
|
{
|
||||||
if (error != null)
|
Logger.Log("ObjectMediaNavigate: " + error.Message, Helpers.LogLevel.Error, Client);
|
||||||
{
|
}
|
||||||
Logger.Log("ObjectMediaNavigate: " + error.Message, Helpers.LogLevel.Error, Client);
|
};
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
request.BeginGetResponse(req.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
|
request.BeginGetResponse(req.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
@ -1716,15 +1720,15 @@ namespace OpenMetaverse
|
||||||
CapsClient request;
|
CapsClient request;
|
||||||
if (sim.Caps != null && (request = Client.Network.CurrentSim.Caps.CreateCapsClient("ObjectMedia")) != null)
|
if (sim.Caps != null && (request = Client.Network.CurrentSim.Caps.CreateCapsClient("ObjectMedia")) != null)
|
||||||
{
|
{
|
||||||
ObjectMediaUpdate req = new ObjectMediaUpdate {PrimID = primID, FaceMedia = faceMedia, Verb = "UPDATE"};
|
ObjectMediaUpdate req = new ObjectMediaUpdate { PrimID = primID, FaceMedia = faceMedia, Verb = "UPDATE" };
|
||||||
|
|
||||||
request.OnComplete += (client, result, error) =>
|
request.OnComplete += (client, result, error) =>
|
||||||
|
{
|
||||||
|
if (error != null)
|
||||||
{
|
{
|
||||||
if (error != null)
|
Logger.Log("ObjectMediaUpdate: " + error.Message, Helpers.LogLevel.Error, Client);
|
||||||
{
|
}
|
||||||
Logger.Log("ObjectMediaUpdate: " + error.Message, Helpers.LogLevel.Error, Client);
|
};
|
||||||
}
|
|
||||||
};
|
|
||||||
request.BeginGetResponse(req.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
|
request.BeginGetResponse(req.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1744,44 +1748,42 @@ namespace OpenMetaverse
|
||||||
CapsClient request;
|
CapsClient request;
|
||||||
if (sim.Caps != null && (request = Client.Network.CurrentSim.Caps.CreateCapsClient("ObjectMedia")) != null)
|
if (sim.Caps != null && (request = Client.Network.CurrentSim.Caps.CreateCapsClient("ObjectMedia")) != null)
|
||||||
{
|
{
|
||||||
ObjectMediaRequest req = new ObjectMediaRequest {PrimID = primID, Verb = "GET"};
|
ObjectMediaRequest req = new ObjectMediaRequest { PrimID = primID, Verb = "GET" };
|
||||||
|
|
||||||
request.OnComplete += (client, result, error) =>
|
request.OnComplete += (client, result, error) =>
|
||||||
|
{
|
||||||
|
if (result == null)
|
||||||
{
|
{
|
||||||
if (result == null)
|
Logger.Log("Failed retrieving ObjectMedia data", Helpers.LogLevel.Error, Client);
|
||||||
|
try { callback(false, string.Empty, null); }
|
||||||
|
catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); }
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectMediaMessage msg = new ObjectMediaMessage();
|
||||||
|
msg.Deserialize((OSDMap)result);
|
||||||
|
|
||||||
|
if (msg.Request is ObjectMediaResponse response)
|
||||||
|
{
|
||||||
|
if (Client.Settings.OBJECT_TRACKING)
|
||||||
{
|
{
|
||||||
Logger.Log("Failed retrieving ObjectMedia data", Helpers.LogLevel.Error, Client);
|
Primitive prim = sim.ObjectsPrimitives.Find((Primitive p) => p.ID == primID);
|
||||||
try { callback(false, string.Empty, null); }
|
if (prim != null)
|
||||||
catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); }
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectMediaMessage msg = new ObjectMediaMessage();
|
|
||||||
msg.Deserialize((OSDMap)result);
|
|
||||||
|
|
||||||
if (msg.Request is ObjectMediaResponse)
|
|
||||||
{
|
|
||||||
ObjectMediaResponse response = (ObjectMediaResponse)msg.Request;
|
|
||||||
|
|
||||||
if (Client.Settings.OBJECT_TRACKING)
|
|
||||||
{
|
{
|
||||||
Primitive prim = sim.ObjectsPrimitives.Find((Primitive p) => { return p.ID == primID; });
|
prim.MediaVersion = response.Version;
|
||||||
if (prim != null)
|
prim.FaceMedia = response.FaceMedia;
|
||||||
{
|
|
||||||
prim.MediaVersion = response.Version;
|
|
||||||
prim.FaceMedia = response.FaceMedia;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try { callback(true, response.Version, response.FaceMedia); }
|
try { callback(true, response.Version, response.FaceMedia); }
|
||||||
catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); }
|
catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try { callback(false, string.Empty, null); }
|
try { callback(false, string.Empty, null); }
|
||||||
catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); }
|
catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
request.BeginGetResponse(req.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
|
request.BeginGetResponse(req.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
@ -2109,15 +2111,16 @@ namespace OpenMetaverse
|
||||||
prim.Rotation = objectupdate.Rotation;
|
prim.Rotation = objectupdate.Rotation;
|
||||||
prim.AngularVelocity = objectupdate.AngularVelocity;
|
prim.AngularVelocity = objectupdate.AngularVelocity;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
EventHandler<PrimEventArgs> handler = m_ObjectUpdate;
|
EventHandler<PrimEventArgs> handler = m_ObjectUpdate;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
{
|
{
|
||||||
ThreadPool.QueueUserWorkItem(delegate(object o)
|
ThreadPool.QueueUserWorkItem(delegate (object o)
|
||||||
{ handler(this, new PrimEventArgs(simulator, prim, update.RegionData.TimeDilation, isNewObject, attachment)); });
|
{ handler(this, new PrimEventArgs(simulator, prim, update.RegionData.TimeDilation, isNewObject, attachment)); });
|
||||||
}
|
}
|
||||||
//OnParticleUpdate handler replacing decode particles, PCode.Particle system appears to be deprecated this is a fix
|
//OnParticleUpdate handler replacing decode particles, PCode.Particle system appears to be deprecated this is a fix
|
||||||
if (prim.ParticleSys.PartMaxAge != 0) {
|
if (prim.ParticleSys.PartMaxAge != 0)
|
||||||
|
{
|
||||||
OnParticleUpdate(new ParticleUpdateEventArgs(simulator, prim.ParticleSys, prim));
|
OnParticleUpdate(new ParticleUpdateEventArgs(simulator, prim.ParticleSys, prim));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2334,7 +2337,7 @@ namespace OpenMetaverse
|
||||||
EventHandler<TerseObjectUpdateEventArgs> handler = m_TerseObjectUpdate;
|
EventHandler<TerseObjectUpdateEventArgs> handler = m_TerseObjectUpdate;
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
{
|
{
|
||||||
ThreadPool.QueueUserWorkItem(delegate(object o)
|
ThreadPool.QueueUserWorkItem(delegate (object o)
|
||||||
{ handler(this, new TerseObjectUpdateEventArgs(simulator, obj, update, terse.RegionData.TimeDilation)); });
|
{ handler(this, new TerseObjectUpdateEventArgs(simulator, obj, update, terse.RegionData.TimeDilation)); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2500,7 +2503,7 @@ namespace OpenMetaverse
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
// Text color
|
// Text color
|
||||||
prim.TextColor = new Color4(block.Data, i,false,true);
|
prim.TextColor = new Color4(block.Data, i, false, true);
|
||||||
i += 4;
|
i += 4;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -2626,7 +2629,7 @@ namespace OpenMetaverse
|
||||||
catch (IndexOutOfRangeException ex)
|
catch (IndexOutOfRangeException ex)
|
||||||
{
|
{
|
||||||
Logger.Log("Error decoding an ObjectUpdateCompressed packet", Helpers.LogLevel.Warning, Client, ex);
|
Logger.Log("Error decoding an ObjectUpdateCompressed packet", Helpers.LogLevel.Warning, Client, ex);
|
||||||
Logger.Log(block.ToString(), Helpers.LogLevel.Warning); // ? Might want to look into what .ToString here returns
|
Logger.Log(block.ToString(), Helpers.LogLevel.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2656,9 +2659,9 @@ namespace OpenMetaverse
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ids.Add(localID);
|
ids.Add(localID);
|
||||||
}
|
}
|
||||||
RequestObjects(simulator, ids);
|
RequestObjects(simulator, ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2808,7 +2811,7 @@ namespace OpenMetaverse
|
||||||
if (Client.Settings.OBJECT_TRACKING)
|
if (Client.Settings.OBJECT_TRACKING)
|
||||||
{
|
{
|
||||||
Primitive findPrim = simulator.ObjectsPrimitives.Find(
|
Primitive findPrim = simulator.ObjectsPrimitives.Find(
|
||||||
delegate(Primitive prim) { return prim.ID == props.ObjectID; });
|
prim => prim.ID == props.ObjectID);
|
||||||
|
|
||||||
if (findPrim != null)
|
if (findPrim != null)
|
||||||
{
|
{
|
||||||
|
|
@ -2858,7 +2861,7 @@ namespace OpenMetaverse
|
||||||
if (Client.Settings.OBJECT_TRACKING)
|
if (Client.Settings.OBJECT_TRACKING)
|
||||||
{
|
{
|
||||||
Primitive findPrim = simulator.ObjectsPrimitives.Find(
|
Primitive findPrim = simulator.ObjectsPrimitives.Find(
|
||||||
delegate(Primitive prim) { return prim.ID == op.ObjectData.ObjectID; });
|
prim => prim.ID == op.ObjectData.ObjectID);
|
||||||
|
|
||||||
if (findPrim != null)
|
if (findPrim != null)
|
||||||
{
|
{
|
||||||
|
|
@ -3132,7 +3135,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
#region Object Tracking Link
|
#region Object Tracking Link
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="simulator"></param>
|
/// <param name="simulator"></param>
|
||||||
|
|
@ -3254,7 +3257,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
// Iterate through all of this sims avatars
|
// Iterate through all of this sims avatars
|
||||||
sim.ObjectsAvatars.ForEach(
|
sim.ObjectsAvatars.ForEach(
|
||||||
delegate(Avatar avatar)
|
delegate (Avatar avatar)
|
||||||
{
|
{
|
||||||
#region Linear Motion
|
#region Linear Motion
|
||||||
// Only do movement interpolation (extrapolation) when there is a non-zero velocity but
|
// Only do movement interpolation (extrapolation) when there is a non-zero velocity but
|
||||||
|
|
@ -3271,7 +3274,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
// Iterate through all of this sims primitives
|
// Iterate through all of this sims primitives
|
||||||
sim.ObjectsPrimitives.ForEach(
|
sim.ObjectsPrimitives.ForEach(
|
||||||
delegate(Primitive prim)
|
delegate (Primitive prim)
|
||||||
{
|
{
|
||||||
if (prim.Joint == JointType.Invalid)
|
if (prim.Joint == JointType.Invalid)
|
||||||
{
|
{
|
||||||
|
|
@ -3472,7 +3475,8 @@ namespace OpenMetaverse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ParticleUpdateEventArgs : EventArgs {
|
public class ParticleUpdateEventArgs : EventArgs
|
||||||
|
{
|
||||||
private readonly Simulator m_Simulator;
|
private readonly Simulator m_Simulator;
|
||||||
private readonly Primitive.ParticleSystem m_ParticleSystem;
|
private readonly Primitive.ParticleSystem m_ParticleSystem;
|
||||||
private readonly Primitive m_Source;
|
private readonly Primitive m_Source;
|
||||||
|
|
@ -3490,7 +3494,8 @@ namespace OpenMetaverse
|
||||||
/// <param name="simulator">The simulator the packet originated from</param>
|
/// <param name="simulator">The simulator the packet originated from</param>
|
||||||
/// <param name="particlesystem">The ParticleSystem data</param>
|
/// <param name="particlesystem">The ParticleSystem data</param>
|
||||||
/// <param name="source">The Primitive source</param>
|
/// <param name="source">The Primitive source</param>
|
||||||
public ParticleUpdateEventArgs(Simulator simulator, Primitive.ParticleSystem particlesystem, Primitive source) {
|
public ParticleUpdateEventArgs(Simulator simulator, Primitive.ParticleSystem particlesystem, Primitive source)
|
||||||
|
{
|
||||||
this.m_Simulator = simulator;
|
this.m_Simulator = simulator;
|
||||||
this.m_ParticleSystem = particlesystem;
|
this.m_ParticleSystem = particlesystem;
|
||||||
this.m_Source = source;
|
this.m_Source = source;
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeTerseUpdate(string fieldName, object fieldData)
|
private static string DecodeTerseUpdate(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] block = (byte[]) fieldData;
|
byte[] block = (byte[])fieldData;
|
||||||
int i = 4;
|
int i = 4;
|
||||||
|
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
|
|
@ -182,7 +182,7 @@ namespace OpenMetaverse.Packets
|
||||||
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
||||||
"State",
|
"State",
|
||||||
point,
|
point,
|
||||||
"(" + (AttachmentPoint) point + ")",
|
"(" + (AttachmentPoint)point + ")",
|
||||||
"AttachmentPoint");
|
"AttachmentPoint");
|
||||||
|
|
||||||
// Avatar boolean
|
// Avatar boolean
|
||||||
|
|
@ -256,7 +256,7 @@ namespace OpenMetaverse.Packets
|
||||||
private static string DecodeObjectCompressedData(string fieldName, object fieldData)
|
private static string DecodeObjectCompressedData(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
byte[] block = (byte[]) fieldData;
|
byte[] block = (byte[])fieldData;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
// UUID
|
// UUID
|
||||||
|
|
@ -267,7 +267,7 @@ namespace OpenMetaverse.Packets
|
||||||
i += 16;
|
i += 16;
|
||||||
|
|
||||||
// Local ID
|
// Local ID
|
||||||
uint LocalID = (uint) (block[i++] + (block[i++] << 8) +
|
uint LocalID = (uint)(block[i++] + (block[i++] << 8) +
|
||||||
(block[i++] << 16) + (block[i++] << 24));
|
(block[i++] << 16) + (block[i++] << 24));
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
|
|
@ -275,19 +275,19 @@ namespace OpenMetaverse.Packets
|
||||||
LocalID,
|
LocalID,
|
||||||
"Uint32");
|
"Uint32");
|
||||||
// PCode
|
// PCode
|
||||||
PCode pcode = (PCode) block[i++];
|
PCode pcode = (PCode)block[i++];
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
||||||
"PCode",
|
"PCode",
|
||||||
(int) pcode,
|
(int)pcode,
|
||||||
"(" + pcode + ")",
|
"(" + pcode + ")",
|
||||||
"PCode");
|
"PCode");
|
||||||
|
|
||||||
// State
|
// State
|
||||||
AttachmentPoint point = (AttachmentPoint) block[i++];
|
AttachmentPoint point = (AttachmentPoint)block[i++];
|
||||||
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
||||||
"State",
|
"State",
|
||||||
(byte) point,
|
(byte)point,
|
||||||
"(" + point + ")",
|
"(" + point + ")",
|
||||||
"AttachmentPoint");
|
"AttachmentPoint");
|
||||||
|
|
||||||
|
|
@ -302,14 +302,14 @@ namespace OpenMetaverse.Packets
|
||||||
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
||||||
"Material",
|
"Material",
|
||||||
block[i],
|
block[i],
|
||||||
"(" + (Material) block[i++] + ")",
|
"(" + (Material)block[i++] + ")",
|
||||||
"Material");
|
"Material");
|
||||||
|
|
||||||
// Click action
|
// Click action
|
||||||
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-3} {2,-36} [{3}]" + Environment.NewLine,
|
||||||
"ClickAction",
|
"ClickAction",
|
||||||
block[i],
|
block[i],
|
||||||
"(" + (ClickAction) block[i++] + ")",
|
"(" + (ClickAction)block[i++] + ")",
|
||||||
"ClickAction");
|
"ClickAction");
|
||||||
|
|
||||||
// Scale
|
// Scale
|
||||||
|
|
@ -334,11 +334,11 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
i += 12;
|
i += 12;
|
||||||
// Compressed flags
|
// Compressed flags
|
||||||
CompressedFlags flags = (CompressedFlags) Utils.BytesToUInt(block, i);
|
CompressedFlags flags = (CompressedFlags)Utils.BytesToUInt(block, i);
|
||||||
result.AppendFormat("{0,30}: {1,-10} {2,-29} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-10} {2,-29} [{3}]" + Environment.NewLine,
|
||||||
"CompressedFlags",
|
"CompressedFlags",
|
||||||
Utils.BytesToUInt(block, i),
|
Utils.BytesToUInt(block, i),
|
||||||
"(" + (CompressedFlags) Utils.BytesToUInt(block, i) + ")",
|
"(" + (CompressedFlags)Utils.BytesToUInt(block, i) + ")",
|
||||||
"UInt");
|
"UInt");
|
||||||
i += 4;
|
i += 4;
|
||||||
|
|
||||||
|
|
@ -364,7 +364,7 @@ namespace OpenMetaverse.Packets
|
||||||
{
|
{
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"ParentID",
|
"ParentID",
|
||||||
(uint) (block[i++] + (block[i++] << 8) +
|
(uint)(block[i++] + (block[i++] << 8) +
|
||||||
(block[i++] << 16) + (block[i++] << 24)),
|
(block[i++] << 16) + (block[i++] << 24)),
|
||||||
"UInt");
|
"UInt");
|
||||||
}
|
}
|
||||||
|
|
@ -375,7 +375,7 @@ namespace OpenMetaverse.Packets
|
||||||
result.AppendFormat("{0,30}: {1,-2} {2,-37} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-2} {2,-37} [{3}]" + Environment.NewLine,
|
||||||
"TreeSpecies",
|
"TreeSpecies",
|
||||||
block[i++],
|
block[i++],
|
||||||
"(" + (Tree) block[i] + ")",
|
"(" + (Tree)block[i] + ")",
|
||||||
"Tree");
|
"Tree");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -397,7 +397,7 @@ namespace OpenMetaverse.Packets
|
||||||
string text = String.Empty;
|
string text = String.Empty;
|
||||||
while (block[i] != 0)
|
while (block[i] != 0)
|
||||||
{
|
{
|
||||||
text += (char) block[i];
|
text += (char)block[i];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,7 +423,7 @@ namespace OpenMetaverse.Packets
|
||||||
string text = String.Empty;
|
string text = String.Empty;
|
||||||
while (block[i] != 0)
|
while (block[i] != 0)
|
||||||
{
|
{
|
||||||
text += (char) block[i];
|
text += (char)block[i];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -470,7 +470,7 @@ namespace OpenMetaverse.Packets
|
||||||
result.AppendFormat("{0,30}: {1,-2} {2,-37} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-2} {2,-37} [{3}]" + Environment.NewLine,
|
||||||
"SoundFlags",
|
"SoundFlags",
|
||||||
block[i++],
|
block[i++],
|
||||||
"(" + (SoundFlags) block[i] + ")",
|
"(" + (SoundFlags)block[i] + ")",
|
||||||
"SoundFlags");
|
"SoundFlags");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
|
|
@ -486,7 +486,7 @@ namespace OpenMetaverse.Packets
|
||||||
string text = string.Empty;
|
string text = string.Empty;
|
||||||
while (block[i] != 0)
|
while (block[i] != 0)
|
||||||
{
|
{
|
||||||
text += (char) block[i];
|
text += (char)block[i];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -514,7 +514,7 @@ namespace OpenMetaverse.Packets
|
||||||
result.AppendFormat("{0,30}: {1,-2} {2,-37} [{3}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-2} {2,-37} [{3}]" + Environment.NewLine,
|
||||||
"PathCurve",
|
"PathCurve",
|
||||||
block[i],
|
block[i],
|
||||||
"(" + (PathCurve) block[i++] + ")",
|
"(" + (PathCurve)block[i++] + ")",
|
||||||
"PathCurve");
|
"PathCurve");
|
||||||
|
|
||||||
ushort pathBegin = Utils.BytesToUInt16(block, i);
|
ushort pathBegin = Utils.BytesToUInt16(block, i);
|
||||||
|
|
@ -543,37 +543,37 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathShearX",
|
"PathShearX",
|
||||||
Primitive.UnpackPathShear((sbyte) block[i++]),
|
Primitive.UnpackPathShear((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathShearY",
|
"PathShearY",
|
||||||
Primitive.UnpackPathShear((sbyte) block[i++]),
|
Primitive.UnpackPathShear((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathTwist",
|
"PathTwist",
|
||||||
Primitive.UnpackPathTwist((sbyte) block[i++]),
|
Primitive.UnpackPathTwist((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathTwistBegin",
|
"PathTwistBegin",
|
||||||
Primitive.UnpackPathTwist((sbyte) block[i++]),
|
Primitive.UnpackPathTwist((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathRadiusOffset",
|
"PathRadiusOffset",
|
||||||
Primitive.UnpackPathTwist((sbyte) block[i++]),
|
Primitive.UnpackPathTwist((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathTaperX",
|
"PathTaperX",
|
||||||
Primitive.UnpackPathTaper((sbyte) block[i++]),
|
Primitive.UnpackPathTaper((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathTaperY",
|
"PathTaperY",
|
||||||
Primitive.UnpackPathTaper((sbyte) block[i++]),
|
Primitive.UnpackPathTaper((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
|
|
@ -583,7 +583,7 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
"PathSkew",
|
"PathSkew",
|
||||||
Primitive.UnpackPathTwist((sbyte) block[i++]),
|
Primitive.UnpackPathTwist((sbyte)block[i++]),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
|
|
@ -612,7 +612,7 @@ namespace OpenMetaverse.Packets
|
||||||
Primitive.UnpackProfileHollow(profileHollow),
|
Primitive.UnpackProfileHollow(profileHollow),
|
||||||
"float");
|
"float");
|
||||||
|
|
||||||
int textureEntryLength = (int) Utils.BytesToUInt(block, i);
|
int textureEntryLength = (int)Utils.BytesToUInt(block, i);
|
||||||
i += 4;
|
i += 4;
|
||||||
//prim.Textures = new Primitive.TextureEntry(block, i, textureEntryLength);
|
//prim.Textures = new Primitive.TextureEntry(block, i, textureEntryLength);
|
||||||
String s = DecodeTextureEntry("TextureEntry", new Primitive.TextureEntry(block, i, textureEntryLength));
|
String s = DecodeTextureEntry("TextureEntry", new Primitive.TextureEntry(block, i, textureEntryLength));
|
||||||
|
|
@ -643,11 +643,11 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeObjectData(string fieldName, object fieldData)
|
private static string DecodeObjectData(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] data = (byte[]) fieldData;
|
byte[] data = (byte[])fieldData;
|
||||||
if (data.Length == 1)
|
if (data.Length == 1)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName + " (Tree Species)",30}: {fieldData,2} {"(" + (Tree) data[0] + ")",-38} [{fieldData.GetType().Name}]";
|
$"{fieldName + " (Tree Species)",30}: {fieldData,2} {"(" + (Tree)data[0] + ")",-38} [{fieldData.GetType().Name}]";
|
||||||
}
|
}
|
||||||
else if (data.Length == 76)
|
else if (data.Length == 76)
|
||||||
{
|
{
|
||||||
|
|
@ -734,7 +734,7 @@ namespace OpenMetaverse.Packets
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Utils.BytesToHexString((byte[]) fieldData, $"{fieldName,30}");
|
return Utils.BytesToHexString((byte[])fieldData, $"{fieldName,30}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -745,7 +745,7 @@ namespace OpenMetaverse.Packets
|
||||||
if (fieldData is Primitive.TextureAnimation data)
|
if (fieldData is Primitive.TextureAnimation data)
|
||||||
textureAnim = data;
|
textureAnim = data;
|
||||||
else
|
else
|
||||||
textureAnim = new Primitive.TextureAnimation((byte[]) fieldData, 0);
|
textureAnim = new Primitive.TextureAnimation((byte[])fieldData, 0);
|
||||||
|
|
||||||
result.AppendFormat("{0,30}", " <TextureAnimation>" + Environment.NewLine);
|
result.AppendFormat("{0,30}", " <TextureAnimation>" + Environment.NewLine);
|
||||||
GenericTypeDecoder(textureAnim, ref result);
|
GenericTypeDecoder(textureAnim, ref result);
|
||||||
|
|
@ -756,26 +756,26 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeEstateParameter(string fieldName, object fieldData)
|
private static string DecodeEstateParameter(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] bytes = (byte[]) fieldData;
|
byte[] bytes = (byte[])fieldData;
|
||||||
|
|
||||||
if (bytes.Length == 17)
|
if (bytes.Length == 17)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {new UUID((byte[]) fieldData, 0),-40} [UUID]";
|
return $"{fieldName,30}: {new UUID((byte[])fieldData, 0),-40} [UUID]";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {Utils.BytesToString((byte[]) fieldData),-40} [Byte[]]";
|
return $"{fieldName,30}: {Utils.BytesToString((byte[])fieldData),-40} [Byte[]]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeNameValue(string fieldName, object fieldData)
|
private static string DecodeNameValue(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
NameValue[] nameValues = null;
|
NameValue[] nameValues = null;
|
||||||
if (fieldData is NameValue[])
|
if (fieldData is NameValue[] data)
|
||||||
nameValues = fieldData as NameValue[];
|
nameValues = data;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string nameValue = Utils.BytesToString((byte[]) fieldData);
|
string nameValue = Utils.BytesToString((byte[])fieldData);
|
||||||
if (nameValue.Length > 0)
|
if (nameValue.Length > 0)
|
||||||
{
|
{
|
||||||
string[] lines = nameValue.Split('\n');
|
string[] lines = nameValue.Split('\n');
|
||||||
|
|
@ -811,7 +811,7 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeObjectExtraParams(string fieldName, object fieldData)
|
private static string DecodeObjectExtraParams(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] data = (byte[]) fieldData;
|
byte[] data = (byte[])fieldData;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//int totalLength = 1;
|
//int totalLength = 1;
|
||||||
|
|
@ -827,7 +827,7 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
for (int k = 0; k < extraParamCount; k++)
|
for (int k = 0; k < extraParamCount; k++)
|
||||||
{
|
{
|
||||||
ExtraParamType type = (ExtraParamType) Utils.BytesToUInt16(data, i);
|
ExtraParamType type = (ExtraParamType)Utils.BytesToUInt16(data, i);
|
||||||
i += 2;
|
i += 2;
|
||||||
|
|
||||||
uint paramLength = Utils.BytesToUInt(data, i);
|
uint paramLength = Utils.BytesToUInt(data, i);
|
||||||
|
|
@ -841,13 +841,13 @@ namespace OpenMetaverse.Packets
|
||||||
sculpt = new Primitive.SculptData(data, i);
|
sculpt = new Primitive.SculptData(data, i);
|
||||||
else if (type == ExtraParamType.Mesh)
|
else if (type == ExtraParamType.Mesh)
|
||||||
mesh = new Primitive.SculptData(data, i);
|
mesh = new Primitive.SculptData(data, i);
|
||||||
else if ((byte) type == 0x70)
|
else if ((byte)type == 0x70)
|
||||||
{
|
{
|
||||||
hasMeshFlags = true;
|
hasMeshFlags = true;
|
||||||
meshFlags = Utils.BytesToUInt(data, i);
|
meshFlags = Utils.BytesToUInt(data, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
i += (int) paramLength;
|
i += (int)paramLength;
|
||||||
//totalLength += (int)paramLength + 6;
|
//totalLength += (int)paramLength + 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -899,7 +899,7 @@ namespace OpenMetaverse.Packets
|
||||||
if (fieldData is Primitive.ParticleSystem data)
|
if (fieldData is Primitive.ParticleSystem data)
|
||||||
particleSys = data;
|
particleSys = data;
|
||||||
else
|
else
|
||||||
particleSys = new Primitive.ParticleSystem((byte[]) fieldData, 0);
|
particleSys = new Primitive.ParticleSystem((byte[])fieldData, 0);
|
||||||
|
|
||||||
result.AppendFormat("{0,30}", "<ParticleSystem>" + Environment.NewLine);
|
result.AppendFormat("{0,30}", "<ParticleSystem>" + Environment.NewLine);
|
||||||
GenericTypeDecoder(particleSys, ref result);
|
GenericTypeDecoder(particleSys, ref result);
|
||||||
|
|
@ -931,67 +931,67 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeObjectPCode(string fieldName, object fieldData)
|
private static string DecodeObjectPCode(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-3} {"(" + (PCode) (byte) fieldData + ")",-36} [PCode]";
|
return $"{fieldName,30}: {fieldData,-3} {"(" + (PCode)(byte)fieldData + ")",-36} [PCode]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeImageType(string fieldName, object fieldData)
|
private static string DecodeImageType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-3} {"(" + (ImageType) (byte) fieldData + ")",-36} [ImageType]";
|
return $"{fieldName,30}: {fieldData,-3} {"(" + (ImageType)(byte)fieldData + ")",-36} [ImageType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeImageCodec(string fieldName, object fieldData)
|
private static string DecodeImageCodec(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-3} {"(" + (ImageCodec) (byte) fieldData + ")",-36} [ImageCodec]";
|
return $"{fieldName,30}: {fieldData,-3} {"(" + (ImageCodec)(byte)fieldData + ")",-36} [ImageCodec]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeObjectMaterial(string fieldName, object fieldData)
|
private static string DecodeObjectMaterial(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-3} {"(" + (Material) (byte) fieldData + ")",-36} [Material]";
|
return $"{fieldName,30}: {fieldData,-3} {"(" + (Material)(byte)fieldData + ")",-36} [Material]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeObjectClickAction(string fieldName, object fieldData)
|
private static string DecodeObjectClickAction(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-3} {"(" + (ClickAction) (byte) fieldData + ")",-36} [ClickAction]";
|
return $"{fieldName,30}: {fieldData,-3} {"(" + (ClickAction)(byte)fieldData + ")",-36} [ClickAction]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeEventFlags(string fieldName, object fieldData)
|
private static string DecodeEventFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-3} {"(" + (DirectoryManager.EventFlags) (uint) fieldData + ")",-36} [EventFlags]";
|
$"{fieldName,30}: {fieldData,-3} {"(" + (DirectoryManager.EventFlags)(uint)fieldData + ")",-36} [EventFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeDirQueryFlags(string fieldName, object fieldData)
|
private static string DecodeDirQueryFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.DirFindFlags) (uint) fieldData + ")",-29} [DirectoryManager.DirFindFlags]";
|
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.DirFindFlags)(uint)fieldData + ")",-29} [DirectoryManager.DirFindFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeDirClassifiedQueryFlags(string fieldName, object fieldData)
|
private static string DecodeDirClassifiedQueryFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.ClassifiedQueryFlags) (uint) fieldData + ")",-29} [ClassifiedQueryFlags]";
|
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.ClassifiedQueryFlags)(uint)fieldData + ")",-29} [ClassifiedQueryFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeDirClassifiedFlags(string fieldName, object fieldData)
|
private static string DecodeDirClassifiedFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.ClassifiedFlags) (byte) fieldData + ")",-29} [ClassifiedFlags]";
|
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.ClassifiedFlags)(byte)fieldData + ")",-29} [ClassifiedFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeGroupPowers(string fieldName, object fieldData)
|
private static string DecodeGroupPowers(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-20} {"(" + (GroupPowers) (ulong) fieldData + ")",-19} [GroupPowers]";
|
return $"{fieldName,30}: {fieldData,-20} {"(" + (GroupPowers)(ulong)fieldData + ")",-19} [GroupPowers]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeParcelAcl(string fieldName, object fieldData)
|
private static string DecodeParcelAcl(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-10} {"(" + (AccessList) (uint) fieldData + ")",-29} [AccessList]";
|
return $"{fieldName,30}: {fieldData,-10} {"(" + (AccessList)(uint)fieldData + ")",-29} [AccessList]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string SearchTypeFlags(string fieldName, object fieldData)
|
private static string SearchTypeFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.SearchTypeFlags) (uint) fieldData + ")",-29} [DirectoryManager.SearchTypeFlags]";
|
$"{fieldName,30}: {fieldData,-10} {"(" + (DirectoryManager.SearchTypeFlags)(uint)fieldData + ")",-29} [DirectoryManager.SearchTypeFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeCategory(string fieldName, object fieldData)
|
private static string DecodeCategory(string fieldName, object fieldData)
|
||||||
|
|
@ -1001,42 +1001,42 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeObjectUpdateFlags(string fieldName, object fieldData)
|
private static string DecodeObjectUpdateFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-10} {"(" + (PrimFlags) (uint) fieldData + ")",-29} [PrimFlags]";
|
return $"{fieldName,30}: {fieldData,-10} {"(" + (PrimFlags)(uint)fieldData + ")",-29} [PrimFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeTeleportFlags(string fieldName, object fieldData)
|
private static string DecodeTeleportFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + (TeleportFlags) (uint) fieldData + ")",-29} [TeleportFlags]";
|
$"{fieldName,30}: {fieldData,-10} {"(" + (TeleportFlags)(uint)fieldData + ")",-29} [TeleportFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeScriptControls(string fieldName, object fieldData)
|
private static string DecodeScriptControls(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(uint) fieldData,-10} {"(" + (AgentManager.ControlFlags) (uint) fieldData + ")",-29} [AgentManager.ControlFlags]";
|
$"{fieldName,30}: {(uint)fieldData,-10} {"(" + (AgentManager.ControlFlags)(uint)fieldData + ")",-29} [AgentManager.ControlFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeColorField(string fieldName, object fieldData)
|
private static string DecodeColorField(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(fieldData.GetType().Name.Equals("Color4") ? (Color4) fieldData : new Color4((byte[]) fieldData, 0, false)),-40} [Color4]";
|
$"{fieldName,30}: {(fieldData.GetType().Name.Equals("Color4") ? (Color4)fieldData : new Color4((byte[])fieldData, 0, false)),-40} [Color4]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeTimeStamp(string fieldName, object fieldData)
|
private static string DecodeTimeStamp(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
if (fieldData is Int32 && (int) fieldData > 0)
|
if (fieldData is int data && data > 0)
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + Utils.UnixTimeToDateTime((int) fieldData) + ")",-29} [{fieldData.GetType().Name}]";
|
$"{fieldName,30}: {data,-10} {"(" + Utils.UnixTimeToDateTime(data) + ")",-29} [{data.GetType().Name}]";
|
||||||
else if (fieldData is uint && (uint) fieldData > 0)
|
else if (fieldData is uint u && u > 0)
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + Utils.UnixTimeToDateTime((uint) fieldData) + ")",-29} [{fieldData.GetType().Name}]";
|
$"{fieldName,30}: {u,-10} {"(" + Utils.UnixTimeToDateTime(u) + ")",-29} [{u.GetType().Name}]";
|
||||||
else
|
else
|
||||||
return $"{fieldName,30}: {fieldData,-40} [{fieldData.GetType().Name}]";
|
return $"{fieldName,30}: {fieldData,-40} [{fieldData.GetType().Name}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeBinaryBucket(string fieldName, object fieldData)
|
private static string DecodeBinaryBucket(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] bytes = (byte[]) fieldData;
|
byte[] bytes = (byte[])fieldData;
|
||||||
string bucket;
|
string bucket;
|
||||||
if (bytes.Length == 1)
|
if (bytes.Length == 1)
|
||||||
{
|
{
|
||||||
|
|
@ -1044,7 +1044,7 @@ namespace OpenMetaverse.Packets
|
||||||
}
|
}
|
||||||
else if (bytes.Length == 17)
|
else if (bytes.Length == 17)
|
||||||
{
|
{
|
||||||
bucket = $"{new UUID(bytes, 1),-36} {bytes[0]} ({(AssetType) (sbyte) bytes[0]})";
|
bucket = $"{new UUID(bytes, 1),-36} {bytes[0]} ({(AssetType)(sbyte)bytes[0]})";
|
||||||
}
|
}
|
||||||
else if (bytes.Length == 16
|
else if (bytes.Length == 16
|
||||||
) // the folder ID for the asset to be stored into if we accept an inventory offer
|
) // the folder ID for the asset to be stored into if we accept an inventory offer
|
||||||
|
|
@ -1061,56 +1061,56 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeBinaryToHexString(string fieldName, object fieldData)
|
private static string DecodeBinaryToHexString(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{Utils.BytesToHexString((byte[]) fieldData, $"{fieldName,30}"),30}";
|
return $"{Utils.BytesToHexString((byte[])fieldData, $"{fieldName,30}"),30}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeWearableType(string fieldName, object fieldData)
|
private static string DecodeWearableType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {(byte) fieldData,-2} {"(" + (WearableType) fieldData + ")",-37} [WearableType]";
|
return $"{fieldName,30}: {(byte)fieldData,-2} {"(" + (WearableType)fieldData + ")",-37} [WearableType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeInventoryType(string fieldName, object fieldData)
|
private static string DecodeInventoryType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(sbyte) fieldData,-2} {"(" + (AssetType) (sbyte) fieldData + ")",-37} [AssetType]";
|
$"{fieldName,30}: {(sbyte)fieldData,-2} {"(" + (AssetType)(sbyte)fieldData + ")",-37} [AssetType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeInventorySort(string fieldName, object fieldData)
|
private static string DecodeInventorySort(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-2} {"(" + (InventorySortOrder) (int) fieldData + ")",-37} [InventorySortOrder]";
|
$"{fieldName,30}: {fieldData,-2} {"(" + (InventorySortOrder)(int)fieldData + ")",-37} [InventorySortOrder]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeInventoryInvType(string fieldName, object fieldData)
|
private static string DecodeInventoryInvType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(sbyte) fieldData,-2} {"(" + (InventoryType) fieldData + ")",-37} [InventoryType]";
|
$"{fieldName,30}: {(sbyte)fieldData,-2} {"(" + (InventoryType)fieldData + ")",-37} [InventoryType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeFolderType(string fieldName, object fieldData)
|
private static string DecodeFolderType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {(sbyte) fieldData,-2} {"(" + (FolderType) fieldData + ")",-37} [Folderype]";
|
return $"{fieldName,30}: {(sbyte)fieldData,-2} {"(" + (FolderType)fieldData + ")",-37} [Folderype]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeInventoryFlags(string fieldName, object fieldData)
|
private static string DecodeInventoryFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(uint) fieldData,-2} {"(" + (InventoryItemFlags) (uint) fieldData + ")",-37} [InventoryItemFlags]";
|
$"{fieldName,30}: {(uint)fieldData,-2} {"(" + (InventoryItemFlags)(uint)fieldData + ")",-37} [InventoryItemFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeObjectSaleType(string fieldName, object fieldData)
|
private static string DecodeObjectSaleType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {(byte) fieldData,-2} {"(" + (SaleType) fieldData + ")",-37} [SaleType]";
|
return $"{fieldName,30}: {(byte)fieldData,-2} {"(" + (SaleType)fieldData + ")",-37} [SaleType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeRegionFlags(string fieldName, object fieldData)
|
private static string DecodeRegionFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (RegionFlags) (uint) fieldData + ")",-37} [RegionFlags]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (RegionFlags)(uint)fieldData + ")",-37} [RegionFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeTransferParams(string fieldName, object fieldData)
|
private static string DecodeTransferParams(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] paramData = (byte[]) fieldData;
|
byte[] paramData = (byte[])fieldData;
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
result.AppendLine(" <Params>");
|
result.AppendLine(" <Params>");
|
||||||
if (paramData.Length == 20)
|
if (paramData.Length == 20)
|
||||||
|
|
@ -1121,8 +1121,8 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-2} {2,-37} [AssetType]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-2} {2,-37} [AssetType]" + Environment.NewLine,
|
||||||
"AssetType",
|
"AssetType",
|
||||||
(sbyte) paramData[16],
|
(sbyte)paramData[16],
|
||||||
"(" + (AssetType) (sbyte) paramData[16] + ")");
|
"(" + (AssetType)(sbyte)paramData[16] + ")");
|
||||||
}
|
}
|
||||||
else if (paramData.Length == 100)
|
else if (paramData.Length == 100)
|
||||||
{
|
{
|
||||||
|
|
@ -1154,8 +1154,8 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
result.AppendFormat("{0,30}: {1,-2} {2,-37} [AssetType]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-2} {2,-37} [AssetType]" + Environment.NewLine,
|
||||||
"AssetType",
|
"AssetType",
|
||||||
(sbyte) paramData[96],
|
(sbyte)paramData[96],
|
||||||
"(" + (AssetType) (sbyte) paramData[96] + ")");
|
"(" + (AssetType)(sbyte)paramData[96] + ")");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1169,75 +1169,75 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeTransferChannelType(string fieldName, object fieldData)
|
private static string DecodeTransferChannelType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (ChannelType) (int) fieldData + ")",-37} [ChannelType]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (ChannelType)(int)fieldData + ")",-37} [ChannelType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeTransferSourceType(string fieldName, object fieldData)
|
private static string DecodeTransferSourceType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (SourceType) (int) fieldData + ")",-37} [SourceType]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (SourceType)(int)fieldData + ")",-37} [SourceType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeTransferTargetType(string fieldName, object fieldData)
|
private static string DecodeTransferTargetType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (TargetType) (int) fieldData + ")",-37} [TargetType]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (TargetType)(int)fieldData + ")",-37} [TargetType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeMapRequestFlags(string fieldName, object fieldData)
|
private static string DecodeMapRequestFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (GridLayerType) (uint) fieldData + ")",-37} [GridLayerType]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (GridLayerType)(uint)fieldData + ")",-37} [GridLayerType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeGridItemType(string fieldName, object fieldData)
|
private static string DecodeGridItemType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (GridItemType) (uint) fieldData + ")",-37} [GridItemType]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (GridItemType)(uint)fieldData + ")",-37} [GridItemType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeLayerDataType(string fieldName, object fieldData)
|
private static string DecodeLayerDataType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-2} {"(" + (TerrainPatch.LayerType) (byte) fieldData + ")",-37} [LayerType]";
|
$"{fieldName,30}: {fieldData,-2} {"(" + (TerrainPatch.LayerType)(byte)fieldData + ")",-37} [LayerType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeMapAccess(string fieldName, object fieldData)
|
private static string DecodeMapAccess(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (SimAccess) (byte) fieldData + ")",-37} [SimAccess]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (SimAccess)(byte)fieldData + ")",-37} [SimAccess]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeSimAccess(string fieldName, object fieldData)
|
private static string DecodeSimAccess(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {(byte) fieldData,-2} {"(" + (SimAccess) fieldData + ")",-37} [SimAccess]";
|
return $"{fieldName,30}: {(byte)fieldData,-2} {"(" + (SimAccess)fieldData + ")",-37} [SimAccess]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeAttachedSoundFlags(string fieldName, object fieldData)
|
private static string DecodeAttachedSoundFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {(byte) fieldData,-2} {"(" + (SoundFlags) fieldData + ")",-37} [SoundFlags]";
|
return $"{fieldName,30}: {(byte)fieldData,-2} {"(" + (SoundFlags)fieldData + ")",-37} [SoundFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static string DecodeChatSourceType(string fieldName, object fieldData)
|
private static string DecodeChatSourceType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (SourceType) (byte) fieldData + ")",-37} [SourceType]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (SourceType)(byte)fieldData + ")",-37} [SourceType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeChatChatType(string fieldName, object fieldData)
|
private static string DecodeChatChatType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {(byte) fieldData,-2} {"(" + (ChatType) fieldData + ")",-37} [ChatType]";
|
return $"{fieldName,30}: {(byte)fieldData,-2} {"(" + (ChatType)fieldData + ")",-37} [ChatType]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeChatAudible(string fieldName, object fieldData)
|
private static string DecodeChatAudible(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(byte) fieldData,-2} {"(" + (ChatAudibleLevel) (byte) fieldData + ")",-37} [ChatAudibleLevel]";
|
$"{fieldName,30}: {(byte)fieldData,-2} {"(" + (ChatAudibleLevel)(byte)fieldData + ")",-37} [ChatAudibleLevel]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeImageData(string fieldName, object fieldData)
|
private static string DecodeImageData(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{Utils.BytesToHexString((byte[]) fieldData, $"{fieldName,30}"),10}";
|
return $"{Utils.BytesToHexString((byte[])fieldData, $"{fieldName,30}"),10}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeTerseTextureEntry(string fieldName, object fieldData)
|
private static string DecodeTerseTextureEntry(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] block = (byte[]) fieldData;
|
byte[] block = (byte[])fieldData;
|
||||||
|
|
||||||
Primitive.TextureEntry te = new Primitive.TextureEntry(block, 4, block.Length - 4);
|
Primitive.TextureEntry te = new Primitive.TextureEntry(block, 4, block.Length - 4);
|
||||||
|
|
||||||
|
|
@ -1272,11 +1272,11 @@ namespace OpenMetaverse.Packets
|
||||||
private static string DecodeTextureEntry(string fieldName, object fieldData)
|
private static string DecodeTextureEntry(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
Primitive.TextureEntry te;
|
Primitive.TextureEntry te;
|
||||||
if (fieldData is Primitive.TextureEntry)
|
if (fieldData is Primitive.TextureEntry data)
|
||||||
te = (Primitive.TextureEntry) fieldData;
|
te = data;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
byte[] tebytes = (byte[]) fieldData;
|
byte[] tebytes = (byte[])fieldData;
|
||||||
te = new Primitive.TextureEntry(tebytes, 0, tebytes.Length);
|
te = new Primitive.TextureEntry(tebytes, 0, tebytes.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1355,24 +1355,24 @@ namespace OpenMetaverse.Packets
|
||||||
private static string DecodeDialog(string fieldName, object fieldData)
|
private static string DecodeDialog(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(byte) fieldData,-2} {"(" + (InstantMessageDialog) fieldData + ")",-37} [{fieldData.GetType().Name}]";
|
$"{fieldName,30}: {(byte)fieldData,-2} {"(" + (InstantMessageDialog)fieldData + ")",-37} [{fieldData.GetType().Name}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeControlFlags(string fieldName, object fieldData)
|
private static string DecodeControlFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-10} {"(" + (AgentManager.ControlFlags) (uint) fieldData + ")",-29} [{fieldData.GetType().Name}]";
|
$"{fieldName,30}: {fieldData,-10} {"(" + (AgentManager.ControlFlags)(uint)fieldData + ")",-29} [{fieldData.GetType().Name}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodePermissionMask(string fieldName, object fieldData)
|
private static string DecodePermissionMask(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {(uint) fieldData,-10} {"(" + (PermissionMask) fieldData + ")",-29} [{fieldData.GetType().Name}]";
|
$"{fieldName,30}: {(uint)fieldData,-10} {"(" + (PermissionMask)fieldData + ")",-29} [{fieldData.GetType().Name}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeViewerEffectTypeData(string fieldName, object fieldData)
|
private static string DecodeViewerEffectTypeData(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
byte[] data = (byte[]) fieldData;
|
byte[] data = (byte[])fieldData;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (data.Length == 56 || data.Length == 57)
|
if (data.Length == 56 || data.Length == 57)
|
||||||
{
|
{
|
||||||
|
|
@ -1385,7 +1385,7 @@ namespace OpenMetaverse.Packets
|
||||||
"Target ObjectID=" + targetObject);
|
"Target ObjectID=" + targetObject);
|
||||||
|
|
||||||
|
|
||||||
Helpers.GlobalPosToRegionHandle((float) targetPos.X, (float) targetPos.Y, out _, out _);
|
Helpers.GlobalPosToRegionHandle((float)targetPos.X, (float)targetPos.Y, out _, out _);
|
||||||
|
|
||||||
sb.AppendFormat("{0,30}: {1,-40} [Vector3d]", fieldName, targetPos);
|
sb.AppendFormat("{0,30}: {1,-40} [Vector3d]", fieldName, targetPos);
|
||||||
|
|
||||||
|
|
@ -1393,7 +1393,7 @@ namespace OpenMetaverse.Packets
|
||||||
{
|
{
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendFormat("{0,30}: {1,-17} {2,-22} [Byte]", fieldName, "Point At Type=" + data[56],
|
sb.AppendFormat("{0,30}: {1,-17} {2,-22} [Byte]", fieldName, "Point At Type=" + data[56],
|
||||||
"(" + (PointAtType) data[56] + ")");
|
"(" + (PointAtType)data[56] + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
|
|
@ -1407,32 +1407,32 @@ namespace OpenMetaverse.Packets
|
||||||
|
|
||||||
private static string DecodeAgentState(string fieldName, object fieldData)
|
private static string DecodeAgentState(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (AgentState) (byte) fieldData + ")",-37} [AgentState]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (AgentState)(byte)fieldData + ")",-37} [AgentState]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeAgentFlags(string fieldName, object fieldData)
|
private static string DecodeAgentFlags(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return $"{fieldName,30}: {fieldData,-2} {"(" + (AgentFlags) (byte) fieldData + ")",-37} [AgentFlags]";
|
return $"{fieldName,30}: {fieldData,-2} {"(" + (AgentFlags)(byte)fieldData + ")",-37} [AgentFlags]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeObjectState(string fieldName, object fieldData)
|
private static string DecodeObjectState(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-2} {"(" + (AttachmentPoint) (byte) fieldData + ")",-37} [AttachmentPoint]";
|
$"{fieldName,30}: {fieldData,-2} {"(" + (AttachmentPoint)(byte)fieldData + ")",-37} [AttachmentPoint]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeViewerEffectType(string fieldName, object fieldData)
|
private static string DecodeViewerEffectType(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{fieldName,30}: {fieldData,-2} {"(" + (EffectType) (byte) fieldData + ")",-37} [{fieldData.GetType().Name}]";
|
$"{fieldName,30}: {fieldData,-2} {"(" + (EffectType)(byte)fieldData + ")",-37} [{fieldData.GetType().Name}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string DecodeAnimToConst(string fieldName, object fieldData)
|
private static string DecodeAnimToConst(string fieldName, object fieldData)
|
||||||
{
|
{
|
||||||
string animConst = "UUID";
|
string animConst = "UUID";
|
||||||
Dictionary<UUID, string> animsDict = Animations.ToDictionary();
|
Dictionary<UUID, string> animsDict = Animations.ToDictionary();
|
||||||
if (animsDict.ContainsKey((UUID) fieldData))
|
if (animsDict.ContainsKey((UUID)fieldData))
|
||||||
animConst = animsDict[(UUID) fieldData];
|
animConst = animsDict[(UUID)fieldData];
|
||||||
return $"{fieldName,30}: {fieldData,-40} [{animConst}]";
|
return $"{fieldName,30}: {fieldData,-40} [{animConst}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1517,7 +1517,7 @@ namespace OpenMetaverse.Packets
|
||||||
{
|
{
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
t.Name,
|
t.Name,
|
||||||
Utils.BytesToString((byte[]) t.GetValue(nestedArrayRecord)),
|
Utils.BytesToString((byte[])t.GetValue(nestedArrayRecord)),
|
||||||
/*fields[i].GetValue(nestedArrayRecord).GetType().Name*/ "String");
|
/*fields[i].GetValue(nestedArrayRecord).GetType().Name*/ "String");
|
||||||
}
|
}
|
||||||
else // default for a field
|
else // default for a field
|
||||||
|
|
@ -1547,7 +1547,7 @@ namespace OpenMetaverse.Packets
|
||||||
/* Leave the c for now at the end, it signifies something useful that still needs to be done i.e. a decoder written */
|
/* Leave the c for now at the end, it signifies something useful that still needs to be done i.e. a decoder written */
|
||||||
result.AppendFormat("{0, 30}: {1,-40} [{2}]c" + Environment.NewLine,
|
result.AppendFormat("{0, 30}: {1,-40} [{2}]c" + Environment.NewLine,
|
||||||
propertyInfo.Name,
|
propertyInfo.Name,
|
||||||
Utils.BytesToString((byte[]) propertyInfo.GetValue(nestedArrayRecord, null)),
|
Utils.BytesToString((byte[])propertyInfo.GetValue(nestedArrayRecord, null)),
|
||||||
propertyInfo.PropertyType.Name);
|
propertyInfo.PropertyType.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1574,7 +1574,7 @@ namespace OpenMetaverse.Packets
|
||||||
{
|
{
|
||||||
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0,30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
packetValueField.Name,
|
packetValueField.Name,
|
||||||
Utils.BytesToString((byte[]) packetValueField.GetValue(packetDataObject)),
|
Utils.BytesToString((byte[])packetValueField.GetValue(packetDataObject)),
|
||||||
/*packetValueField.FieldType.Name*/ "String");
|
/*packetValueField.FieldType.Name*/ "String");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1602,7 +1602,7 @@ namespace OpenMetaverse.Packets
|
||||||
{
|
{
|
||||||
result.AppendFormat("{0, 30}: {1,-40} [{2}]" + Environment.NewLine,
|
result.AppendFormat("{0, 30}: {1,-40} [{2}]" + Environment.NewLine,
|
||||||
propertyInfo.Name,
|
propertyInfo.Name,
|
||||||
Utils.BytesToString((byte[]) propertyInfo.GetValue(packetDataObject, null)),
|
Utils.BytesToString((byte[])propertyInfo.GetValue(packetDataObject, null)),
|
||||||
propertyInfo.PropertyType.Name);
|
propertyInfo.PropertyType.Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1618,13 +1618,12 @@ namespace OpenMetaverse.Packets
|
||||||
private static bool SpecialDecoder(string decoderKey, object fieldData, out string result)
|
private static bool SpecialDecoder(string decoderKey, object fieldData, out string result)
|
||||||
{
|
{
|
||||||
result = string.Empty;
|
result = string.Empty;
|
||||||
string[] keys = decoderKey.Split(new[] {'.'}, StringSplitOptions.RemoveEmptyEntries);
|
string[] keys = decoderKey.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
string[] keyList = {decoderKey, decoderKey.Replace("Packet", ""), keys[1] + "." + keys[2], keys[2]};
|
string[] keyList = { decoderKey, decoderKey.Replace("Packet", ""), keys[1] + "." + keys[2], keys[2] };
|
||||||
foreach (string key in keyList)
|
foreach (string key in keyList)
|
||||||
{
|
{
|
||||||
if (fieldData is byte[])
|
if (fieldData is byte[] fd)
|
||||||
{
|
{
|
||||||
byte[] fd = (byte[]) fieldData;
|
|
||||||
if (!(fd.Length > 0))
|
if (!(fd.Length > 0))
|
||||||
{
|
{
|
||||||
// bypass the decoder since we were passed an empty byte array
|
// bypass the decoder since we were passed an empty byte array
|
||||||
|
|
@ -1683,7 +1682,7 @@ namespace OpenMetaverse.Packets
|
||||||
result.AppendFormat("{0, 30}:" + Environment.NewLine, messageField.Name);
|
result.AppendFormat("{0, 30}:" + Environment.NewLine, messageField.Name);
|
||||||
|
|
||||||
result.AppendFormat("{0}" + Environment.NewLine,
|
result.AppendFormat("{0}" + Environment.NewLine,
|
||||||
Utils.BytesToHexString((byte[]) messageField.GetValue(message),
|
Utils.BytesToHexString((byte[])messageField.GetValue(message),
|
||||||
$"{"",30}"));
|
$"{"",30}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1691,7 +1690,7 @@ namespace OpenMetaverse.Packets
|
||||||
else if (messageField.FieldType.IsArray)
|
else if (messageField.FieldType.IsArray)
|
||||||
{
|
{
|
||||||
var messageObjectData = messageField.GetValue(message) as Array;
|
var messageObjectData = messageField.GetValue(message) as Array;
|
||||||
|
|
||||||
if (messageObjectData == null) continue;
|
if (messageObjectData == null) continue;
|
||||||
|
|
||||||
result.AppendFormat("-- {0} --" + Environment.NewLine, messageField.FieldType.Name);
|
result.AppendFormat("-- {0} --" + Environment.NewLine, messageField.FieldType.Name);
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ namespace OpenMetaverse
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return (obj is Permissions) && this == (Permissions)obj;
|
return (obj is Permissions permissions) && this == permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Permissions other)
|
public bool Equals(Permissions other)
|
||||||
|
|
|
||||||
|
|
@ -548,12 +548,12 @@ namespace OpenMetaverse.Rendering
|
||||||
/// <returns>A standard .Net string</returns>
|
/// <returns>A standard .Net string</returns>
|
||||||
public static string TrimAt0(string s)
|
public static string TrimAt0(string s)
|
||||||
{
|
{
|
||||||
int pos = s.IndexOf("\0");
|
int pos = s.IndexOf("\0", StringComparison.Ordinal);
|
||||||
|
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
return s.Substring(0, pos);
|
return s.Substring(0, pos);
|
||||||
|
|
||||||
return s;
|
return pos >= 0 ? s.Substring(0, pos) : s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue