mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
add helper SimulatorFeaturesModulr OpenSimExtraFeatureContains plus cosmetics
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user