* Stop the pointless passing of a scene's own region handler back to it in region comms

* Some scene methods ignored it, others did nothing if the region handler given did not match their own (which would never be triggered)
0.6.1-post-fixes
Justin Clarke Casey 2008-11-12 19:12:33 +00:00
parent 724390e413
commit b636bb0f9e
7 changed files with 167 additions and 166 deletions

View File

@ -30,27 +30,27 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); public delegate void ExpectUserDelegate(AgentCircuitData agent);
public delegate bool ExpectPrimDelegate(ulong regionHandle, UUID primID, string objData, int XMLMethod); public delegate bool ExpectPrimDelegate(UUID primID, string objData, int XMLMethod);
public delegate void UpdateNeighbours(List<RegionInfo> neighbours); public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
public delegate void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying); public delegate void AgentCrossing(UUID agentID, Vector3 position, bool isFlying);
public delegate void PrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical); public delegate void PrimCrossing(UUID primID, Vector3 position, bool isPhysical);
public delegate void AcknowledgeAgentCross(ulong regionHandle, UUID agentID); public delegate void AcknowledgeAgentCross(UUID agentID);
public delegate void AcknowledgePrimCross(ulong regionHandle, UUID PrimID); public delegate void AcknowledgePrimCross(UUID PrimID);
public delegate bool CloseAgentConnection(ulong regionHandle, UUID agentID); public delegate bool CloseAgentConnection(UUID agentID);
public delegate bool RegionUp(RegionInfo region); public delegate bool RegionUp(RegionInfo region);
public delegate bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData); public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData);
public delegate void LogOffUser(ulong regionHandle, UUID agentID, UUID regionSecret, string message); public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message);
public delegate LandData GetLandData(uint x, uint y); public delegate LandData GetLandData(uint x, uint y);

View File

@ -31,6 +31,9 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Sandbox mode region comms listener. There is one of these per region
/// </summary>
public class RegionCommsListener : IRegionCommsListener public class RegionCommsListener : IRegionCommsListener
{ {
public string debugRegionName = String.Empty; public string debugRegionName = String.Empty;
@ -71,12 +74,12 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
/// <param name="agent"></param> /// <param name="agent"></param>
/// <returns></returns> /// <returns></returns>
public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) public virtual bool TriggerExpectUser(AgentCircuitData agent)
{ {
handlerExpectUser = OnExpectUser; handlerExpectUser = OnExpectUser;
if (handlerExpectUser != null) if (handlerExpectUser != null)
{ {
handlerExpectUser(regionHandle, agent); handlerExpectUser(agent);
return true; return true;
} }
@ -84,23 +87,22 @@ namespace OpenSim.Framework
} }
// From User Server // From User Server
public virtual void TriggerLogOffUser(ulong regionHandle, UUID agentID, UUID RegionSecret, string message) public virtual void TriggerLogOffUser(UUID agentID, UUID RegionSecret, string message)
{ {
handlerLogOffUser = OnLogOffUser; handlerLogOffUser = OnLogOffUser;
if (handlerLogOffUser != null) if (handlerLogOffUser != null)
{ {
handlerLogOffUser(regionHandle, agentID, RegionSecret, message); handlerLogOffUser(agentID, RegionSecret, message);
} }
} }
public virtual bool TriggerExpectPrim(UUID primID, string objData, int XMLMethod)
public virtual bool TriggerExpectPrim(ulong regionHandle, UUID primID, string objData, int XMLMethod)
{ {
handlerExpectPrim = OnExpectPrim; handlerExpectPrim = OnExpectPrim;
if (handlerExpectPrim != null) if (handlerExpectPrim != null)
{ {
handlerExpectPrim(regionHandle, primID, objData, XMLMethod); handlerExpectPrim(primID, objData, XMLMethod);
return true; return true;
} }
return false; return false;
@ -117,69 +119,68 @@ namespace OpenSim.Framework
return false; return false;
} }
public virtual bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
{ {
handlerChildAgentUpdate = OnChildAgentUpdate; handlerChildAgentUpdate = OnChildAgentUpdate;
if (handlerChildAgentUpdate != null) if (handlerChildAgentUpdate != null)
{ {
handlerChildAgentUpdate(regionHandle, cAgentData); handlerChildAgentUpdate(cAgentData);
return true; return true;
} }
return false; return false;
} }
public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, public virtual bool TriggerExpectAvatarCrossing(UUID agentID, Vector3 position, bool isFlying)
bool isFlying)
{ {
handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion;
if (handlerAvatarCrossingIntoRegion != null) if (handlerAvatarCrossingIntoRegion != null)
{ {
handlerAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); handlerAvatarCrossingIntoRegion(agentID, position, isFlying);
return true; return true;
} }
return false; return false;
} }
public virtual bool TriggerExpectPrimCrossing(ulong regionHandle, UUID primID, Vector3 position, public virtual bool TriggerExpectPrimCrossing(UUID primID, Vector3 position,
bool isPhysical) bool isPhysical)
{ {
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
if (handlerPrimCrossingIntoRegion != null) if (handlerPrimCrossingIntoRegion != null)
{ {
handlerPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical); handlerPrimCrossingIntoRegion(primID, position, isPhysical);
return true; return true;
} }
return false; return false;
} }
public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, UUID agentID) public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID)
{ {
handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed; handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed;
if (handlerAcknowledgeAgentCrossed != null) if (handlerAcknowledgeAgentCrossed != null)
{ {
handlerAcknowledgeAgentCrossed(regionHandle, agentID); handlerAcknowledgeAgentCrossed(agentID);
return true; return true;
} }
return false; return false;
} }
public virtual bool TriggerAcknowledgePrimCrossed(ulong regionHandle, UUID primID) public virtual bool TriggerAcknowledgePrimCrossed(UUID primID)
{ {
handlerAcknowledgePrimCrossed = OnAcknowledgePrimCrossed; handlerAcknowledgePrimCrossed = OnAcknowledgePrimCrossed;
if (handlerAcknowledgePrimCrossed != null) if (handlerAcknowledgePrimCrossed != null)
{ {
handlerAcknowledgePrimCrossed(regionHandle, primID); handlerAcknowledgePrimCrossed(primID);
return true; return true;
} }
return false; return false;
} }
public virtual bool TriggerCloseAgentConnection(ulong regionHandle, UUID agentID) public virtual bool TriggerCloseAgentConnection(UUID agentID)
{ {
handlerCloseAgentConnection = OnCloseAgentConnection; handlerCloseAgentConnection = OnCloseAgentConnection;
if (handlerCloseAgentConnection != null) if (handlerCloseAgentConnection != null)
{ {
handlerCloseAgentConnection(regionHandle, agentID); handlerCloseAgentConnection(agentID);
return true; return true;
} }
return false; return false;
@ -220,11 +221,11 @@ namespace OpenSim.Framework
return false; return false;
} }
public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) public bool TriggerTellRegionToCloseChildConnection(UUID agentID)
{ {
handlerCloseAgentConnection = OnCloseAgentConnection; handlerCloseAgentConnection = OnCloseAgentConnection;
if (handlerCloseAgentConnection != null) if (handlerCloseAgentConnection != null)
return handlerCloseAgentConnection(regionHandle, agentID); return handlerCloseAgentConnection(agentID);
return false; return false;
} }

View File

@ -163,7 +163,7 @@ namespace OpenSim
presence.UUID, presence.UUID,
regionInfo.RegionName)); regionInfo.RegionName));
presence.Scene.CloseConnection(regionInfo.RegionHandle, presence.UUID); presence.Scene.CloseConnection(presence.UUID);
} }
} }
m_console.Notice(""); m_console.Notice("");

View File

@ -167,7 +167,7 @@ namespace OpenSim.Region.Communications.Local
} }
/// <summary> /// <summary>
/// /// Get information about a neighbouring region
/// </summary> /// </summary>
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <returns></returns> /// <returns></returns>
@ -177,9 +177,15 @@ namespace OpenSim.Region.Communications.Local
{ {
return m_regions[regionHandle]; return m_regions[regionHandle];
} }
return null; return null;
} }
/// <summary>
/// Get information about a neighbouring region
/// </summary>
/// <param name="regionHandle"></param>
/// <returns></returns>
public RegionInfo RequestNeighbourInfo(UUID regionID) public RegionInfo RequestNeighbourInfo(UUID regionID)
{ {
// TODO add a dictionary for faster lookup // TODO add a dictionary for faster lookup
@ -188,9 +194,15 @@ namespace OpenSim.Region.Communications.Local
if (info.RegionID == regionID) if (info.RegionID == regionID)
return info; return info;
} }
return null; return null;
} }
/// <summary>
/// Get information about the closet region given a region name.
/// </summary>
/// <param name="regionName"></param>
/// <returns></returns>
public RegionInfo RequestClosestRegion(string regionName) public RegionInfo RequestClosestRegion(string regionName)
{ {
foreach (RegionInfo regInfo in m_regions.Values) foreach (RegionInfo regInfo in m_regions.Values)
@ -236,7 +248,7 @@ namespace OpenSim.Region.Communications.Local
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(regionHandle, agentID); return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(agentID);
} }
return false; return false;
} }
@ -263,7 +275,7 @@ namespace OpenSim.Region.Communications.Local
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
// Console.WriteLine("CommsManager- Informing a region to expect child agent"); // Console.WriteLine("CommsManager- Informing a region to expect child agent");
m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData); m_regionListeners[regionHandle].TriggerChildAgentUpdate(cAgentData);
//m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
return true; return true;
@ -285,7 +297,7 @@ namespace OpenSim.Region.Communications.Local
return returnGridSettings; return returnGridSettings;
} }
public virtual void SetForcefulBanlistsDisallowed(ulong regionHandle) public virtual void SetForcefulBanlistsDisallowed()
{ {
m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE"); m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE");
} }
@ -304,8 +316,9 @@ namespace OpenSim.Region.Communications.Local
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
return m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData); return m_regionListeners[regionHandle].TriggerChildAgentUpdate(cAgentData);
} }
return false; return false;
} }
@ -313,8 +326,9 @@ namespace OpenSim.Region.Communications.Local
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(regionHandle, agentID); return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(agentID);
} }
return false; return false;
} }
@ -333,7 +347,7 @@ namespace OpenSim.Region.Communications.Local
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
// Console.WriteLine("CommsManager- Informing a region to expect child agent"); // Console.WriteLine("CommsManager- Informing a region to expect child agent");
m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); m_regionListeners[regionHandle].TriggerExpectUser(agentData);
//m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
return true; return true;
@ -345,14 +359,15 @@ namespace OpenSim.Region.Communications.Local
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData, XMLMethod); m_regionListeners[regionHandle].TriggerExpectPrim(primID, objData, XMLMethod);
return true; return true;
} }
return false; return false;
} }
/// <summary> /// <summary>
/// /// Tell a region to get prepare for an avatar to cross into it.
/// </summary> /// </summary>
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <param name="agentID"></param> /// <param name="agentID"></param>
@ -363,7 +378,7 @@ namespace OpenSim.Region.Communications.Local
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
// Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing");
m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(agentID, position, isFlying);
return true; return true;
} }
return false; return false;
@ -373,9 +388,10 @@ namespace OpenSim.Region.Communications.Local
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical); m_regionListeners[regionHandle].TriggerExpectPrimCrossing(primID, position, isPhysical);
return true; return true;
} }
return false; return false;
} }
@ -429,7 +445,7 @@ namespace OpenSim.Region.Communications.Local
{ {
//m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); m_regionListeners[regionHandle].TriggerExpectUser(agent);
} }
} }
@ -439,7 +455,7 @@ namespace OpenSim.Region.Communications.Local
{ {
//m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
m_regionListeners[regionHandle].TriggerLogOffUser(regionHandle, agentID, RegionSecret, message); m_regionListeners[regionHandle].TriggerLogOffUser(agentID, RegionSecret, message);
} }
} }
@ -447,7 +463,7 @@ namespace OpenSim.Region.Communications.Local
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData, XMLMethod); m_regionListeners[regionHandle].TriggerExpectPrim(primID, objData, XMLMethod);
} }
} }
@ -468,8 +484,7 @@ namespace OpenSim.Region.Communications.Local
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(agentID, position, isFlying);
isFlying);
} }
return false; return false;
@ -480,7 +495,7 @@ namespace OpenSim.Region.Communications.Local
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
return return
m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical); m_regionListeners[regionHandle].TriggerExpectPrimCrossing(primID, position, isPhysical);
} }
return false; return false;
} }

View File

@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile); homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile);
// Call 'new user' event handler // Call 'new user' event handler
homeScene.NewUserConnection(reg.RegionHandle, agentData); homeScene.NewUserConnection(agentData);
//string raCap = string.Empty; //string raCap = string.Empty;

View File

@ -2106,9 +2106,10 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="objXMLData"></param> /// <param name="objXMLData"></param>
/// <param name="XMLMethod"></param> /// <param name="XMLMethod"></param>
/// <returns></returns> /// <returns></returns>
public bool IncomingInterRegionPrimGroup(ulong regionHandle, UUID primID, string objXMLData, int XMLMethod) public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod)
{ {
m_log.Warn("[INTERREGION]: A new prim arrived from a neighbor"); m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID);
if (XMLMethod == 0) if (XMLMethod == 0)
{ {
SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
@ -2702,51 +2703,42 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <param name="agent"></param> /// <param name="agent"></param>
public void NewUserConnection(ulong regionHandle, AgentCircuitData agent) public void NewUserConnection(AgentCircuitData agent)
{ {
if (regionHandle == m_regInfo.RegionHandle) if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
{ {
if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) m_log.WarnFormat(
"[CONNECTION DEBUGGING]: Denied access to: {0} at {1} because the user is on the region banlist",
agent.AgentID, RegionInfo.RegionName);
}
capsPaths[agent.AgentID] = agent.CapsPath;
if (!agent.child)
{
AddCapsHandler(agent.AgentID);
// Honor parcel landing type and position.
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
if (land != null)
{ {
m_log.WarnFormat( if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero)
"[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist",
agent.AgentID, regionHandle, RegionInfo.RegionName);
}
capsPaths[agent.AgentID] = agent.CapsPath;
if (!agent.child)
{
AddCapsHandler(agent.AgentID);
// Honor parcel landing type and position.
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
if (land != null)
{ {
if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero) agent.startpos = land.landData.UserLocation;
{
agent.startpos = land.landData.UserLocation;
}
} }
} }
}
m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
// rewrite session_id // rewrite session_id
CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID);
if (userinfo != null) if (userinfo != null)
{ {
userinfo.SessionID = agent.SessionID; userinfo.SessionID = agent.SessionID;
}
else
{
m_log.WarnFormat("[USERINFO CACHE]: We couldn't find a User Info record for {0}. This is usually an indication that the UUID we're looking up is invalid", agent.AgentID);
}
} }
else else
{ {
m_log.WarnFormat( m_log.WarnFormat("[USERINFO CACHE]: We couldn't find a User Info record for {0}. This is usually an indication that the UUID we're looking up is invalid", agent.AgentID);
"[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
agent.AgentID, regionHandle, RegionInfo.RegionName);
} }
} }
@ -2760,31 +2752,28 @@ namespace OpenSim.Region.Environment.Scenes
return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
} }
protected void HandleLogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message) protected void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
{ {
if (RegionInfo.RegionHandle == regionHandle) ScenePresence loggingOffUser = null;
loggingOffUser = GetScenePresence(AvatarID);
if (loggingOffUser != null)
{ {
ScenePresence loggingOffUser = null; if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId)
loggingOffUser = GetScenePresence(AvatarID);
if (loggingOffUser != null)
{ {
if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId) loggingOffUser.ControllingClient.Kick(message);
{ // Give them a second to receive the message!
loggingOffUser.ControllingClient.Kick(message); System.Threading.Thread.Sleep(1000);
// Give them a second to receive the message! loggingOffUser.ControllingClient.Close(true);
System.Threading.Thread.Sleep(1000);
loggingOffUser.ControllingClient.Close(true);
}
else
{
m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
}
} }
else else
{ {
m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
} }
} }
else
{
m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
}
} }
/// <summary> /// <summary>
@ -2865,42 +2854,38 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// Triggered when an agent crosses into this sim. Also happens on initial login. /// Triggered when an agent crosses into this sim. Also happens on initial login.
/// </summary> /// </summary>
/// <param name="regionHandle"></param>
/// <param name="agentID"></param> /// <param name="agentID"></param>
/// <param name="position"></param> /// <param name="position"></param>
/// <param name="isFlying"></param> /// <param name="isFlying"></param>
public virtual void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
{ {
if (regionHandle == m_regInfo.RegionHandle) ScenePresence presence;
lock (m_scenePresences)
{ {
ScenePresence presence; m_scenePresences.TryGetValue(agentID, out presence);
}
lock (m_scenePresences)
if (presence != null)
{
try
{ {
m_scenePresences.TryGetValue(agentID, out presence); presence.MakeRootAgent(position, isFlying);
} }
catch (Exception e)
if (presence != null)
{ {
try m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
{
presence.MakeRootAgent(position, isFlying);
}
catch (Exception e)
{
m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
}
}
else
{
m_log.ErrorFormat(
"[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
agentID, RegionInfo.RegionName);
} }
} }
else
{
m_log.ErrorFormat(
"[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
agentID, RegionInfo.RegionName);
}
} }
public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) public virtual bool IncomingChildAgentDataUpdate(ChildAgentDataUpdate cAgentData)
{ {
ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID)); ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID));
if (childAgentUpdate != null) if (childAgentUpdate != null)
@ -2918,8 +2903,10 @@ namespace OpenSim.Region.Environment.Scenes
// Not Implemented: // Not Implemented:
//TODO: Do we need to pass the message on to one of our neighbors? //TODO: Do we need to pass the message on to one of our neighbors?
} }
return true; return true;
} }
return false; return false;
} }
@ -2928,29 +2915,28 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <param name="agentID"></param> /// <param name="agentID"></param>
public bool CloseConnection(ulong regionHandle, UUID agentID) public bool CloseConnection(UUID agentID)
{ {
if (regionHandle == m_regionHandle) ScenePresence presence = m_innerScene.GetScenePresence(agentID);
if (presence != null)
{ {
ScenePresence presence = m_innerScene.GetScenePresence(agentID); // Nothing is removed here, so down count it as such
if (presence != null) // if (presence.IsChildAgent)
{ // {
// Nothing is removed here, so down count it as such // m_innerScene.removeUserCount(false);
// if (presence.IsChildAgent) // }
// { // else
// m_innerScene.removeUserCount(false); // {
// } // m_innerScene.removeUserCount(true);
// else // }
// {
// m_innerScene.removeUserCount(true);
// }
// Tell a single agent to disconnect from the region. // Tell a single agent to disconnect from the region.
presence.ControllingClient.SendShutdownConnectionNotice(); presence.ControllingClient.SendShutdownConnectionNotice();
presence.ControllingClient.Close(true); presence.ControllingClient.Close(true);
}
} }
return true; return true;
} }

View File

@ -155,22 +155,22 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <param name="agent"></param> /// <param name="agent"></param>
/// ///
protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent) protected void NewUserConnection(AgentCircuitData agent)
{ {
handlerExpectUser = OnExpectUser; handlerExpectUser = OnExpectUser;
if (handlerExpectUser != null) if (handlerExpectUser != null)
{ {
//m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname); //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname);
handlerExpectUser(regionHandle, agent); handlerExpectUser(agent);
} }
} }
protected void GridLogOffUser(ulong regionHandle, UUID AgentID, UUID RegionSecret, string message) protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message)
{ {
handlerLogOffUser = OnLogOffUser; handlerLogOffUser = OnLogOffUser;
if (handlerLogOffUser != null) if (handlerLogOffUser != null)
{ {
handlerLogOffUser(regionHandle, AgentID, RegionSecret, message); handlerLogOffUser(AgentID, RegionSecret, message);
} }
} }
@ -185,31 +185,31 @@ namespace OpenSim.Region.Environment.Scenes
return true; return true;
} }
protected bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData)
{ {
handlerChildAgentUpdate = OnChildAgentUpdate; handlerChildAgentUpdate = OnChildAgentUpdate;
if (handlerChildAgentUpdate != null) if (handlerChildAgentUpdate != null)
handlerChildAgentUpdate(regionHandle, cAgentData); handlerChildAgentUpdate(cAgentData);
return true; return true;
} }
protected void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
{ {
handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion;
if (handlerAvatarCrossingIntoRegion != null) if (handlerAvatarCrossingIntoRegion != null)
{ {
handlerAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); handlerAvatarCrossingIntoRegion(agentID, position, isFlying);
} }
} }
protected bool IncomingPrimCrossing(ulong regionHandle, UUID primID, String objXMLData, int XMLMethod) protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod)
{ {
handlerExpectPrim = OnExpectPrim; handlerExpectPrim = OnExpectPrim;
if (handlerExpectPrim != null) if (handlerExpectPrim != null)
{ {
return handlerExpectPrim(regionHandle, primID, objXMLData, XMLMethod); return handlerExpectPrim(primID, objXMLData, XMLMethod);
} }
else else
{ {
@ -218,23 +218,25 @@ namespace OpenSim.Region.Environment.Scenes
} }
protected void PrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical) protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical)
{ {
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
if (handlerPrimCrossingIntoRegion != null) if (handlerPrimCrossingIntoRegion != null)
{ {
handlerPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical); handlerPrimCrossingIntoRegion(primID, position, isPhysical);
} }
} }
protected bool CloseConnection(ulong regionHandle, UUID agentID) protected bool CloseConnection(UUID agentID)
{ {
m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString()); m_log.Debug("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID);
handlerCloseAgentConnection = OnCloseAgentConnection; handlerCloseAgentConnection = OnCloseAgentConnection;
if (handlerCloseAgentConnection != null) if (handlerCloseAgentConnection != null)
{ {
return handlerCloseAgentConnection(regionHandle, agentID); return handlerCloseAgentConnection(agentID);
} }
return false; return false;
} }
@ -416,8 +418,6 @@ namespace OpenSim.Region.Environment.Scenes
// yes, we're notifying ourselves. // yes, we're notifying ourselves.
if (handlerRegionUp != null) if (handlerRegionUp != null)
handlerRegionUp(region); handlerRegionUp(region);
} }
else else
{ {
@ -726,7 +726,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList());
SendCloseChildAgentConnections(avatar.UUID, childRegions); SendCloseChildAgentConnections(avatar.UUID, childRegions);
CloseConnection(m_regionInfo.RegionHandle, avatar.UUID); CloseConnection(avatar.UUID);
} }
// if (teleport success) // seems to be always success here // if (teleport success) // seems to be always success here
// the user may change their profile information in other region, // the user may change their profile information in other region,
@ -763,7 +763,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// /// Inform a neighbouring region that an avatar is about to cross into it.
/// </summary> /// </summary>
/// <param name="regionhandle"></param> /// <param name="regionhandle"></param>
/// <param name="agentID"></param> /// <param name="agentID"></param>
@ -778,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes
return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod); return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod);
} }
public Dictionary<string, string> GetGridSettings() public Dictionary<string, string> GetGridSettings()
{ {
return m_commsProvider.GridService.GetGridSettings(); return m_commsProvider.GridService.GetGridSettings();