avoid some null refs

master
UbitUmarov 2020-07-24 13:24:55 +01:00
parent bb56157c92
commit e0aff5e640
1 changed files with 14 additions and 29 deletions

View File

@ -1226,13 +1226,14 @@ namespace OpenSim.Region.Framework.Scenes
Animator = null; Animator = null;
Appearance = null; Appearance = null;
/* temporary out: timming issues
if(m_attachments != null) if(m_attachments != null)
{ {
foreach(SceneObjectGroup sog in m_attachments) foreach(SceneObjectGroup sog in m_attachments)
sog.Dispose(); sog.Dispose();
m_attachments = null; m_attachments = null;
} }
*/
scriptedcontrols.Clear(); scriptedcontrols.Clear();
ControllingClient = null; ControllingClient = null;
} }
@ -1654,19 +1655,7 @@ namespace OpenSim.Region.Framework.Scenes
*/ */
public int GetStateSource() public int GetStateSource()
{ {
/* return m_teleportFlags == TeleportFlags.Default ? 2 : 5; // StateSource.PrimCrossing : StateSource.Teleporting
AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(UUID);
if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
{
// This will get your attention
//m_log.Error("[XXX] Triggering CHANGED_TELEPORT");
return 5; // StateSource.Teleporting
}
return 2; // StateSource.PrimCrossing
*/
return m_teleportFlags == TeleportFlags.Default ? 2 : 5;
} }
/// <summary> /// <summary>
@ -2190,7 +2179,7 @@ namespace OpenSim.Region.Framework.Scenes
catch { } catch { }
finally finally
{ {
m_updateAgentReceivedAfterTransferEvent.Reset(); m_updateAgentReceivedAfterTransferEvent?.Reset();
} }
return false; return false;
@ -4144,19 +4133,14 @@ namespace OpenSim.Region.Framework.Scenes
TriggerScenePresenceUpdated(); TriggerScenePresenceUpdated();
} }
public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
{
SendCoarseLocationsMethod d = m_sendCoarseLocationsMethod;
if (d != null)
{
d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs);
}
}
public void SetSendCoarseLocationMethod(SendCoarseLocationsMethod d) public void SetSendCoarseLocationMethod(SendCoarseLocationsMethod d)
{ {
if (d != null) m_sendCoarseLocationsMethod = d;
m_sendCoarseLocationsMethod = d; }
public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
{
m_sendCoarseLocationsMethod?.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs);
} }
public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
@ -4180,11 +4164,12 @@ namespace OpenSim.Region.Framework.Scenes
private void SendInitialData() private void SendInitialData()
{ {
uint flags = ControllingClient.GetViewerCaps(); //wait for region handshake
if ((flags & 0x1000) == 0) // wait for seeds sending if (NeedInitialData < 2)
return; return;
if (NeedInitialData < 2) uint flags = ControllingClient.GetViewerCaps();
if ((flags & 0x1000) == 0) // wait for seeds sending
return; return;
// give some extra time to make sure viewers did process seeds // give some extra time to make sure viewers did process seeds