add helper SimulatorFeaturesModulr OpenSimExtraFeatureContains plus cosmetics

This commit is contained in:
UbitUmarov
2023-02-23 22:50:45 +00:00
parent 20ef1d6aaf
commit ce0d426b99
8 changed files with 40 additions and 49 deletions

View File

@@ -145,7 +145,7 @@ namespace OpenSim.Region.ClientStack.Linden
try
{
Vector3 pos = avatar.AbsolutePosition + (Vector3.UnitX * avatar.Rotation);
Vector3 pos = avatar.AbsolutePosition + Vector3.UnitXRotated(avatar.Rotation);
Quaternion rot = Quaternion.Identity;
Vector3 rootpos = Vector3.Zero;

View File

@@ -215,9 +215,9 @@ namespace OpenSim.Region.ClientStack.Linden
else
{
extrasMap = new OSDMap();
m_features["OpenSimExtras"] = extrasMap;
}
extrasMap[name] = value;
m_features["OpenSimExtras"] = extrasMap;
}
}
@@ -238,12 +238,19 @@ namespace OpenSim.Region.ClientStack.Linden
value = null;
lock (m_features)
{
if (!m_features.TryGetValue("OpenSimExtras", out OSD extra))
return false;
if(!(extra is OSDMap))
return false;
return (extra as OSDMap).TryGetValue(name, out value);
if (m_features.TryGetValue("OpenSimExtras", out OSD extra) && extra is OSDMap exm)
return exm.TryGetValue(name, out value);
}
return false;
}
public bool OpenSimExtraFeatureContains(string name)
{
lock (m_features)
{
if (m_features.TryGetValue("OpenSimExtras", out OSD extra) && extra is OSDMap exm)
return exm.ContainsKey(name);
}
return false;
}
public OSDMap GetFeatures()

View File

@@ -611,8 +611,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_asyncPacketProcess.Stop();
// Flush all of the packets out of the UDP server for this client
if (m_udpServer != null)
m_udpServer.Flush(m_udpClient);
m_udpServer?.Flush(m_udpClient);
// Remove ourselves from the scene
m_scene.RemoveClient(m_agentId, true);