* Upgraded LLStandaloneLoginModule, LLProxyLoginModule and LLClientStackModule to new

region modules. This was needed because the stand alone and grid modules weren't deleting
old scenes, which caused an issue when deleting and recreating a region with same name
on same x,y coordinates. Tested it on standalone and issue is fixed. Requires prebuild
to be run again.

Fixes Mantis #3699
0.6.6-post-fixes
Arthur Valadares 2009-05-21 20:28:59 +00:00
parent 3d0f110f21
commit a85f496f4d
5 changed files with 127 additions and 37 deletions

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@ -41,7 +41,7 @@ using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Client.Linden
{
public class LLClientStackModule : IRegionModule
public class LLClientStackModule : INonSharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -55,11 +55,10 @@ namespace OpenSim.Client.Linden
protected string m_clientStackDll = "OpenSim.Region.ClientStack.LindenUDP.dll";
public void Initialise(Scene scene, IConfigSource source)
public void Initialise(IConfigSource source)
{
if (m_scene == null)
{
m_scene = scene;
m_source = source;
IConfig startupConfig = m_source.Configs["Startup"];
@ -70,8 +69,23 @@ namespace OpenSim.Client.Linden
}
}
public void PostInitialise()
public void AddRegion(Scene scene)
{
}
public void RemoveRegion(Scene scene)
{
}
public void RegionLoaded(Scene scene)
{
if (m_scene == null)
{
m_scene = scene;
}
if ((m_scene != null) && (m_createClientStack))
{
m_log.Info("[LLClientStackModule] Starting up LLClientStack.");

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@ -48,7 +48,7 @@ namespace OpenSim.Client.Linden
/// <summary>
/// Handles login user (expect user) and logoff user messages from the remote LL login server
/// </summary>
public class LLProxyLoginModule : IRegionModule
public class LLProxyLoginModule : ISharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -74,17 +74,20 @@ namespace OpenSim.Client.Linden
#region IRegionModule Members
public void Initialise(Scene scene, IConfigSource source)
public void Initialise(IConfigSource source)
{
if (m_firstScene == null)
{
m_firstScene = scene;
IConfig startupConfig = source.Configs["Startup"];
if (startupConfig != null)
{
m_enabled = startupConfig.GetBoolean("gridmode", false);
}
}
public void AddRegion(Scene scene)
{
if (m_firstScene == null)
{
m_firstScene = scene;
if (m_enabled)
{
@ -96,6 +99,15 @@ namespace OpenSim.Client.Linden
{
AddScene(scene);
}
}
public void RemoveRegion(Scene scene)
{
if (m_enabled)
{
RemoveScene(scene);
}
}
public void PostInitialise()
@ -108,6 +120,11 @@ namespace OpenSim.Client.Linden
}
public void RegionLoaded(Scene scene)
{
}
public string Name
{
get { return "LLProxyLoginModule"; }
@ -140,6 +157,17 @@ namespace OpenSim.Client.Linden
}
}
}
protected void RemoveScene(Scene scene)
{
lock (m_scenes)
{
if (m_scenes.Contains(scene))
{
m_scenes.Remove(scene);
}
}
}
/// <summary>
/// Received from the user server when a user starts logging in. This call allows
/// the region to prepare for direct communication from the client. Sends back an empty

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@ -44,7 +44,7 @@ using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Client.Linden
{
public class LLStandaloneLoginModule : IRegionModule, ILoginServiceToRegionsConnector
public class LLStandaloneLoginModule : ISharedRegionModule, ILoginServiceToRegionsConnector
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -53,6 +53,8 @@ namespace OpenSim.Client.Linden
protected bool m_enabled = false; // Module is only enabled if running in standalone mode
protected bool authenticate;
protected string welcomeMessage;
public bool RegionLoginsEnabled
{
@ -73,12 +75,8 @@ namespace OpenSim.Client.Linden
#region IRegionModule Members
public void Initialise(Scene scene, IConfigSource source)
public void Initialise(IConfigSource source)
{
if (m_firstScene == null)
{
m_firstScene = scene;
IConfig startupConfig = source.Configs["Startup"];
if (startupConfig != null)
{
@ -87,15 +85,25 @@ namespace OpenSim.Client.Linden
if (m_enabled)
{
bool authenticate = true;
string welcomeMessage = "Welcome to OpenSim";
authenticate = true;
welcomeMessage = "Welcome to OpenSim";
IConfig standaloneConfig = source.Configs["StandAlone"];
if (standaloneConfig != null)
{
authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true);
welcomeMessage = standaloneConfig.GetString("welcome_message");
}
}
}
public void AddRegion(Scene scene)
{
if (m_firstScene == null)
{
m_firstScene = scene;
if (m_enabled)
{
//TODO: fix casting.
LibraryRootFolder rootFolder
= m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder;
@ -121,6 +129,14 @@ namespace OpenSim.Client.Linden
}
}
public void RemoveRegion(Scene scene)
{
if (m_enabled)
{
RemoveScene(scene);
}
}
public void PostInitialise()
{
@ -131,6 +147,11 @@ namespace OpenSim.Client.Linden
}
public void RegionLoaded(Scene scene)
{
}
public string Name
{
get { return "LLStandaloneLoginModule"; }
@ -154,6 +175,17 @@ namespace OpenSim.Client.Linden
}
}
protected void RemoveScene(Scene scene)
{
lock (m_scenes)
{
if (m_scenes.Contains(scene))
{
m_scenes.Remove(scene);
}
}
}
public bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason)
{
Scene scene;

View File

@ -0,0 +1,15 @@
<Addin id="OpenSim.Client.Linden.LindenModules" version="0.2">
<Runtime>
<Import assembly="OpenSim.Client.Linden.dll"/>
</Runtime>
<Dependencies>
<Addin id="OpenSim" version="0.5" />
</Dependencies>
<Extension path = "/OpenSim/RegionModules">
<RegionModule id="LLStandaloneLoginModule" type="OpenSim.Client.Linden.LLStandaloneLoginModule" />
<RegionModule id="LLProxyLoginModule" type="OpenSim.Client.Linden.LLProxyLoginModule" />
<RegionModule id="LLClientStackModule" type="OpenSim.Client.Linden.LLClientStackModule" />
</Extension>
</Addin>

View File

@ -2223,6 +2223,7 @@
<Reference name="OpenSim.Region.Framework"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
<Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/>
</Files>
</Project>