* Bug fix: Fixes an exception when Scene.RemoveClient is called to remove on a
non-existing ScenePresence avatar. Also removed trailing white spaces.0.6.6-post-fixes
parent
95643971be
commit
8545621d9b
|
@ -2185,96 +2185,96 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (avatar != null)
|
if (avatar != null)
|
||||||
{
|
{
|
||||||
childagentYN = avatar.IsChildAgent;
|
childagentYN = avatar.IsChildAgent;
|
||||||
}
|
|
||||||
|
|
||||||
if (avatar.ParentID != 0)
|
if (avatar.ParentID != 0)
|
||||||
{
|
|
||||||
avatar.StandUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[SCENE]: Removing {0} agent {1} from region {2}",
|
|
||||||
(childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName);
|
|
||||||
|
|
||||||
m_sceneGraph.removeUserCount(!childagentYN);
|
|
||||||
CapsModule.RemoveCapsHandler(agentID);
|
|
||||||
|
|
||||||
if (avatar.Scene.NeedSceneCacheClear(avatar.UUID))
|
|
||||||
{
|
{
|
||||||
CommsManager.UserProfileCacheService.RemoveUser(agentID);
|
avatar.StandUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!avatar.IsChildAgent)
|
try
|
||||||
{
|
{
|
||||||
m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, avatar.AbsolutePosition, avatar.Lookat);
|
m_log.DebugFormat(
|
||||||
//List<ulong> childknownRegions = new List<ulong>();
|
"[SCENE]: Removing {0} agent {1} from region {2}",
|
||||||
//List<ulong> ckn = avatar.KnownChildRegionHandles;
|
(childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName);
|
||||||
//for (int i = 0; i < ckn.Count; i++)
|
|
||||||
//{
|
|
||||||
// childknownRegions.Add(ckn[i]);
|
|
||||||
//}
|
|
||||||
List<ulong> regions = new List<ulong>(avatar.KnownChildRegionHandles);
|
|
||||||
regions.Remove(RegionInfo.RegionHandle);
|
|
||||||
m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
|
|
||||||
|
|
||||||
|
m_sceneGraph.removeUserCount(!childagentYN);
|
||||||
|
CapsModule.RemoveCapsHandler(agentID);
|
||||||
|
|
||||||
|
if (avatar.Scene.NeedSceneCacheClear(avatar.UUID))
|
||||||
|
{
|
||||||
|
CommsManager.UserProfileCacheService.RemoveUser(agentID);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!avatar.IsChildAgent)
|
||||||
|
{
|
||||||
|
m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, avatar.AbsolutePosition, avatar.Lookat);
|
||||||
|
//List<ulong> childknownRegions = new List<ulong>();
|
||||||
|
//List<ulong> ckn = avatar.KnownChildRegionHandles;
|
||||||
|
//for (int i = 0; i < ckn.Count; i++)
|
||||||
|
//{
|
||||||
|
// childknownRegions.Add(ckn[i]);
|
||||||
|
//}
|
||||||
|
List<ulong> regions = new List<ulong>(avatar.KnownChildRegionHandles);
|
||||||
|
regions.Remove(RegionInfo.RegionHandle);
|
||||||
|
m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
|
||||||
|
|
||||||
|
}
|
||||||
|
m_eventManager.TriggerClientClosed(agentID);
|
||||||
|
}
|
||||||
|
catch (NullReferenceException)
|
||||||
|
{
|
||||||
|
// We don't know which count to remove it from
|
||||||
|
// Avatar is already disposed :/
|
||||||
}
|
}
|
||||||
m_eventManager.TriggerClientClosed(agentID);
|
|
||||||
}
|
|
||||||
catch (NullReferenceException)
|
|
||||||
{
|
|
||||||
// We don't know which count to remove it from
|
|
||||||
// Avatar is already disposed :/
|
|
||||||
}
|
|
||||||
|
|
||||||
m_eventManager.TriggerOnRemovePresence(agentID);
|
m_eventManager.TriggerOnRemovePresence(agentID);
|
||||||
Broadcast(delegate(IClientAPI client)
|
Broadcast(delegate(IClientAPI client)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
|
try
|
||||||
}
|
{
|
||||||
catch (NullReferenceException)
|
client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
|
||||||
{
|
}
|
||||||
//We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
|
catch (NullReferenceException)
|
||||||
}
|
{
|
||||||
});
|
//We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ForEachScenePresence(
|
ForEachScenePresence(
|
||||||
delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
|
delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
|
||||||
|
|
||||||
IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
|
IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
|
||||||
if (agentTransactions != null)
|
if (agentTransactions != null)
|
||||||
{
|
{
|
||||||
agentTransactions.RemoveAgentAssetTransactions(agentID);
|
agentTransactions.RemoveAgentAssetTransactions(agentID);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_sceneGraph.RemoveScenePresence(agentID);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
avatar.Close();
|
||||||
|
}
|
||||||
|
catch (NullReferenceException)
|
||||||
|
{
|
||||||
|
//We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove client agent from profile, so new logins will work
|
||||||
|
if (!childagentYN)
|
||||||
|
{
|
||||||
|
m_sceneGridService.ClearUserAgent(agentID);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
|
||||||
|
|
||||||
|
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
|
||||||
|
//m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sceneGraph.RemoveScenePresence(agentID);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
avatar.Close();
|
|
||||||
}
|
|
||||||
catch (NullReferenceException)
|
|
||||||
{
|
|
||||||
//We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove client agent from profile, so new logins will work
|
|
||||||
if (!childagentYN)
|
|
||||||
{
|
|
||||||
m_sceneGridService.ClearUserAgent(agentID);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
|
|
||||||
|
|
||||||
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
|
|
||||||
//m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List<ulong> regionslst)
|
public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List<ulong> regionslst)
|
||||||
|
|
Loading…
Reference in New Issue