diff options
Diffstat (limited to '')
8 files changed, 397 insertions, 63 deletions
diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs new file mode 100644 index 0000000..3dce578 --- /dev/null +++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs | |||
@@ -0,0 +1,119 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.IO; | ||
30 | using System.Net; | ||
31 | using System.Reflection; | ||
32 | using System.Text; | ||
33 | using log4net; | ||
34 | using OpenSim.Framework.Configuration.XML; | ||
35 | |||
36 | namespace OpenSim.Framework.Configuration.HTTP | ||
37 | { | ||
38 | public class HTTPConfiguration : IGenericConfig | ||
39 | { | ||
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | |||
42 | private RemoteConfigSettings remoteConfigSettings; | ||
43 | |||
44 | private XmlConfiguration xmlConfig; | ||
45 | |||
46 | private string configFileName = String.Empty; | ||
47 | |||
48 | public HTTPConfiguration() | ||
49 | { | ||
50 | remoteConfigSettings = new RemoteConfigSettings("remoteconfig.xml"); | ||
51 | xmlConfig = new XmlConfiguration(); | ||
52 | } | ||
53 | |||
54 | public void SetFileName(string fileName) | ||
55 | { | ||
56 | configFileName = fileName; | ||
57 | } | ||
58 | |||
59 | public void LoadData() | ||
60 | { | ||
61 | try | ||
62 | { | ||
63 | StringBuilder sb = new StringBuilder(); | ||
64 | |||
65 | byte[] buf = new byte[8192]; | ||
66 | HttpWebRequest request = | ||
67 | (HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName); | ||
68 | HttpWebResponse response = (HttpWebResponse) request.GetResponse(); | ||
69 | |||
70 | Stream resStream = response.GetResponseStream(); | ||
71 | |||
72 | string tempString = null; | ||
73 | int count = 0; | ||
74 | |||
75 | do | ||
76 | { | ||
77 | count = resStream.Read(buf, 0, buf.Length); | ||
78 | if (count != 0) | ||
79 | { | ||
80 | tempString = Util.UTF8.GetString(buf, 0, count); | ||
81 | sb.Append(tempString); | ||
82 | } | ||
83 | } while (count > 0); | ||
84 | LoadDataFromString(sb.ToString()); | ||
85 | } | ||
86 | catch (WebException) | ||
87 | { | ||
88 | m_log.Warn("Unable to connect to remote configuration file (" + | ||
89 | remoteConfigSettings.baseConfigURL + configFileName + | ||
90 | "). Creating local file instead."); | ||
91 | xmlConfig.SetFileName(configFileName); | ||
92 | xmlConfig.LoadData(); | ||
93 | } | ||
94 | } | ||
95 | |||
96 | public void LoadDataFromString(string data) | ||
97 | { | ||
98 | xmlConfig.LoadDataFromString(data); | ||
99 | } | ||
100 | |||
101 | public string GetAttribute(string attributeName) | ||
102 | { | ||
103 | return xmlConfig.GetAttribute(attributeName); | ||
104 | } | ||
105 | |||
106 | public bool SetAttribute(string attributeName, string attributeValue) | ||
107 | { | ||
108 | return true; | ||
109 | } | ||
110 | |||
111 | public void Commit() | ||
112 | { | ||
113 | } | ||
114 | |||
115 | public void Close() | ||
116 | { | ||
117 | } | ||
118 | } | ||
119 | } | ||
diff --git a/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs b/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs new file mode 100644 index 0000000..10bc88a --- /dev/null +++ b/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | |||
30 | namespace OpenSim.Framework.Configuration.HTTP | ||
31 | { | ||
32 | public class RemoteConfigSettings | ||
33 | { | ||
34 | private ConfigurationMember configMember; | ||
35 | |||
36 | public string baseConfigURL = String.Empty; | ||
37 | |||
38 | public RemoteConfigSettings(string filename) | ||
39 | { | ||
40 | configMember = | ||
41 | new ConfigurationMember(filename, "REMOTE CONFIG SETTINGS", loadConfigurationOptions, | ||
42 | handleIncomingConfiguration,true); | ||
43 | configMember.forceConfigurationPluginLibrary("OpenSim.Framework.Configuration.XML.dll"); | ||
44 | configMember.performConfigurationRetrieve(); | ||
45 | } | ||
46 | |||
47 | public void loadConfigurationOptions() | ||
48 | { | ||
49 | configMember.addConfigurationOption("base_config_url", | ||
50 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
51 | "URL Containing Configuration Files", "http://localhost/", false); | ||
52 | } | ||
53 | |||
54 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
55 | { | ||
56 | if (configuration_key == "base_config_url") | ||
57 | { | ||
58 | baseConfigURL = (string) configuration_result; | ||
59 | } | ||
60 | return true; | ||
61 | } | ||
62 | } | ||
63 | } | ||
diff --git a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs new file mode 100644 index 0000000..43162fc --- /dev/null +++ b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.IO; | ||
30 | using System.Xml; | ||
31 | |||
32 | namespace OpenSim.Framework.Configuration.XML | ||
33 | { | ||
34 | public class XmlConfiguration : IGenericConfig | ||
35 | { | ||
36 | private XmlDocument doc; | ||
37 | private XmlNode rootNode; | ||
38 | private XmlNode configNode; | ||
39 | private string fileName; | ||
40 | private bool createdFile = false; | ||
41 | |||
42 | public void SetFileName(string file) | ||
43 | { | ||
44 | fileName = file; | ||
45 | } | ||
46 | |||
47 | private void LoadDataToClass() | ||
48 | { | ||
49 | rootNode = doc.SelectSingleNode("Root"); | ||
50 | if (null == rootNode) | ||
51 | throw new Exception("Error: Invalid .xml File. Missing <Root>"); | ||
52 | |||
53 | configNode = rootNode.SelectSingleNode("Config"); | ||
54 | if (null == configNode) | ||
55 | throw new Exception("Error: Invalid .xml File. <Root> should contain a <Config>"); | ||
56 | } | ||
57 | |||
58 | public void LoadData() | ||
59 | { | ||
60 | lock (this) | ||
61 | { | ||
62 | doc = new XmlDocument(); | ||
63 | if (File.Exists(fileName)) | ||
64 | { | ||
65 | XmlTextReader reader = new XmlTextReader(fileName); | ||
66 | reader.WhitespaceHandling = WhitespaceHandling.None; | ||
67 | doc.Load(reader); | ||
68 | reader.Close(); | ||
69 | } | ||
70 | else | ||
71 | { | ||
72 | createdFile = true; | ||
73 | rootNode = doc.CreateNode(XmlNodeType.Element, "Root", String.Empty); | ||
74 | doc.AppendChild(rootNode); | ||
75 | configNode = doc.CreateNode(XmlNodeType.Element, "Config", String.Empty); | ||
76 | rootNode.AppendChild(configNode); | ||
77 | } | ||
78 | |||
79 | LoadDataToClass(); | ||
80 | |||
81 | if (createdFile) | ||
82 | { | ||
83 | Commit(); | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | |||
88 | public void LoadDataFromString(string data) | ||
89 | { | ||
90 | doc = new XmlDocument(); | ||
91 | doc.LoadXml(data); | ||
92 | |||
93 | LoadDataToClass(); | ||
94 | } | ||
95 | |||
96 | public string GetAttribute(string attributeName) | ||
97 | { | ||
98 | string result = null; | ||
99 | if (configNode.Attributes[attributeName] != null) | ||
100 | { | ||
101 | result = ((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value; | ||
102 | } | ||
103 | return result; | ||
104 | } | ||
105 | |||
106 | public bool SetAttribute(string attributeName, string attributeValue) | ||
107 | { | ||
108 | if (configNode.Attributes[attributeName] != null) | ||
109 | { | ||
110 | ((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; | ||
111 | } | ||
112 | else | ||
113 | { | ||
114 | XmlAttribute attri; | ||
115 | attri = doc.CreateAttribute(attributeName); | ||
116 | attri.Value = attributeValue; | ||
117 | configNode.Attributes.Append(attri); | ||
118 | } | ||
119 | return true; | ||
120 | } | ||
121 | |||
122 | public void Commit() | ||
123 | { | ||
124 | if (fileName == null || fileName == String.Empty) | ||
125 | return; | ||
126 | |||
127 | if (!Directory.Exists(Util.configDir())) | ||
128 | { | ||
129 | Directory.CreateDirectory(Util.configDir()); | ||
130 | } | ||
131 | doc.Save(fileName); | ||
132 | } | ||
133 | |||
134 | public void Close() | ||
135 | { | ||
136 | configNode = null; | ||
137 | rootNode = null; | ||
138 | doc = null; | ||
139 | } | ||
140 | } | ||
141 | } | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 50d2f9d..06b1b00 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -218,7 +218,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
218 | fromPos = avatar.AbsolutePosition; | 218 | fromPos = avatar.AbsolutePosition; |
219 | fromName = avatar.Name; | 219 | fromName = avatar.Name; |
220 | fromID = c.Sender.AgentId; | 220 | fromID = c.Sender.AgentId; |
221 | if (avatar.GodLevel > 200) | 221 | if (avatar.GodLevel >= 200) |
222 | { | 222 | { |
223 | fromNamePrefix = m_adminPrefix; | 223 | fromNamePrefix = m_adminPrefix; |
224 | } | 224 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index ffdac58..cbea54c 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -187,7 +187,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
187 | delegate(bool success) | 187 | delegate(bool success) |
188 | { | 188 | { |
189 | if (dialog == (uint)InstantMessageDialog.StartTyping || | 189 | if (dialog == (uint)InstantMessageDialog.StartTyping || |
190 | dialog == (uint)InstantMessageDialog.StopTyping) | 190 | dialog == (uint)InstantMessageDialog.StopTyping || |
191 | dialog == (uint)InstantMessageDialog.MessageFromObject) | ||
191 | { | 192 | { |
192 | return; | 193 | return; |
193 | } | 194 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 83209fc..d025f0c 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -185,13 +185,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
185 | { | 185 | { |
186 | UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage; | 186 | UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage; |
187 | 187 | ||
188 | // If this event has handlers, then the IM will be considered | 188 | // If this event has handlers, then an IM from an agent will be |
189 | // delivered. This will suppress the error message. | 189 | // considered delivered. This will suppress the error message. |
190 | // | 190 | // |
191 | if (handlerUndeliveredMessage != null) | 191 | if (handlerUndeliveredMessage != null) |
192 | { | 192 | { |
193 | handlerUndeliveredMessage(im); | 193 | handlerUndeliveredMessage(im); |
194 | result(true); | 194 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) |
195 | result(true); | ||
196 | else | ||
197 | result(false); | ||
195 | return; | 198 | return; |
196 | } | 199 | } |
197 | 200 | ||
@@ -504,14 +507,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
504 | // | 507 | // |
505 | if (upd.RegionID == prevRegionID) | 508 | if (upd.RegionID == prevRegionID) |
506 | { | 509 | { |
507 | m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); | 510 | // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); |
508 | HandleUndeliveredMessage(im, result); | 511 | HandleUndeliveredMessage(im, result); |
509 | return; | 512 | return; |
510 | } | 513 | } |
511 | } | 514 | } |
512 | else | 515 | else |
513 | { | 516 | { |
514 | m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); | 517 | // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); |
515 | HandleUndeliveredMessage(im, result); | 518 | HandleUndeliveredMessage(im, result); |
516 | return; | 519 | return; |
517 | } | 520 | } |
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index c5cfe75..3fc9327 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -49,61 +49,64 @@ namespace OpenSim.Services.HypergridService | |||
49 | LogManager.GetLogger( | 49 | LogManager.GetLogger( |
50 | MethodBase.GetCurrentMethod().DeclaringType); | 50 | MethodBase.GetCurrentMethod().DeclaringType); |
51 | 51 | ||
52 | IGridService m_GridService; | 52 | private static bool m_Initialized = false; |
53 | IPresenceService m_PresenceService; | ||
54 | IUserAccountService m_UserAccountService; | ||
55 | IUserAgentService m_UserAgentService; | ||
56 | ISimulationService m_SimulationService; | ||
57 | 53 | ||
58 | string m_AuthDll; | 54 | private static IGridService m_GridService; |
55 | private static IPresenceService m_PresenceService; | ||
56 | private static IUserAccountService m_UserAccountService; | ||
57 | private static IUserAgentService m_UserAgentService; | ||
58 | private static ISimulationService m_SimulationService; | ||
59 | 59 | ||
60 | UUID m_ScopeID; | 60 | private static UUID m_ScopeID; |
61 | bool m_AllowTeleportsToAnyRegion; | 61 | private static bool m_AllowTeleportsToAnyRegion; |
62 | string m_ExternalName; | 62 | private static string m_ExternalName; |
63 | GridRegion m_DefaultGatewayRegion; | 63 | private static GridRegion m_DefaultGatewayRegion; |
64 | 64 | ||
65 | public GatekeeperService(IConfigSource config, ISimulationService simService) | 65 | public GatekeeperService(IConfigSource config, ISimulationService simService) |
66 | { | 66 | { |
67 | IConfig serverConfig = config.Configs["GatekeeperService"]; | 67 | if (!m_Initialized) |
68 | if (serverConfig == null) | 68 | { |
69 | throw new Exception(String.Format("No section GatekeeperService in config file")); | 69 | m_Initialized = true; |
70 | 70 | ||
71 | string accountService = serverConfig.GetString("UserAccountService", String.Empty); | 71 | IConfig serverConfig = config.Configs["GatekeeperService"]; |
72 | string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); | 72 | if (serverConfig == null) |
73 | string gridService = serverConfig.GetString("GridService", String.Empty); | 73 | throw new Exception(String.Format("No section GatekeeperService in config file")); |
74 | string presenceService = serverConfig.GetString("PresenceService", String.Empty); | 74 | |
75 | string simulationService = serverConfig.GetString("SimulationService", String.Empty); | 75 | string accountService = serverConfig.GetString("UserAccountService", String.Empty); |
76 | 76 | string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); | |
77 | //m_AuthDll = serverConfig.GetString("AuthenticationService", String.Empty); | 77 | string gridService = serverConfig.GetString("GridService", String.Empty); |
78 | 78 | string presenceService = serverConfig.GetString("PresenceService", String.Empty); | |
79 | // These 3 are mandatory, the others aren't | 79 | string simulationService = serverConfig.GetString("SimulationService", String.Empty); |
80 | if (gridService == string.Empty || presenceService == string.Empty || m_AuthDll == string.Empty) | 80 | |
81 | throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); | 81 | // These 3 are mandatory, the others aren't |
82 | 82 | if (gridService == string.Empty || presenceService == string.Empty) | |
83 | string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); | 83 | throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); |
84 | UUID.TryParse(scope, out m_ScopeID); | 84 | |
85 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); | 85 | string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); |
86 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | 86 | UUID.TryParse(scope, out m_ScopeID); |
87 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); | 87 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); |
88 | 88 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | |
89 | Object[] args = new Object[] { config }; | 89 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); |
90 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 90 | |
91 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); | 91 | Object[] args = new Object[] { config }; |
92 | 92 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | |
93 | if (accountService != string.Empty) | 93 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); |
94 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); | 94 | |
95 | if (homeUsersService != string.Empty) | 95 | if (accountService != string.Empty) |
96 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); | 96 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); |
97 | 97 | if (homeUsersService != string.Empty) | |
98 | if (simService != null) | 98 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); |
99 | m_SimulationService = simService; | 99 | |
100 | else if (simulationService != string.Empty) | 100 | if (simService != null) |
101 | m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); | 101 | m_SimulationService = simService; |
102 | 102 | else if (simulationService != string.Empty) | |
103 | if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) | 103 | m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); |
104 | throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); | 104 | |
105 | 105 | if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) | |
106 | m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); | 106 | throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); |
107 | |||
108 | m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); | ||
109 | } | ||
107 | } | 110 | } |
108 | 111 | ||
109 | public GatekeeperService(IConfigSource config) | 112 | public GatekeeperService(IConfigSource config) |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index aec82e8..4bee4b5 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -61,7 +61,8 @@ namespace OpenSim.Services.HypergridService | |||
61 | 61 | ||
62 | protected static IGridUserService m_GridUserService; | 62 | protected static IGridUserService m_GridUserService; |
63 | protected static IGridService m_GridService; | 63 | protected static IGridService m_GridService; |
64 | protected static GatekeeperServiceConnector m_GatekeeperConnector; | 64 | //protected static GatekeeperServiceConnector m_GatekeeperConnector; |
65 | protected static IGatekeeperService m_GatekeeperService; | ||
65 | 66 | ||
66 | protected static bool m_BypassClientVerification; | 67 | protected static bool m_BypassClientVerification; |
67 | 68 | ||
@@ -69,6 +70,8 @@ namespace OpenSim.Services.HypergridService | |||
69 | { | 70 | { |
70 | if (!m_Initialized) | 71 | if (!m_Initialized) |
71 | { | 72 | { |
73 | m_Initialized = true; | ||
74 | |||
72 | m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); | 75 | m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); |
73 | 76 | ||
74 | IConfig serverConfig = config.Configs["UserAgentService"]; | 77 | IConfig serverConfig = config.Configs["UserAgentService"]; |
@@ -77,18 +80,18 @@ namespace OpenSim.Services.HypergridService | |||
77 | 80 | ||
78 | string gridService = serverConfig.GetString("GridService", String.Empty); | 81 | string gridService = serverConfig.GetString("GridService", String.Empty); |
79 | string gridUserService = serverConfig.GetString("GridUserService", String.Empty); | 82 | string gridUserService = serverConfig.GetString("GridUserService", String.Empty); |
83 | string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); | ||
80 | 84 | ||
81 | m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); | 85 | m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); |
82 | 86 | ||
83 | if (gridService == string.Empty || gridUserService == string.Empty) | 87 | if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) |
84 | throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); | 88 | throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); |
85 | 89 | ||
86 | Object[] args = new Object[] { config }; | 90 | Object[] args = new Object[] { config }; |
87 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 91 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
88 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); | 92 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); |
89 | m_GatekeeperConnector = new GatekeeperServiceConnector(); | 93 | //m_GatekeeperConnector = new GatekeeperServiceConnector(); |
90 | 94 | m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args); | |
91 | m_Initialized = true; | ||
92 | } | 95 | } |
93 | } | 96 | } |
94 | 97 | ||
@@ -135,7 +138,8 @@ namespace OpenSim.Services.HypergridService | |||
135 | agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); | 138 | agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); |
136 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); | 139 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); |
137 | 140 | ||
138 | bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); | 141 | //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); |
142 | bool success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); | ||
139 | 143 | ||
140 | if (!success) | 144 | if (!success) |
141 | { | 145 | { |