* Just some tidy up and documentation before I make my first ever attempt to extract a lump of code out to a region module

0.6.0-stable
Justin Clarke Casey 2008-05-05 18:53:07 +00:00
parent c535f3947d
commit 60a83574f4
1 changed files with 11 additions and 17 deletions

View File

@ -101,9 +101,9 @@ namespace OpenSim.Region.Environment.Scenes
protected BaseHttpServer m_httpListener; protected BaseHttpServer m_httpListener;
protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>(); protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>();
public Dictionary<Type, object> ModuleInterfaces = new Dictionary<Type, object>(); protected Dictionary<Type, object> ModuleInterfaces = new Dictionary<Type, object>();
protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>();
public Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>(); protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>();
//API module interfaces //API module interfaces
@ -142,8 +142,6 @@ namespace OpenSim.Region.Environment.Scenes
private bool m_physics_enabled = true; private bool m_physics_enabled = true;
private bool m_scripts_enabled = true; private bool m_scripts_enabled = true;
#endregion #endregion
#region Properties #region Properties
@ -1618,16 +1616,13 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ); LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ);
LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt); LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt);
RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0); RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0);
} }
} }
public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID,
LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart,
bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
{ {
LLVector3 pos; LLVector3 pos;
const bool frontFacesOnly = true; const bool frontFacesOnly = true;
@ -1639,9 +1634,7 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); LLVector3 direction = LLVector3.Norm(RayEnd - RayStart);
Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
if (target2.ParentGroup != null) if (target2.ParentGroup != null)
{ {
@ -1739,8 +1732,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
remoteClient.SendAgentAlertMessage("Set Home request Failed",false); remoteClient.SendAgentAlertMessage("Set Home request Failed",false);
} }
} }
protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child)
{ {
AvatarAppearance appearance; AvatarAppearance appearance;
@ -1756,7 +1749,6 @@ namespace OpenSim.Region.Environment.Scenes
return avatar; return avatar;
} }
protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance)
{ {
if (m_AvatarFactory == null || if (m_AvatarFactory == null ||
@ -2294,7 +2286,9 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// /// Register an interface to a region module. This allows module methods to be called directly as
/// well as via events. If there is already a module registered for this interface, it is not replaced
/// (is this the best behaviour?)
/// </summary> /// </summary>
/// <param name="mod"></param> /// <param name="mod"></param>
public void RegisterModuleInterface<M>(M mod) public void RegisterModuleInterface<M>(M mod)
@ -2306,9 +2300,9 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// /// For the given interface, retrieve the region module which implements it.
/// </summary> /// </summary>
/// <returns></returns> /// <returns>null if there is no module implementing that interface</returns>
public T RequestModuleInterface<T>() public T RequestModuleInterface<T>()
{ {
if (ModuleInterfaces.ContainsKey(typeof(T))) if (ModuleInterfaces.ContainsKey(typeof(T)))