diff options
Diffstat (limited to 'OpenSim/Client/Linden/LLStandaloneLoginModule.cs')
-rw-r--r-- | OpenSim/Client/Linden/LLStandaloneLoginModule.cs | 72 |
1 files changed, 52 insertions, 20 deletions
diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs index dbc401b..6474feb 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -44,7 +44,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
44 | 44 | ||
45 | namespace OpenSim.Client.Linden | 45 | namespace OpenSim.Client.Linden |
46 | { | 46 | { |
47 | public class LLStandaloneLoginModule : IRegionModule, ILoginServiceToRegionsConnector | 47 | public class LLStandaloneLoginModule : ISharedRegionModule, ILoginServiceToRegionsConnector |
48 | { | 48 | { |
49 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
@@ -53,6 +53,8 @@ namespace OpenSim.Client.Linden | |||
53 | 53 | ||
54 | protected bool m_enabled = false; // Module is only enabled if running in standalone mode | 54 | protected bool m_enabled = false; // Module is only enabled if running in standalone mode |
55 | 55 | ||
56 | protected bool authenticate; | ||
57 | protected string welcomeMessage; | ||
56 | 58 | ||
57 | public bool RegionLoginsEnabled | 59 | public bool RegionLoginsEnabled |
58 | { | 60 | { |
@@ -68,38 +70,44 @@ namespace OpenSim.Client.Linden | |||
68 | } | 70 | } |
69 | } | 71 | } |
70 | } | 72 | } |
71 | 73 | ||
72 | protected LLStandaloneLoginService m_loginService; | 74 | protected LLStandaloneLoginService m_loginService; |
73 | 75 | ||
74 | #region IRegionModule Members | 76 | #region IRegionModule Members |
75 | 77 | ||
76 | public void Initialise(Scene scene, IConfigSource source) | 78 | public void Initialise(IConfigSource source) |
77 | { | 79 | { |
78 | if (m_firstScene == null) | 80 | IConfig startupConfig = source.Configs["Startup"]; |
81 | if (startupConfig != null) | ||
79 | { | 82 | { |
80 | m_firstScene = scene; | 83 | m_enabled = !startupConfig.GetBoolean("gridmode", false); |
84 | } | ||
81 | 85 | ||
82 | IConfig startupConfig = source.Configs["Startup"]; | 86 | if (m_enabled) |
83 | if (startupConfig != null) | 87 | { |
88 | authenticate = true; | ||
89 | welcomeMessage = "Welcome to OpenSim"; | ||
90 | IConfig standaloneConfig = source.Configs["StandAlone"]; | ||
91 | if (standaloneConfig != null) | ||
84 | { | 92 | { |
85 | m_enabled = !startupConfig.GetBoolean("gridmode", false); | 93 | authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); |
94 | welcomeMessage = standaloneConfig.GetString("welcome_message"); | ||
86 | } | 95 | } |
96 | } | ||
97 | } | ||
98 | |||
99 | public void AddRegion(Scene scene) | ||
100 | { | ||
101 | if (m_firstScene == null) | ||
102 | { | ||
103 | m_firstScene = scene; | ||
87 | 104 | ||
88 | if (m_enabled) | 105 | if (m_enabled) |
89 | { | 106 | { |
90 | bool authenticate = true; | ||
91 | string welcomeMessage = "Welcome to OpenSim"; | ||
92 | IConfig standaloneConfig = source.Configs["StandAlone"]; | ||
93 | if (standaloneConfig != null) | ||
94 | { | ||
95 | authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); | ||
96 | welcomeMessage = standaloneConfig.GetString("welcome_message"); | ||
97 | } | ||
98 | |||
99 | //TODO: fix casting. | 107 | //TODO: fix casting. |
100 | LibraryRootFolder rootFolder | 108 | LibraryRootFolder rootFolder |
101 | = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; | 109 | = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; |
102 | 110 | ||
103 | IHttpServer httpServer = m_firstScene.CommsManager.HttpServer; | 111 | IHttpServer httpServer = m_firstScene.CommsManager.HttpServer; |
104 | 112 | ||
105 | //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference | 113 | //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference |
@@ -121,6 +129,14 @@ namespace OpenSim.Client.Linden | |||
121 | } | 129 | } |
122 | } | 130 | } |
123 | 131 | ||
132 | public void RemoveRegion(Scene scene) | ||
133 | { | ||
134 | if (m_enabled) | ||
135 | { | ||
136 | RemoveScene(scene); | ||
137 | } | ||
138 | } | ||
139 | |||
124 | public void PostInitialise() | 140 | public void PostInitialise() |
125 | { | 141 | { |
126 | 142 | ||
@@ -131,6 +147,11 @@ namespace OpenSim.Client.Linden | |||
131 | 147 | ||
132 | } | 148 | } |
133 | 149 | ||
150 | public void RegionLoaded(Scene scene) | ||
151 | { | ||
152 | |||
153 | } | ||
154 | |||
134 | public string Name | 155 | public string Name |
135 | { | 156 | { |
136 | get { return "LLStandaloneLoginModule"; } | 157 | get { return "LLStandaloneLoginModule"; } |
@@ -154,6 +175,17 @@ namespace OpenSim.Client.Linden | |||
154 | } | 175 | } |
155 | } | 176 | } |
156 | 177 | ||
178 | protected void RemoveScene(Scene scene) | ||
179 | { | ||
180 | lock (m_scenes) | ||
181 | { | ||
182 | if (m_scenes.Contains(scene)) | ||
183 | { | ||
184 | m_scenes.Remove(scene); | ||
185 | } | ||
186 | } | ||
187 | } | ||
188 | |||
157 | public bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason) | 189 | public bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason) |
158 | { | 190 | { |
159 | Scene scene; | 191 | Scene scene; |