aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-07-31 00:57:50 +0100
committerMelanie2010-07-31 00:57:50 +0100
commit3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116 (patch)
tree87bbf9ba4bf4e4e3b31e00d276dda98f1ecd156e
parentBannination fixes. Objects in nonpublic parcels were muted by default. Gods (diff)
parentSlight improvement on previous commit. (diff)
downloadopensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.zip
opensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.tar.gz
opensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.tar.bz2
opensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.tar.xz
Merge branch 'master' into careminster-presence-refactor
-rw-r--r--OpenSim/Framework/ACL.cs252
-rw-r--r--OpenSim/Framework/ConfigBase.cs38
-rw-r--r--OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs119
-rw-r--r--OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs63
-rw-r--r--OpenSim/Framework/Configuration/XML/XmlConfiguration.cs141
-rw-r--r--OpenSim/Framework/FriendRegionInfo.cs38
-rw-r--r--OpenSim/Framework/GridConfig.cs162
-rw-r--r--OpenSim/Framework/HGNetworkServersInfo.cs107
-rw-r--r--OpenSim/Framework/IClientFileTransfer.cs40
-rw-r--r--OpenSim/Framework/ILoginServiceToRegionsConnector.cs41
-rw-r--r--OpenSim/Framework/MessageServerConfig.cs152
-rw-r--r--OpenSim/Framework/NetworkUtil.cs84
-rw-r--r--OpenSim/Framework/Tests/ACLTest.cs125
-rw-r--r--OpenSim/Framework/UserConfig.cs231
-rw-r--r--OpenSim/Framework/WebUtil.cs7
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs367
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs59
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs (renamed from OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs)2
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs69
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs269
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs24
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs2
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs11
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs6
-rw-r--r--prebuild.xml76
28 files changed, 190 insertions, 2322 deletions
diff --git a/OpenSim/Framework/ACL.cs b/OpenSim/Framework/ACL.cs
deleted file mode 100644
index f76e8b7..0000000
--- a/OpenSim/Framework/ACL.cs
+++ /dev/null
@@ -1,252 +0,0 @@
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
28using System;
29using System.Collections.Generic;
30
31namespace OpenSim.Framework
32{
33 // ACL Class
34 // Modelled after the structure of the Zend ACL Framework Library
35 // with one key difference - the tree will search for all matching
36 // permissions rather than just the first. Deny permissions will
37 // override all others.
38
39 #region ACL Core Class
40
41 /// <summary>
42 /// Access Control List Engine
43 /// </summary>
44 public class ACL
45 {
46 private Dictionary<string, Resource> Resources = new Dictionary<string, Resource>();
47 private Dictionary<string, Role> Roles = new Dictionary<string, Role>();
48
49 /// <summary>
50 /// Adds a new role
51 /// </summary>
52 /// <param name="role"></param>
53 /// <returns></returns>
54 public ACL AddRole(Role role)
55 {
56 if (Roles.ContainsKey(role.Name))
57 throw new AlreadyContainsRoleException(role);
58
59 Roles.Add(role.Name, role);
60
61 return this;
62 }
63
64 /// <summary>
65 /// Adds a new resource
66 /// </summary>
67 /// <param name="resource"></param>
68 /// <returns></returns>
69 public ACL AddResource(Resource resource)
70 {
71 Resources.Add(resource.Name, resource);
72
73 return this;
74 }
75
76 /// <summary>
77 /// Permision for user/roll on a resource
78 /// </summary>
79 /// <param name="role"></param>
80 /// <param name="resource"></param>
81 /// <returns></returns>
82 public Permission HasPermission(string role, string resource)
83 {
84 if (!Roles.ContainsKey(role))
85 throw new KeyNotFoundException();
86
87 if (!Resources.ContainsKey(resource))
88 throw new KeyNotFoundException();
89
90 return Roles[role].RequestPermission(resource);
91 }
92
93 public ACL GrantPermission(string role, string resource)
94 {
95 if (!Roles.ContainsKey(role))
96 throw new KeyNotFoundException();
97
98 if (!Resources.ContainsKey(resource))
99 throw new KeyNotFoundException();
100
101 Roles[role].GivePermission(resource, Permission.Allow);
102
103 return this;
104 }
105
106 public ACL DenyPermission(string role, string resource)
107 {
108 if (!Roles.ContainsKey(role))
109 throw new KeyNotFoundException();
110
111 if (!Resources.ContainsKey(resource))
112 throw new KeyNotFoundException();
113
114 Roles[role].GivePermission(resource, Permission.Deny);
115
116 return this;
117 }
118
119 public ACL ResetPermission(string role, string resource)
120 {
121 if (!Roles.ContainsKey(role))
122 throw new KeyNotFoundException();
123
124 if (!Resources.ContainsKey(resource))
125 throw new KeyNotFoundException();
126
127 Roles[role].GivePermission(resource, Permission.None);
128
129 return this;
130 }
131 }
132
133 #endregion
134
135 #region Exceptions
136
137 /// <summary>
138 /// Thrown when an ACL attempts to add a duplicate role.
139 /// </summary>
140 public class AlreadyContainsRoleException : Exception
141 {
142 protected Role m_role;
143
144 public AlreadyContainsRoleException(Role role)
145 {
146 m_role = role;
147 }
148
149 public Role ErrorRole
150 {
151 get { return m_role; }
152 }
153
154 public override string ToString()
155 {
156 return "This ACL already contains a role called '" + m_role.Name + "'.";
157 }
158 }
159
160 #endregion
161
162 #region Roles and Resources
163
164 /// <summary>
165 /// Does this Role have permission to access a specified Resource?
166 /// </summary>
167 public enum Permission
168 {
169 Deny,
170 None,
171 Allow
172 } ;
173
174 /// <summary>
175 /// A role class, for use with Users or Groups
176 /// </summary>
177 public class Role
178 {
179 private string m_name;
180 private Role[] m_parents;
181 private Dictionary<string, Permission> m_resources = new Dictionary<string, Permission>();
182
183 public Role(string name)
184 {
185 m_name = name;
186 m_parents = null;
187 }
188
189 public Role(string name, Role[] parents)
190 {
191 m_name = name;
192 m_parents = parents;
193 }
194
195 public string Name
196 {
197 get { return m_name; }
198 }
199
200 public Permission RequestPermission(string resource)
201 {
202 return RequestPermission(resource, Permission.None);
203 }
204
205 public Permission RequestPermission(string resource, Permission current)
206 {
207 // Deny permissions always override any others
208 if (current == Permission.Deny)
209 return current;
210
211 Permission temp = Permission.None;
212
213 // Pickup non-None permissions
214 if (m_resources.ContainsKey(resource) && m_resources[resource] != Permission.None)
215 temp = m_resources[resource];
216
217 if (m_parents != null)
218 {
219 foreach (Role parent in m_parents)
220 {
221 temp = parent.RequestPermission(resource, temp);
222 }
223 }
224
225 return temp;
226 }
227
228 public void GivePermission(string resource, Permission perm)
229 {
230 m_resources[resource] = perm;
231 }
232 }
233
234 public class Resource
235 {
236 private string m_name;
237
238 public Resource(string name)
239 {
240 m_name = name;
241 }
242
243 public string Name
244 {
245 get { return m_name; }
246 }
247 }
248
249 #endregion
250
251
252} \ No newline at end of file
diff --git a/OpenSim/Framework/ConfigBase.cs b/OpenSim/Framework/ConfigBase.cs
deleted file mode 100644
index 40ec32f..0000000
--- a/OpenSim/Framework/ConfigBase.cs
+++ /dev/null
@@ -1,38 +0,0 @@
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
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32namespace OpenSim.Framework
33{
34 public abstract class ConfigBase
35 {
36 protected ConfigurationMember m_configMember;
37 }
38}
diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
deleted file mode 100644
index 3dce578..0000000
--- a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
+++ /dev/null
@@ -1,119 +0,0 @@
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
28using System;
29using System.IO;
30using System.Net;
31using System.Reflection;
32using System.Text;
33using log4net;
34using OpenSim.Framework.Configuration.XML;
35
36namespace 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
deleted file mode 100644
index 10bc88a..0000000
--- a/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs
+++ /dev/null
@@ -1,63 +0,0 @@
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
28using System;
29
30namespace 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
deleted file mode 100644
index 43162fc..0000000
--- a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs
+++ /dev/null
@@ -1,141 +0,0 @@
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
28using System;
29using System.IO;
30using System.Xml;
31
32namespace 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/Framework/FriendRegionInfo.cs b/OpenSim/Framework/FriendRegionInfo.cs
deleted file mode 100644
index 68b5f3d..0000000
--- a/OpenSim/Framework/FriendRegionInfo.cs
+++ /dev/null
@@ -1,38 +0,0 @@
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
28using OpenMetaverse;
29
30namespace OpenSim.Framework
31{
32 public class FriendRegionInfo
33 {
34 public bool isOnline;
35 public ulong regionHandle;
36 public UUID regionID;
37 }
38}
diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs
deleted file mode 100644
index 3a43a14..0000000
--- a/OpenSim/Framework/GridConfig.cs
+++ /dev/null
@@ -1,162 +0,0 @@
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
28using System;
29
30namespace OpenSim.Framework
31{
32 public class GridConfig:ConfigBase
33 {
34 public string AllowForcefulBanlines = "TRUE";
35 public bool AllowRegionRegistration = true;
36 public string AssetRecvKey = String.Empty;
37 public string AssetSendKey = String.Empty;
38
39 public string DatabaseProvider = String.Empty;
40 public string DatabaseConnect = String.Empty;
41 public string DefaultAssetServer = String.Empty;
42 public string DefaultUserServer = String.Empty;
43 public uint HttpPort = ConfigSettings.DefaultGridServerHttpPort;
44 public string SimRecvKey = String.Empty;
45 public string SimSendKey = String.Empty;
46 public string UserRecvKey = String.Empty;
47 public string UserSendKey = String.Empty;
48 public string ConsoleUser = String.Empty;
49 public string ConsolePass = String.Empty;
50
51 public GridConfig(string description, string filename)
52 {
53 m_configMember =
54 new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true);
55 m_configMember.performConfigurationRetrieve();
56 }
57
58 public void loadConfigurationOptions()
59 {
60 m_configMember.addConfigurationOption("default_asset_server",
61 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
62 "Default Asset Server URI",
63 "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString() + "/",
64 false);
65 m_configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
66 "Key to send to asset server", "null", false);
67 m_configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
68 "Key to expect from asset server", "null", false);
69
70 m_configMember.addConfigurationOption("default_user_server",
71 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
72 "Default User Server URI",
73 "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString() + "/", false);
74 m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
75 "Key to send to user server", "null", false);
76 m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
77 "Key to expect from user server", "null", false);
78
79 m_configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
80 "Key to send to a simulator", "null", false);
81 m_configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
82 "Key to expect from a simulator", "null", false);
83 m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
84 "DLL for database provider", "OpenSim.Data.MySQL.dll", false);
85 m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
86 "Database connect string", "", false);
87
88 m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
89 "Http Listener port", ConfigSettings.DefaultGridServerHttpPort.ToString(), false);
90
91 m_configMember.addConfigurationOption("allow_forceful_banlines",
92 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
93 "Allow Forceful Banlines", "TRUE", true);
94
95 m_configMember.addConfigurationOption("allow_region_registration",
96 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
97 "Allow regions to register immediately upon grid server startup? true/false",
98 "True",
99 false);
100 m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
101 "Remote console access user name [Default: disabled]", "", false);
102
103 m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
104 "Remote console access password [Default: disabled]", "", false);
105
106 }
107
108 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
109 {
110 switch (configuration_key)
111 {
112 case "default_asset_server":
113 DefaultAssetServer = (string) configuration_result;
114 break;
115 case "asset_send_key":
116 AssetSendKey = (string) configuration_result;
117 break;
118 case "asset_recv_key":
119 AssetRecvKey = (string) configuration_result;
120 break;
121 case "default_user_server":
122 DefaultUserServer = (string) configuration_result;
123 break;
124 case "user_send_key":
125 UserSendKey = (string) configuration_result;
126 break;
127 case "user_recv_key":
128 UserRecvKey = (string) configuration_result;
129 break;
130 case "sim_send_key":
131 SimSendKey = (string) configuration_result;
132 break;
133 case "sim_recv_key":
134 SimRecvKey = (string) configuration_result;
135 break;
136 case "database_provider":
137 DatabaseProvider = (string) configuration_result;
138 break;
139 case "database_connect":
140 DatabaseConnect = (string) configuration_result;
141 break;
142 case "http_port":
143 HttpPort = (uint) configuration_result;
144 break;
145 case "allow_forceful_banlines":
146 AllowForcefulBanlines = (string) configuration_result;
147 break;
148 case "allow_region_registration":
149 AllowRegionRegistration = (bool)configuration_result;
150 break;
151 case "console_user":
152 ConsoleUser = (string)configuration_result;
153 break;
154 case "console_pass":
155 ConsolePass = (string)configuration_result;
156 break;
157 }
158
159 return true;
160 }
161 }
162}
diff --git a/OpenSim/Framework/HGNetworkServersInfo.cs b/OpenSim/Framework/HGNetworkServersInfo.cs
deleted file mode 100644
index 0865576..0000000
--- a/OpenSim/Framework/HGNetworkServersInfo.cs
+++ /dev/null
@@ -1,107 +0,0 @@
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
28using System.Net;
29
30namespace OpenSim.Framework
31{
32 public class HGNetworkServersInfo
33 {
34
35 public readonly string LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI;
36
37 private static HGNetworkServersInfo m_singleton;
38 public static HGNetworkServersInfo Singleton
39 {
40 get { return m_singleton; }
41 }
42
43 public static void Init(string assetserver, string inventoryserver, string userserver)
44 {
45 m_singleton = new HGNetworkServersInfo(assetserver, inventoryserver, userserver);
46
47 }
48
49 private HGNetworkServersInfo(string a, string i, string u)
50 {
51 LocalAssetServerURI = ServerURI(a);
52 LocalInventoryServerURI = ServerURI(i);
53 LocalUserServerURI = ServerURI(u);
54 }
55
56 public bool IsLocalUser(string userserver)
57 {
58 string userServerURI = ServerURI(userserver);
59 bool ret = (((userServerURI == null) || (userServerURI == "") || (userServerURI == LocalUserServerURI)));
60 //m_log.Debug("-------------> HGNetworkServersInfo.IsLocalUser? " + ret + "(userServer=" + userServerURI + "; localuserserver=" + LocalUserServerURI + ")");
61 return ret;
62 }
63
64 public bool IsLocalUser(UserProfileData userData)
65 {
66 if (userData != null)
67 {
68 if (userData is ForeignUserProfileData)
69 return IsLocalUser(((ForeignUserProfileData)userData).UserServerURI);
70 else
71 return true;
72 }
73 else
74 // Something fishy; ignore it
75 return true;
76 }
77
78 public static string ServerURI(string uri)
79 {
80 // Get rid of eventual slashes at the end
81 try
82 {
83 if (uri.EndsWith("/"))
84 uri = uri.Substring(0, uri.Length - 1);
85 }
86 catch { }
87
88 IPAddress ipaddr1 = null;
89 string port1 = "";
90 try
91 {
92 ipaddr1 = Util.GetHostFromURL(uri);
93 }
94 catch { }
95
96 try
97 {
98 port1 = uri.Split(new char[] { ':' })[2];
99 }
100 catch { }
101
102 // We tried our best to convert the domain names to IP addresses
103 return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri;
104 }
105
106 }
107}
diff --git a/OpenSim/Framework/IClientFileTransfer.cs b/OpenSim/Framework/IClientFileTransfer.cs
deleted file mode 100644
index f947b17..0000000
--- a/OpenSim/Framework/IClientFileTransfer.cs
+++ /dev/null
@@ -1,40 +0,0 @@
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
28using OpenMetaverse;
29
30namespace OpenSim.Framework
31{
32 public delegate void UploadComplete(string filename, UUID fileID, ulong transferID, byte[] fileData, IClientAPI remoteClient);
33 public delegate void UploadAborted(string filename, UUID fileID, ulong transferID, IClientAPI remoteClient);
34
35 public interface IClientFileTransfer
36 {
37 bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback);
38 bool RequestUpload(UUID fileID, UploadComplete uploadCompleteCallback, UploadAborted abortCallback);
39 }
40}
diff --git a/OpenSim/Framework/ILoginServiceToRegionsConnector.cs b/OpenSim/Framework/ILoginServiceToRegionsConnector.cs
deleted file mode 100644
index 5a155c1..0000000
--- a/OpenSim/Framework/ILoginServiceToRegionsConnector.cs
+++ /dev/null
@@ -1,41 +0,0 @@
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
28using System;
29using OpenMetaverse;
30
31namespace OpenSim.Framework
32{
33 public interface ILoginServiceToRegionsConnector
34 {
35 void LogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message);
36 bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason);
37 RegionInfo RequestClosestRegion(string region);
38 RegionInfo RequestNeighbourInfo(UUID regionID);
39 RegionInfo RequestNeighbourInfo(ulong regionhandle);
40 }
41}
diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs
deleted file mode 100644
index 884c0ea..0000000
--- a/OpenSim/Framework/MessageServerConfig.cs
+++ /dev/null
@@ -1,152 +0,0 @@
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
28using System;
29
30namespace OpenSim.Framework
31{
32 /// <summary>
33 /// Message Server Config - Configuration of the Message Server
34 /// </summary>
35 public class MessageServerConfig:ConfigBase
36 {
37 public string DatabaseProvider = String.Empty;
38 public string DatabaseConnect = String.Empty;
39 public string GridCommsProvider = String.Empty;
40 public string GridRecvKey = String.Empty;
41 public string GridSendKey = String.Empty;
42 public string GridServerURL = String.Empty;
43 public uint HttpPort = ConfigSettings.DefaultMessageServerHttpPort;
44 public bool HttpSSL = ConfigSettings.DefaultMessageServerHttpSSL;
45 public string MessageServerIP = String.Empty;
46 public string UserRecvKey = String.Empty;
47 public string UserSendKey = String.Empty;
48 public string UserServerURL = String.Empty;
49 public string ConsoleUser = String.Empty;
50 public string ConsolePass = String.Empty;
51
52 public MessageServerConfig(string description, string filename)
53 {
54 m_configMember =
55 new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true);
56 m_configMember.performConfigurationRetrieve();
57 }
58
59 public void loadConfigurationOptions()
60 {
61 m_configMember.addConfigurationOption("default_user_server",
62 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
63 "Default User Server URI",
64 "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString() + "/", false);
65 m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
66 "Key to send to user server", "null", false);
67 m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
68 "Key to expect from user server", "null", false);
69 m_configMember.addConfigurationOption("default_grid_server",
70 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
71 "Default Grid Server URI",
72 "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort.ToString() + "/", false);
73 m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
74 "Key to send to grid server", "null", false);
75 m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
76 "Key to expect from grid server", "null", false);
77
78 m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
79 "Connection String for Database", "", false);
80
81 m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
82 "DLL for database provider", "OpenSim.Data.MySQL.dll", false);
83
84 m_configMember.addConfigurationOption("region_comms_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
85 "DLL for comms provider", "OpenSim.Region.Communications.OGS1.dll", false);
86
87 m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
88 "Http Listener port", ConfigSettings.DefaultMessageServerHttpPort.ToString(), false);
89 m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
90 "Use SSL? true/false", ConfigSettings.DefaultMessageServerHttpSSL.ToString(), false);
91 m_configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
92 "My Published IP Address", "127.0.0.1", false);
93 m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
94 "Remote console access user name [Default: disabled]", "", false);
95
96 m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
97 "Remote console access password [Default: disabled]", "", false);
98
99 }
100
101 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
102 {
103 switch (configuration_key)
104 {
105 case "default_user_server":
106 UserServerURL = (string) configuration_result;
107 break;
108 case "user_send_key":
109 UserSendKey = (string) configuration_result;
110 break;
111 case "user_recv_key":
112 UserRecvKey = (string) configuration_result;
113 break;
114 case "default_grid_server":
115 GridServerURL = (string) configuration_result;
116 break;
117 case "grid_send_key":
118 GridSendKey = (string) configuration_result;
119 break;
120 case "grid_recv_key":
121 GridRecvKey = (string) configuration_result;
122 break;
123 case "database_provider":
124 DatabaseProvider = (string) configuration_result;
125 break;
126 case "database_connect":
127 DatabaseConnect = (string)configuration_result;
128 break;
129 case "http_port":
130 HttpPort = (uint) configuration_result;
131 break;
132 case "http_ssl":
133 HttpSSL = (bool) configuration_result;
134 break;
135 case "region_comms_provider":
136 GridCommsProvider = (string) configuration_result;
137 break;
138 case "published_ip":
139 MessageServerIP = (string) configuration_result;
140 break;
141 case "console_user":
142 ConsoleUser = (string)configuration_result;
143 break;
144 case "console_pass":
145 ConsolePass = (string)configuration_result;
146 break;
147 }
148
149 return true;
150 }
151 }
152}
diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs
index 5fe343d..831ff70 100644
--- a/OpenSim/Framework/NetworkUtil.cs
+++ b/OpenSim/Framework/NetworkUtil.cs
@@ -31,6 +31,7 @@ using System.Net.Sockets;
31using System.Net; 31using System.Net;
32using System.Net.NetworkInformation; 32using System.Net.NetworkInformation;
33using System.Reflection; 33using System.Reflection;
34using System.Text;
34using log4net; 35using log4net;
35 36
36namespace OpenSim.Framework 37namespace OpenSim.Framework
@@ -180,10 +181,18 @@ namespace OpenSim.Framework
180 throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client"); 181 throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client");
181 } 182 }
182 183
184 static IPAddress externalIPAddress;
185
183 static NetworkUtil() 186 static NetworkUtil()
184 { 187 {
185 try 188 try
186 { 189 {
190 externalIPAddress = GetExternalIP();
191 }
192 catch { /* ignore */ }
193
194 try
195 {
187 foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces()) 196 foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
188 { 197 {
189 foreach (UnicastIPAddressInformation address in ni.GetIPProperties().UnicastAddresses) 198 foreach (UnicastIPAddressInformation address in ni.GetIPProperties().UnicastAddresses)
@@ -244,5 +253,80 @@ namespace OpenSim.Framework
244 } 253 }
245 return defaultHostname; 254 return defaultHostname;
246 } 255 }
256
257 public static IPAddress GetExternalIPOf(IPAddress user)
258 {
259 if (externalIPAddress == null)
260 return user;
261
262 if (user.ToString() == "127.0.0.1")
263 {
264 m_log.Info("[NetworkUtil] 127.0.0.1 user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
265 return externalIPAddress;
266 }
267 // Check if we're accessing localhost.
268 foreach (IPAddress host in Dns.GetHostAddresses(Dns.GetHostName()))
269 {
270 if (host.Equals(user) && host.AddressFamily == AddressFamily.InterNetwork)
271 {
272 m_log.Info("[NetworkUtil] Localhost user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
273 return externalIPAddress;
274 }
275 }
276
277 // Check for same LAN segment
278 foreach (KeyValuePair<IPAddress, IPAddress> subnet in m_subnets)
279 {
280 byte[] subnetBytes = subnet.Value.GetAddressBytes();
281 byte[] localBytes = subnet.Key.GetAddressBytes();
282 byte[] destBytes = user.GetAddressBytes();
283
284 if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length)
285 return user;
286
287 bool valid = true;
288
289 for (int i = 0; i < subnetBytes.Length; i++)
290 {
291 if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i]))
292 {
293 valid = false;
294 break;
295 }
296 }
297
298 if (subnet.Key.AddressFamily != AddressFamily.InterNetwork)
299 valid = false;
300
301 if (valid)
302 {
303 m_log.Info("[NetworkUtil] Local LAN user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
304 return externalIPAddress;
305 }
306 }
307
308 // Otherwise, return user address
309 return user;
310 }
311
312 private static IPAddress GetExternalIP()
313 {
314 string whatIsMyIp = "http://www.whatismyip.com/automation/n09230945.asp";
315 WebClient wc = new WebClient();
316 UTF8Encoding utf8 = new UTF8Encoding();
317 string requestHtml = "";
318 try
319 {
320 requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp));
321 }
322 catch (WebException we)
323 {
324 m_log.Info("[NetworkUtil]: Exception in GetExternalIP: " + we.ToString());
325 return null;
326 }
327
328 IPAddress externalIp = IPAddress.Parse(requestHtml);
329 return externalIp;
330 }
247 } 331 }
248} 332}
diff --git a/OpenSim/Framework/Tests/ACLTest.cs b/OpenSim/Framework/Tests/ACLTest.cs
deleted file mode 100644
index 06e860e..0000000
--- a/OpenSim/Framework/Tests/ACLTest.cs
+++ /dev/null
@@ -1,125 +0,0 @@
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
28using System;
29using NUnit.Framework;
30using System.Collections.Generic;
31
32
33namespace OpenSim.Framework.Tests
34{
35 [TestFixture]
36 public class ACLTest
37 {
38 #region Tests
39
40 /// <summary>
41 /// ACL Test class
42 /// </summary>
43 [Test]
44 public void ACLTest01()
45 {
46 ACL acl = new ACL();
47
48 Role Guests = new Role("Guests");
49 acl.AddRole(Guests);
50
51 Role[] parents = new Role[1];
52 parents[0] = Guests;
53
54 Role JoeGuest = new Role("JoeGuest", parents);
55 acl.AddRole(JoeGuest);
56
57 Resource CanBuild = new Resource("CanBuild");
58 acl.AddResource(CanBuild);
59
60
61 acl.GrantPermission("Guests", "CanBuild");
62
63 Permission perm = acl.HasPermission("JoeGuest", "CanBuild");
64 Assert.That(perm == Permission.Allow, "JoeGuest should have permission to build");
65 perm = Permission.None;
66 try
67 {
68 perm = acl.HasPermission("unknownGuest", "CanBuild");
69
70 }
71 catch (KeyNotFoundException)
72 {
73
74
75 }
76 catch (Exception)
77 {
78 Assert.That(false,"Exception thrown should have been KeyNotFoundException");
79 }
80 Assert.That(perm == Permission.None,"Permission None should be set because exception should have been thrown");
81
82 }
83
84 [Test]
85 public void KnownButPermissionDenyAndPermissionNoneUserTest()
86 {
87 ACL acl = new ACL();
88
89 Role Guests = new Role("Guests");
90 acl.AddRole(Guests);
91 Role Administrators = new Role("Administrators");
92 acl.AddRole(Administrators);
93 Role[] Guestparents = new Role[1];
94 Role[] Adminparents = new Role[1];
95
96 Guestparents[0] = Guests;
97 Adminparents[0] = Administrators;
98
99 Role JoeGuest = new Role("JoeGuest", Guestparents);
100 acl.AddRole(JoeGuest);
101
102 Resource CanBuild = new Resource("CanBuild");
103 acl.AddResource(CanBuild);
104
105 Resource CanScript = new Resource("CanScript");
106 acl.AddResource(CanScript);
107
108 Resource CanRestart = new Resource("CanRestart");
109 acl.AddResource(CanRestart);
110
111 acl.GrantPermission("Guests", "CanBuild");
112 acl.DenyPermission("Guests", "CanRestart");
113
114 acl.GrantPermission("Administrators", "CanScript");
115
116 acl.GrantPermission("Administrators", "CanRestart");
117 Permission setPermission = acl.HasPermission("JoeGuest", "CanRestart");
118 Assert.That(setPermission == Permission.Deny, "Guests Should not be able to restart");
119 Assert.That(acl.HasPermission("JoeGuest", "CanScript") == Permission.None,
120 "No Explicit Permissions set so should be Permission.None");
121 }
122
123 #endregion
124 }
125}
diff --git a/OpenSim/Framework/UserConfig.cs b/OpenSim/Framework/UserConfig.cs
deleted file mode 100644
index 0fa82cf..0000000
--- a/OpenSim/Framework/UserConfig.cs
+++ /dev/null
@@ -1,231 +0,0 @@
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
28using System;
29using System.IO;
30
31namespace OpenSim.Framework
32{
33 /// <summary>
34 /// UserConfig -- For User Server Configuration
35 /// </summary>
36 public class UserConfig:ConfigBase
37 {
38 public string DatabaseProvider = String.Empty;
39 public string DatabaseConnect = String.Empty;
40 public string DefaultStartupMsg = String.Empty;
41 public uint DefaultX = 1000;
42 public uint DefaultY = 1000;
43 public string GridRecvKey = String.Empty;
44 public string GridSendKey = String.Empty;
45 public uint HttpPort = ConfigSettings.DefaultUserServerHttpPort;
46 public bool HttpSSL = ConfigSettings.DefaultUserServerHttpSSL;
47 public uint DefaultUserLevel = 0;
48 public string LibraryXmlfile = "";
49 public string ConsoleUser = String.Empty;
50 public string ConsolePass = String.Empty;
51
52 private Uri m_inventoryUrl;
53
54 public Uri InventoryUrl
55 {
56 get
57 {
58 return m_inventoryUrl;
59 }
60 set
61 {
62 m_inventoryUrl = value;
63 }
64 }
65
66 private Uri m_authUrl;
67 public Uri AuthUrl
68 {
69 get
70 {
71 return m_authUrl;
72 }
73 set
74 {
75 m_authUrl = value;
76 }
77 }
78
79 private Uri m_gridServerURL;
80
81 public Uri GridServerURL
82 {
83 get
84 {
85 return m_gridServerURL;
86 }
87 set
88 {
89 m_gridServerURL = value;
90 }
91 }
92
93 public bool EnableLLSDLogin = true;
94
95 public bool EnableHGLogin = true;
96
97 public UserConfig()
98 {
99 // weird, but UserManagerBase needs this.
100 }
101 public UserConfig(string description, string filename)
102 {
103 m_configMember =
104 new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true);
105 m_configMember.performConfigurationRetrieve();
106 }
107
108 public void loadConfigurationOptions()
109 {
110 m_configMember.addConfigurationOption("default_startup_message",
111 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
112 "Default Startup Message", "Welcome to OGS", false);
113
114 m_configMember.addConfigurationOption("default_grid_server",
115 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
116 "Default Grid Server URI",
117 "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort + "/", false);
118 m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
119 "Key to send to grid server", "null", false);
120 m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
121 "Key to expect from grid server", "null", false);
122
123 m_configMember.addConfigurationOption("default_inventory_server",
124 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
125 "Default Inventory Server URI",
126 "http://127.0.0.1:" + ConfigSettings.DefaultInventoryServerHttpPort + "/",
127 false);
128 m_configMember.addConfigurationOption("default_authentication_server",
129 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
130 "User Server (this) External URI for authentication keys",
131 "http://localhost:" + ConfigSettings.DefaultUserServerHttpPort + "/",
132 false);
133 m_configMember.addConfigurationOption("library_location",
134 ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
135 "Path to library control file",
136 string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false);
137
138 m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
139 "DLL for database provider", "OpenSim.Data.MySQL.dll", false);
140 m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
141 "Connection String for Database", "", false);
142
143 m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
144 "Http Listener port", ConfigSettings.DefaultUserServerHttpPort.ToString(), false);
145 m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
146 "Use SSL? true/false", ConfigSettings.DefaultUserServerHttpSSL.ToString(), false);
147 m_configMember.addConfigurationOption("default_X", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
148 "Known good region X", "1000", false);
149 m_configMember.addConfigurationOption("default_Y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
150 "Known good region Y", "1000", false);
151 m_configMember.addConfigurationOption("enable_llsd_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
152 "Enable LLSD login support [Currently used by libsl based clients/bots]? true/false", true.ToString(), false);
153
154 m_configMember.addConfigurationOption("enable_hg_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
155 "Enable Hypergrid login support [Currently used by GridSurfer-proxied clients]? true/false", true.ToString(), false);
156
157 m_configMember.addConfigurationOption("default_loginLevel", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
158 "Minimum Level a user should have to login [0 default]", "0", false);
159
160 m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
161 "Remote console access user name [Default: disabled]", "", false);
162
163 m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
164 "Remote console access password [Default: disabled]", "", false);
165
166 }
167
168 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
169 {
170 switch (configuration_key)
171 {
172 case "default_startup_message":
173 DefaultStartupMsg = (string) configuration_result;
174 break;
175 case "default_grid_server":
176 GridServerURL = new Uri((string) configuration_result);
177 break;
178 case "grid_send_key":
179 GridSendKey = (string) configuration_result;
180 break;
181 case "grid_recv_key":
182 GridRecvKey = (string) configuration_result;
183 break;
184 case "default_inventory_server":
185 InventoryUrl = new Uri((string) configuration_result);
186 break;
187 case "default_authentication_server":
188 AuthUrl = new Uri((string)configuration_result);
189 break;
190 case "database_provider":
191 DatabaseProvider = (string) configuration_result;
192 break;
193 case "database_connect":
194 DatabaseConnect = (string) configuration_result;
195 break;
196 case "http_port":
197 HttpPort = (uint) configuration_result;
198 break;
199 case "http_ssl":
200 HttpSSL = (bool) configuration_result;
201 break;
202 case "default_X":
203 DefaultX = (uint) configuration_result;
204 break;
205 case "default_Y":
206 DefaultY = (uint) configuration_result;
207 break;
208 case "enable_llsd_login":
209 EnableLLSDLogin = (bool)configuration_result;
210 break;
211 case "enable_hg_login":
212 EnableHGLogin = (bool)configuration_result;
213 break;
214 case "default_loginLevel":
215 DefaultUserLevel = (uint)configuration_result;
216 break;
217 case "library_location":
218 LibraryXmlfile = (string)configuration_result;
219 break;
220 case "console_user":
221 ConsoleUser = (string)configuration_result;
222 break;
223 case "console_pass":
224 ConsolePass = (string)configuration_result;
225 break;
226 }
227
228 return true;
229 }
230 }
231}
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index e20866e..d16f9bf 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -139,8 +139,9 @@ namespace OpenSim.Framework
139 request.ContentLength = requestData.Length; 139 request.ContentLength = requestData.Length;
140 request.ContentType = "application/x-www-form-urlencoded"; 140 request.ContentType = "application/x-www-form-urlencoded";
141 141
142 using (Stream requestStream = request.GetRequestStream()) 142 Stream requestStream = request.GetRequestStream();
143 requestStream.Write(requestData, 0, requestData.Length); 143 requestStream.Write(requestData, 0, requestData.Length);
144 requestStream.Close();
144 145
145 using (WebResponse response = request.GetResponse()) 146 using (WebResponse response = request.GetResponse())
146 { 147 {
@@ -169,7 +170,7 @@ namespace OpenSim.Framework
169 } 170 }
170 catch (Exception ex) 171 catch (Exception ex)
171 { 172 {
172 m_log.Warn("POST to URL " + url + " failed: " + ex.Message); 173 m_log.Warn("POST to URL " + url + " failed: " + ex);
173 errorMessage = ex.Message; 174 errorMessage = ex.Message;
174 } 175 }
175 176
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs
deleted file mode 100644
index 10e5a95..0000000
--- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs
+++ /dev/null
@@ -1,367 +0,0 @@
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
28using System;
29using System.Collections.Generic;
30using OpenMetaverse;
31using OpenSim.Framework;
32
33namespace OpenSim.Region.ClientStack.LindenUDP
34{
35 /// <summary>
36 /// A work in progress, to contain the SL specific file transfer code that is currently in various region modules
37 /// This file currently contains multiple classes that need to be split out into their own files.
38 /// </summary>
39 public class LLFileTransfer : IClientFileTransfer
40 {
41 protected IClientAPI m_clientAPI;
42
43 /// Dictionary of handlers for uploading files from client
44 /// TODO: Need to add cleanup code to remove handlers that have completed their upload
45 protected Dictionary<ulong, XferUploadHandler> m_uploadHandlers;
46 protected object m_uploadHandlersLock = new object();
47
48
49 /// <summary>
50 /// Dictionary of files ready to be sent to clients
51 /// </summary>
52 protected static Dictionary<string, byte[]> m_files;
53
54 /// <summary>
55 /// Dictionary of Download Transfers in progess
56 /// </summary>
57 protected Dictionary<ulong, XferDownloadHandler> m_downloadHandlers = new Dictionary<ulong, XferDownloadHandler>();
58
59
60 public LLFileTransfer(IClientAPI clientAPI)
61 {
62 m_uploadHandlers = new Dictionary<ulong, XferUploadHandler>();
63 m_clientAPI = clientAPI;
64
65 m_clientAPI.OnXferReceive += XferReceive;
66 m_clientAPI.OnAbortXfer += AbortXferUploadHandler;
67 }
68
69 public void Close()
70 {
71 if (m_clientAPI != null)
72 {
73 m_clientAPI.OnXferReceive -= XferReceive;
74 m_clientAPI.OnAbortXfer -= AbortXferUploadHandler;
75 m_clientAPI = null;
76 }
77 }
78
79 #region Upload Handling
80
81 public bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback)
82 {
83 if ((String.IsNullOrEmpty(clientFileName)) || (uploadCompleteCallback == null))
84 {
85 return false;
86 }
87
88 XferUploadHandler uploader = new XferUploadHandler(m_clientAPI, clientFileName);
89
90 return StartUpload(uploader, uploadCompleteCallback, abortCallback);
91 }
92
93 public bool RequestUpload(UUID fileID, UploadComplete uploadCompleteCallback, UploadAborted abortCallback)
94 {
95 if ((fileID == UUID.Zero) || (uploadCompleteCallback == null))
96 {
97 return false;
98 }
99
100 XferUploadHandler uploader = new XferUploadHandler(m_clientAPI, fileID);
101
102 return StartUpload(uploader, uploadCompleteCallback, abortCallback);
103 }
104
105 private bool StartUpload(XferUploadHandler uploader, UploadComplete uploadCompleteCallback, UploadAborted abortCallback)
106 {
107 uploader.UploadDone += uploadCompleteCallback;
108 uploader.UploadDone += RemoveXferUploadHandler;
109
110 if (abortCallback != null)
111 {
112 uploader.UploadAborted += abortCallback;
113 }
114
115 lock (m_uploadHandlersLock)
116 {
117 if (!m_uploadHandlers.ContainsKey(uploader.XferID))
118 {
119 m_uploadHandlers.Add(uploader.XferID, uploader);
120 uploader.RequestStartXfer(m_clientAPI);
121 return true;
122 }
123 else
124 {
125 // something went wrong with the xferID allocation
126 uploader.UploadDone -= uploadCompleteCallback;
127 uploader.UploadDone -= RemoveXferUploadHandler;
128 if (abortCallback != null)
129 {
130 uploader.UploadAborted -= abortCallback;
131 }
132 return false;
133 }
134 }
135 }
136
137 protected void AbortXferUploadHandler(IClientAPI remoteClient, ulong xferID)
138 {
139 lock (m_uploadHandlersLock)
140 {
141 if (m_uploadHandlers.ContainsKey(xferID))
142 {
143 m_uploadHandlers[xferID].AbortUpload(remoteClient);
144 m_uploadHandlers.Remove(xferID);
145 }
146 }
147 }
148
149 protected void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
150 {
151 lock (m_uploadHandlersLock)
152 {
153 if (m_uploadHandlers.ContainsKey(xferID))
154 {
155 m_uploadHandlers[xferID].XferReceive(remoteClient, xferID, packetID, data);
156 }
157 }
158 }
159
160 protected void RemoveXferUploadHandler(string filename, UUID fileID, ulong transferID, byte[] fileData, IClientAPI remoteClient)
161 {
162
163 }
164 #endregion
165
166 }
167
168 public class XferUploadHandler
169 {
170 private AssetBase m_asset;
171
172 public event UploadComplete UploadDone;
173 public event UploadAborted UploadAborted;
174
175 private sbyte type = 0;
176
177 public ulong mXferID;
178 private UploadComplete handlerUploadDone;
179 private UploadAborted handlerAbort;
180
181 private bool m_complete = false;
182
183 public bool UploadComplete
184 {
185 get { return m_complete; }
186 }
187
188 public XferUploadHandler(IClientAPI pRemoteClient, string pClientFilename)
189 {
190 Initialise(UUID.Zero, pClientFilename);
191 }
192
193 public XferUploadHandler(IClientAPI pRemoteClient, UUID fileID)
194 {
195 Initialise(fileID, String.Empty);
196 }
197
198 private void Initialise(UUID fileID, string fileName)
199 {
200 m_asset = new AssetBase(fileID, fileName, type, UUID.Zero.ToString());
201 m_asset.Data = new byte[0];
202 m_asset.Description = "empty";
203 m_asset.Local = true;
204 m_asset.Temporary = true;
205 mXferID = Util.GetNextXferID();
206 }
207
208 public ulong XferID
209 {
210 get { return mXferID; }
211 }
212
213 public void RequestStartXfer(IClientAPI pRemoteClient)
214 {
215 m_asset.Metadata.CreatorID = pRemoteClient.AgentId.ToString();
216
217 if (!String.IsNullOrEmpty(m_asset.Name))
218 {
219 pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name));
220 }
221 else
222 {
223 pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, new byte[0]);
224 }
225 }
226
227 /// <summary>
228 /// Process transfer data received from the client.
229 /// </summary>
230 /// <param name="xferID"></param>
231 /// <param name="packetID"></param>
232 /// <param name="data"></param>
233 public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
234 {
235 if (mXferID == xferID)
236 {
237 if (m_asset.Data.Length > 1)
238 {
239 byte[] destinationArray = new byte[m_asset.Data.Length + data.Length];
240 Array.Copy(m_asset.Data, 0, destinationArray, 0, m_asset.Data.Length);
241 Array.Copy(data, 0, destinationArray, m_asset.Data.Length, data.Length);
242 m_asset.Data = destinationArray;
243 }
244 else
245 {
246 byte[] buffer2 = new byte[data.Length - 4];
247 Array.Copy(data, 4, buffer2, 0, data.Length - 4);
248 m_asset.Data = buffer2;
249 }
250
251 remoteClient.SendConfirmXfer(xferID, packetID);
252
253 if ((packetID & 0x80000000) != 0)
254 {
255 SendCompleteMessage(remoteClient);
256
257 }
258 }
259 }
260
261 protected void SendCompleteMessage(IClientAPI remoteClient)
262 {
263 m_complete = true;
264 handlerUploadDone = UploadDone;
265 if (handlerUploadDone != null)
266 {
267 handlerUploadDone(m_asset.Name, m_asset.FullID, mXferID, m_asset.Data, remoteClient);
268 }
269 }
270
271 public void AbortUpload(IClientAPI remoteClient)
272 {
273 handlerAbort = UploadAborted;
274 if (handlerAbort != null)
275 {
276 handlerAbort(m_asset.Name, m_asset.FullID, mXferID, remoteClient);
277 }
278 }
279 }
280
281 public class XferDownloadHandler
282 {
283 public IClientAPI Client;
284 private bool complete;
285 public byte[] Data = new byte[0];
286 public int DataPointer = 0;
287 public string FileName = String.Empty;
288 public uint Packet = 0;
289 public uint Serial = 1;
290 public ulong XferID = 0;
291
292 public XferDownloadHandler(string fileName, byte[] data, ulong xferID, IClientAPI client)
293 {
294 FileName = fileName;
295 Data = data;
296 XferID = xferID;
297 Client = client;
298 }
299
300 public XferDownloadHandler()
301 {
302 }
303
304 /// <summary>
305 /// Start a transfer
306 /// </summary>
307 /// <returns>True if the transfer is complete, false if not</returns>
308 public bool StartSend()
309 {
310 if (Data.Length < 1000)
311 {
312 // for now (testing) we only support files under 1000 bytes
313 byte[] transferData = new byte[Data.Length + 4];
314 Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4);
315 Array.Copy(Data, 0, transferData, 4, Data.Length);
316 Client.SendXferPacket(XferID, 0 + 0x80000000, transferData);
317
318 complete = true;
319 }
320 else
321 {
322 byte[] transferData = new byte[1000 + 4];
323 Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4);
324 Array.Copy(Data, 0, transferData, 4, 1000);
325 Client.SendXferPacket(XferID, 0, transferData);
326 Packet++;
327 DataPointer = 1000;
328 }
329
330 return complete;
331 }
332
333 /// <summary>
334 /// Respond to an ack packet from the client
335 /// </summary>
336 /// <param name="packet"></param>
337 /// <returns>True if the transfer is complete, false otherwise</returns>
338 public bool AckPacket(uint packet)
339 {
340 if (!complete)
341 {
342 if ((Data.Length - DataPointer) > 1000)
343 {
344 byte[] transferData = new byte[1000];
345 Array.Copy(Data, DataPointer, transferData, 0, 1000);
346 Client.SendXferPacket(XferID, Packet, transferData);
347 Packet++;
348 DataPointer += 1000;
349 }
350 else
351 {
352 byte[] transferData = new byte[Data.Length - DataPointer];
353 Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer);
354 uint endPacket = Packet |= (uint)0x80000000;
355 Client.SendXferPacket(XferID, endPacket, transferData);
356 Packet++;
357 DataPointer += (Data.Length - DataPointer);
358
359 complete = true;
360 }
361 }
362
363 return complete;
364 }
365 }
366
367}
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 34198d2..e557d2c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Xml; 31using System.Xml;
32using log4net; 32using log4net;
33using Mono.Addins;
33using Nini.Config; 34using Nini.Config;
34using OpenMetaverse; 35using OpenMetaverse;
35using OpenMetaverse.Packets; 36using OpenMetaverse.Packets;
@@ -41,38 +42,64 @@ using OpenSim.Region.Framework.Scenes.Serialization;
41 42
42namespace OpenSim.Region.CoreModules.Avatar.Attachments 43namespace OpenSim.Region.CoreModules.Avatar.Attachments
43{ 44{
44 public class AttachmentsModule : IAttachmentsModule, IRegionModule 45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")]
46 public class AttachmentsModule : IAttachmentsModule, INonSharedRegionModule
45 { 47 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 49
48 protected Scene m_scene = null; 50 protected Scene m_scene = null;
51
52 public string Name { get { return "Attachments Module"; } }
53 public Type ReplaceableInterface { get { return null; } }
49 54
50 public void Initialise(Scene scene, IConfigSource source) 55 public void Initialise(IConfigSource source) {}
56
57 public void AddRegion(Scene scene)
51 { 58 {
52 scene.RegisterModuleInterface<IAttachmentsModule>(this);
53 m_scene = scene; 59 m_scene = scene;
60 m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
61 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
62 // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI
54 } 63 }
55 64
56 public void PostInitialise() 65 public void RemoveRegion(Scene scene)
57 { 66 {
67 m_scene.UnregisterModuleInterface<IAttachmentsModule>(this);
68 m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
58 } 69 }
59 70
60 public void Close() 71 public void RegionLoaded(Scene scene) {}
72
73 public void Close()
61 { 74 {
75 RemoveRegion(m_scene);
62 } 76 }
63 77
64 public string Name 78 public void SubscribeToClientEvents(IClientAPI client)
65 { 79 {
66 get { return "Attachments Module"; } 80 client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory;
81 client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory;
82 client.OnObjectAttach += AttachObject;
83 client.OnObjectDetach += DetachObject;
84 client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory;
67 } 85 }
68 86
69 public bool IsSharedModule 87 public void UnsubscribeFromClientEvents(IClientAPI client)
70 { 88 {
71 get { return false; } 89 client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory;
90 client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory;
91 client.OnObjectAttach -= AttachObject;
92 client.OnObjectDetach -= DetachObject;
93 client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory;
72 } 94 }
73 95
74 // Called by client 96 /// <summary>
75 // 97 /// Called by client
98 /// </summary>
99 /// <param name="remoteClient"></param>
100 /// <param name="objectLocalID"></param>
101 /// <param name="AttachmentPt"></param>
102 /// <param name="silent"></param>
76 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) 103 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
77 { 104 {
78 m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); 105 m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 50171a3..4b30b0d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
47 m_scene = scene; 47 m_scene = scene;
48 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); 48 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
49 m_scene.RegisterModuleInterface<IGodsModule>(this); 49 m_scene.RegisterModuleInterface<IGodsModule>(this);
50 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
50 } 51 }
51 52
52 public void PostInitialise() {} 53 public void PostInitialise() {}
@@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
54 public string Name { get { return "Gods Module"; } } 55 public string Name { get { return "Gods Module"; } }
55 public bool IsSharedModule { get { return false; } } 56 public bool IsSharedModule { get { return false; } }
56 57
58 public void SubscribeToClientEvents(IClientAPI client)
59 {
60 client.OnGodKickUser += KickUser;
61 client.OnRequestGodlikePowers += RequestGodlikePowers;
62 }
63
64 public void UnsubscribeFromClientEvents(IClientAPI client)
65 {
66 client.OnGodKickUser -= KickUser;
67 client.OnRequestGodlikePowers -= RequestGodlikePowers;
68 }
69
57 public void RequestGodlikePowers( 70 public void RequestGodlikePowers(
58 UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) 71 UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
59 { 72 {
diff --git a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs
index e23be59..36917e9 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs
@@ -30,7 +30,7 @@ using OpenSim.Region.CoreModules.World.Terrain;
30using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; 30using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes;
31using OpenSim.Region.Framework.Interfaces; 31using OpenSim.Region.Framework.Interfaces;
32 32
33namespace OpenSim.Region.Modules.Terrain.Extensions.DefaultEffects.Effects 33namespace OpenSim.Region.CoreModules.World.Terrain.Effects
34{ 34{
35 public class ChannelDigger : ITerrainEffect 35 public class ChannelDigger : ITerrainEffect
36 { 36 {
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 0c20393..2817477 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
68 #endregion 68 #endregion
69 69
70 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 70 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
71 71
72 private readonly Commander m_commander = new Commander("terrain"); 72 private readonly Commander m_commander = new Commander("terrain");
73 73
74 private readonly Dictionary<StandardTerrainEffects, ITerrainFloodEffect> m_floodeffects = 74 private readonly Dictionary<StandardTerrainEffects, ITerrainFloodEffect> m_floodeffects =
@@ -381,8 +381,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain
381 private void LoadPlugins() 381 private void LoadPlugins()
382 { 382 {
383 m_plugineffects = new Dictionary<string, ITerrainEffect>(); 383 m_plugineffects = new Dictionary<string, ITerrainEffect>();
384 string plugineffectsPath = "Terrain";
385
384 // Load the files in the Terrain/ dir 386 // Load the files in the Terrain/ dir
385 string[] files = Directory.GetFiles("Terrain"); 387 if (!Directory.Exists(plugineffectsPath))
388 return;
389
390 string[] files = Directory.GetFiles(plugineffectsPath);
386 foreach (string file in files) 391 foreach (string file in files)
387 { 392 {
388 m_log.Info("Loading effects in " + file); 393 m_log.Info("Loading effects in " + file);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2a498cc..644fbb0 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2788,7 +2788,9 @@ namespace OpenSim.Region.Framework.Scenes
2788 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); 2788 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
2789 if (userVerification != null && ep != null) 2789 if (userVerification != null && ep != null)
2790 { 2790 {
2791 if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString())) 2791 System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address);
2792
2793 if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
2792 { 2794 {
2793 // uh-oh, this is fishy 2795 // uh-oh, this is fishy
2794 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2796 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
@@ -2846,17 +2848,11 @@ namespace OpenSim.Region.Framework.Scenes
2846 SubscribeToClientPrimEvents(client); 2848 SubscribeToClientPrimEvents(client);
2847 SubscribeToClientPrimRezEvents(client); 2849 SubscribeToClientPrimRezEvents(client);
2848 SubscribeToClientInventoryEvents(client); 2850 SubscribeToClientInventoryEvents(client);
2849 SubscribeToClientAttachmentEvents(client);
2850 SubscribeToClientTeleportEvents(client); 2851 SubscribeToClientTeleportEvents(client);
2851 SubscribeToClientScriptEvents(client); 2852 SubscribeToClientScriptEvents(client);
2852 SubscribeToClientParcelEvents(client); 2853 SubscribeToClientParcelEvents(client);
2853 SubscribeToClientGridEvents(client); 2854 SubscribeToClientGridEvents(client);
2854 SubscribeToClientGodEvents(client);
2855
2856 SubscribeToClientNetworkEvents(client); 2855 SubscribeToClientNetworkEvents(client);
2857
2858
2859 // EventManager.TriggerOnNewClient(client);
2860 } 2856 }
2861 2857
2862 public virtual void SubscribeToClientTerrainEvents(IClientAPI client) 2858 public virtual void SubscribeToClientTerrainEvents(IClientAPI client)
@@ -2866,8 +2862,7 @@ namespace OpenSim.Region.Framework.Scenes
2866 } 2862 }
2867 2863
2868 public virtual void SubscribeToClientPrimEvents(IClientAPI client) 2864 public virtual void SubscribeToClientPrimEvents(IClientAPI client)
2869 { 2865 {
2870
2871 client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition; 2866 client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition;
2872 client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition; 2867 client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition;
2873 client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation; 2868 client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation;
@@ -2937,18 +2932,6 @@ namespace OpenSim.Region.Framework.Scenes
2937 client.OnMoveTaskItem += ClientMoveTaskInventoryItem; 2932 client.OnMoveTaskItem += ClientMoveTaskInventoryItem;
2938 } 2933 }
2939 2934
2940 public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
2941 {
2942 if (AttachmentsModule != null)
2943 {
2944 client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory;
2945 client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory;
2946 client.OnObjectAttach += AttachmentsModule.AttachObject;
2947 client.OnObjectDetach += AttachmentsModule.DetachObject;
2948 client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory;
2949 }
2950 }
2951
2952 public virtual void SubscribeToClientTeleportEvents(IClientAPI client) 2935 public virtual void SubscribeToClientTeleportEvents(IClientAPI client)
2953 { 2936 {
2954 client.OnTeleportLocationRequest += RequestTeleportLocation; 2937 client.OnTeleportLocationRequest += RequestTeleportLocation;
@@ -2978,44 +2961,29 @@ namespace OpenSim.Region.Framework.Scenes
2978 client.OnSetStartLocationRequest += SetHomeRezPoint; 2961 client.OnSetStartLocationRequest += SetHomeRezPoint;
2979 client.OnRegionHandleRequest += RegionHandleRequest; 2962 client.OnRegionHandleRequest += RegionHandleRequest;
2980 } 2963 }
2981 2964
2982 public virtual void SubscribeToClientGodEvents(IClientAPI client)
2983 {
2984 IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
2985 client.OnGodKickUser += godsModule.KickUser;
2986 client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers;
2987 }
2988
2989 public virtual void SubscribeToClientNetworkEvents(IClientAPI client) 2965 public virtual void SubscribeToClientNetworkEvents(IClientAPI client)
2990 { 2966 {
2991 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats; 2967 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats;
2992 client.OnViewerEffect += ProcessViewerEffect; 2968 client.OnViewerEffect += ProcessViewerEffect;
2993 } 2969 }
2994 2970
2995 protected virtual void UnsubscribeToClientEvents(IClientAPI client)
2996 {
2997 }
2998
2999 /// <summary> 2971 /// <summary>
3000 /// Register for events from the client 2972 /// Unsubscribe the client from events.
3001 /// </summary> 2973 /// </summary>
3002 /// <param name="client">The IClientAPI of the connected client</param> 2974 /// FIXME: Not called anywhere!
2975 /// <param name="client">The IClientAPI of the client</param>
3003 public virtual void UnSubscribeToClientEvents(IClientAPI client) 2976 public virtual void UnSubscribeToClientEvents(IClientAPI client)
3004 { 2977 {
3005 UnSubscribeToClientTerrainEvents(client); 2978 UnSubscribeToClientTerrainEvents(client);
3006 UnSubscribeToClientPrimEvents(client); 2979 UnSubscribeToClientPrimEvents(client);
3007 UnSubscribeToClientPrimRezEvents(client); 2980 UnSubscribeToClientPrimRezEvents(client);
3008 UnSubscribeToClientInventoryEvents(client); 2981 UnSubscribeToClientInventoryEvents(client);
3009 UnSubscribeToClientAttachmentEvents(client);
3010 UnSubscribeToClientTeleportEvents(client); 2982 UnSubscribeToClientTeleportEvents(client);
3011 UnSubscribeToClientScriptEvents(client); 2983 UnSubscribeToClientScriptEvents(client);
3012 UnSubscribeToClientParcelEvents(client); 2984 UnSubscribeToClientParcelEvents(client);
3013 UnSubscribeToClientGridEvents(client); 2985 UnSubscribeToClientGridEvents(client);
3014 UnSubscribeToClientGodEvents(client);
3015
3016 UnSubscribeToClientNetworkEvents(client); 2986 UnSubscribeToClientNetworkEvents(client);
3017
3018 // EventManager.TriggerOnNewClient(client);
3019 } 2987 }
3020 2988
3021 public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) 2989 public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client)
@@ -3092,18 +3060,6 @@ namespace OpenSim.Region.Framework.Scenes
3092 client.OnMoveTaskItem -= ClientMoveTaskInventoryItem; 3060 client.OnMoveTaskItem -= ClientMoveTaskInventoryItem;
3093 } 3061 }
3094 3062
3095 public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
3096 {
3097 if (AttachmentsModule != null)
3098 {
3099 client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory;
3100 client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory;
3101 client.OnObjectAttach -= AttachmentsModule.AttachObject;
3102 client.OnObjectDetach -= AttachmentsModule.DetachObject;
3103 client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory;
3104 }
3105 }
3106
3107 public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client) 3063 public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client)
3108 { 3064 {
3109 client.OnTeleportLocationRequest -= RequestTeleportLocation; 3065 client.OnTeleportLocationRequest -= RequestTeleportLocation;
@@ -3135,13 +3091,6 @@ namespace OpenSim.Region.Framework.Scenes
3135 client.OnRegionHandleRequest -= RegionHandleRequest; 3091 client.OnRegionHandleRequest -= RegionHandleRequest;
3136 } 3092 }
3137 3093
3138 public virtual void UnSubscribeToClientGodEvents(IClientAPI client)
3139 {
3140 IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
3141 client.OnGodKickUser -= godsModule.KickUser;
3142 client.OnRequestGodlikePowers -= godsModule.RequestGodlikePowers;
3143 }
3144
3145 public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client) 3094 public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client)
3146 { 3095 {
3147 client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats; 3096 client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats;
@@ -5381,4 +5330,4 @@ namespace OpenSim.Region.Framework.Scenes
5381 return offsets.ToArray(); 5330 return offsets.ToArray();
5382 } 5331 }
5383 } 5332 }
5384} 5333} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 12c1c20..c0ec5df 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -87,8 +87,6 @@ namespace OpenSim.Region.Framework.Scenes
87// protected internal Dictionary<UUID, EntityBase> Entities = new Dictionary<UUID, EntityBase>(); 87// protected internal Dictionary<UUID, EntityBase> Entities = new Dictionary<UUID, EntityBase>();
88 protected internal Dictionary<UUID, ScenePresence> RestorePresences = new Dictionary<UUID, ScenePresence>(); 88 protected internal Dictionary<UUID, ScenePresence> RestorePresences = new Dictionary<UUID, ScenePresence>();
89 89
90 protected internal BasicQuadTreeNode QuadTree;
91
92 protected RegionInfo m_regInfo; 90 protected RegionInfo m_regInfo;
93 protected Scene m_parentScene; 91 protected Scene m_parentScene;
94 protected Dictionary<UUID, SceneObjectGroup> m_updateList = new Dictionary<UUID, SceneObjectGroup>(); 92 protected Dictionary<UUID, SceneObjectGroup> m_updateList = new Dictionary<UUID, SceneObjectGroup>();
@@ -116,9 +114,6 @@ namespace OpenSim.Region.Framework.Scenes
116 { 114 {
117 m_parentScene = parent; 115 m_parentScene = parent;
118 m_regInfo = regInfo; 116 m_regInfo = regInfo;
119 QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize);
120 QuadTree.Subdivide();
121 QuadTree.Subdivide();
122 } 117 }
123 118
124 public PhysicsScene PhysicsScene 119 public PhysicsScene PhysicsScene
diff --git a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs b/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs
deleted file mode 100644
index 38a9203..0000000
--- a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs
+++ /dev/null
@@ -1,269 +0,0 @@
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
28using System;
29using System.Collections.Generic;
30using OpenSim.Region.Framework.Scenes;
31
32namespace OpenSim.Region.Framework.Scenes.Types
33{
34 public class BasicQuadTreeNode
35 {
36 private List<SceneObjectGroup> m_objects = new List<SceneObjectGroup>();
37 private BasicQuadTreeNode[] m_childNodes = null;
38 private BasicQuadTreeNode m_parent = null;
39
40 private short m_leftX;
41 private short m_leftY;
42 private short m_width;
43 private short m_height;
44 //private int m_quadNumber;
45 private string m_quadID;
46
47 public BasicQuadTreeNode(BasicQuadTreeNode parent, string quadID, short leftX, short leftY, short width,
48 short height)
49 {
50 m_parent = parent;
51 m_quadID = quadID;
52 m_leftX = leftX;
53 m_leftY = leftY;
54 m_width = width;
55 m_height = height;
56 // m_log.Debug("creating quadtree node " + m_quadID);
57 }
58
59 public void AddObject(SceneObjectGroup obj)
60 {
61 if (m_childNodes == null)
62 {
63 if (!m_objects.Contains(obj))
64 {
65 m_objects.Add(obj);
66 }
67 }
68 else
69 {
70 if (obj.AbsolutePosition.X < (m_leftX + (m_width/2)))
71 {
72 if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2)))
73 {
74 m_childNodes[0].AddObject(obj);
75 }
76 else
77 {
78 m_childNodes[2].AddObject(obj);
79 }
80 }
81 else
82 {
83 if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2)))
84 {
85 m_childNodes[1].AddObject(obj);
86 }
87 else
88 {
89 m_childNodes[3].AddObject(obj);
90 }
91 }
92 }
93 }
94
95 public void Subdivide()
96 {
97 if (m_childNodes == null)
98 {
99 m_childNodes = new BasicQuadTreeNode[4];
100 m_childNodes[0] =
101 new BasicQuadTreeNode(this, m_quadID + "1/", m_leftX, m_leftY, (short) (m_width/2),
102 (short) (m_height/2));
103 m_childNodes[1] =
104 new BasicQuadTreeNode(this, m_quadID + "2/", (short) (m_leftX + (m_width/2)), m_leftY,
105 (short) (m_width/2), (short) (m_height/2));
106 m_childNodes[2] =
107 new BasicQuadTreeNode(this, m_quadID + "3/", m_leftX, (short) (m_leftY + (m_height/2)),
108 (short) (m_width/2), (short) (m_height/2));
109 m_childNodes[3] =
110 new BasicQuadTreeNode(this, m_quadID + "4/", (short) (m_leftX + (m_width/2)),
111 (short) (m_height + (m_height/2)), (short) (m_width/2), (short) (m_height/2));
112 }
113 else
114 {
115 for (int i = 0; i < m_childNodes.Length; i++)
116 {
117 m_childNodes[i].Subdivide();
118 }
119 }
120 }
121
122 public List<SceneObjectGroup> GetObjectsFrom(float x, float y)
123 {
124 if (m_childNodes == null)
125 {
126 return new List<SceneObjectGroup>(m_objects);
127 }
128 else
129 {
130 if (x < m_leftX + (m_width/2))
131 {
132 if (y < m_leftY + (m_height/2))
133 {
134 return m_childNodes[0].GetObjectsFrom(x, y);
135 }
136 else
137 {
138 return m_childNodes[2].GetObjectsFrom(x, y);
139 }
140 }
141 else
142 {
143 if (y < m_leftY + (m_height/2))
144 {
145 return m_childNodes[1].GetObjectsFrom(x, y);
146 }
147 else
148 {
149 return m_childNodes[3].GetObjectsFrom(x, y);
150 }
151 }
152 }
153 }
154
155 public List<SceneObjectGroup> GetObjectsFrom(string nodeName)
156 {
157 if (nodeName == m_quadID)
158 {
159 return new List<SceneObjectGroup>(m_objects);
160 }
161 else if (m_childNodes != null)
162 {
163 for (int i = 0; i < 4; i++)
164 {
165 List<SceneObjectGroup> retVal;
166 retVal = m_childNodes[i].GetObjectsFrom(nodeName);
167 if (retVal != null)
168 {
169 return retVal;
170 }
171 }
172 }
173 return null;
174 }
175
176 public string GetNodeID(float x, float y)
177 {
178 if (m_childNodes == null)
179 {
180 return m_quadID;
181 }
182 else
183 {
184 if (x < m_leftX + (m_width/2))
185 {
186 if (y < m_leftY + (m_height/2))
187 {
188 return m_childNodes[0].GetNodeID(x, y);
189 }
190 else
191 {
192 return m_childNodes[2].GetNodeID(x, y);
193 }
194 }
195 else
196 {
197 if (y < m_leftY + (m_height/2))
198 {
199 return m_childNodes[1].GetNodeID(x, y);
200 }
201 else
202 {
203 return m_childNodes[3].GetNodeID(x, y);
204 }
205 }
206 }
207 }
208
209 public void Update()
210 {
211 if (m_childNodes != null)
212 {
213 for (int i = 0; i < 4; i++)
214 {
215 m_childNodes[i].Update();
216 }
217 }
218 else
219 {
220 List<SceneObjectGroup> outBounds = new List<SceneObjectGroup>();
221 foreach (SceneObjectGroup group in m_objects)
222 {
223 if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) &&
224 ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
225 {
226 //still in bounds
227 }
228 else
229 {
230 outBounds.Add(group);
231 }
232 }
233
234 foreach (SceneObjectGroup removee in outBounds)
235 {
236 m_objects.Remove(removee);
237 if (m_parent != null)
238 {
239 m_parent.PassUp(removee);
240 }
241 }
242 outBounds.Clear();
243 }
244 }
245
246 public void PassUp(SceneObjectGroup group)
247 {
248 if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) &&
249 ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
250 {
251 AddObject(group);
252 }
253 else
254 {
255 if (m_parent != null)
256 {
257 m_parent.PassUp(group);
258 }
259 }
260 }
261
262 public string[] GetNeighbours(string nodeName)
263 {
264 string[] retVal = new string[1];
265 retVal[0] = String.Empty;
266 return retVal;
267 }
268 }
269}
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs
index 9d41c9c..a0d6197 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs
@@ -28,11 +28,14 @@
28using System; 28using System;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.CoreModules.Avatar.Attachments;
32using OpenSim.Region.CoreModules.Avatar.Gods;
33using OpenSim.Region.Framework.Interfaces;
31using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
32 35
33namespace OpenSim.Region.RegionCombinerModule 36namespace OpenSim.Region.RegionCombinerModule
34{ 37{
35 public class RegionCombinerIndividualEventForwarder 38 public class RegionCombinerIndividualEventForwarder
36 { 39 {
37 private Scene m_rootScene; 40 private Scene m_rootScene;
38 private Scene m_virtScene; 41 private Scene m_virtScene;
@@ -46,22 +49,31 @@ namespace OpenSim.Region.RegionCombinerModule
46 public void ClientConnect(IClientAPI client) 49 public void ClientConnect(IClientAPI client)
47 { 50 {
48 m_virtScene.UnSubscribeToClientPrimEvents(client); 51 m_virtScene.UnSubscribeToClientPrimEvents(client);
49 m_virtScene.UnSubscribeToClientPrimRezEvents(client); 52 m_virtScene.UnSubscribeToClientPrimRezEvents(client);
50 m_virtScene.UnSubscribeToClientInventoryEvents(client); 53 m_virtScene.UnSubscribeToClientInventoryEvents(client);
51 m_virtScene.UnSubscribeToClientAttachmentEvents(client); 54 ((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client);
52 //m_virtScene.UnSubscribeToClientTeleportEvents(client); 55 //m_virtScene.UnSubscribeToClientTeleportEvents(client);
53 m_virtScene.UnSubscribeToClientScriptEvents(client); 56 m_virtScene.UnSubscribeToClientScriptEvents(client);
54 m_virtScene.UnSubscribeToClientGodEvents(client); 57
58 IGodsModule virtGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>();
59 if (virtGodsModule != null)
60 ((GodsModule)virtGodsModule).UnsubscribeFromClientEvents(client);
61
55 m_virtScene.UnSubscribeToClientNetworkEvents(client); 62 m_virtScene.UnSubscribeToClientNetworkEvents(client);
56 63
57 m_rootScene.SubscribeToClientPrimEvents(client); 64 m_rootScene.SubscribeToClientPrimEvents(client);
58 client.OnAddPrim += LocalAddNewPrim; 65 client.OnAddPrim += LocalAddNewPrim;
59 client.OnRezObject += LocalRezObject; 66 client.OnRezObject += LocalRezObject;
67
60 m_rootScene.SubscribeToClientInventoryEvents(client); 68 m_rootScene.SubscribeToClientInventoryEvents(client);
61 m_rootScene.SubscribeToClientAttachmentEvents(client); 69 ((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client);
62 //m_rootScene.SubscribeToClientTeleportEvents(client); 70 //m_rootScene.SubscribeToClientTeleportEvents(client);
63 m_rootScene.SubscribeToClientScriptEvents(client); 71 m_rootScene.SubscribeToClientScriptEvents(client);
64 m_rootScene.SubscribeToClientGodEvents(client); 72
73 IGodsModule rootGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>();
74 if (rootGodsModule != null)
75 ((GodsModule)rootGodsModule).UnsubscribeFromClientEvents(client);
76
65 m_rootScene.SubscribeToClientNetworkEvents(client); 77 m_rootScene.SubscribeToClientNetworkEvents(client);
66 } 78 }
67 79
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index dc68259..2b6d29c 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -745,6 +745,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
745 } 745 }
746 } 746 }
747 747
748 m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invFolders.Count + " folders from SimianGrid response");
748 return invFolders; 749 return invFolders;
749 } 750 }
750 751
@@ -810,6 +811,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
810 } 811 }
811 } 812 }
812 813
814 m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invItems.Count + " items from SimianGrid response");
813 return invItems; 815 return invItems;
814 } 816 }
815 817
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 2f1fed4..aec82e8 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -63,6 +63,8 @@ namespace OpenSim.Services.HypergridService
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 65
66 protected static bool m_BypassClientVerification;
67
66 public UserAgentService(IConfigSource config) 68 public UserAgentService(IConfigSource config)
67 { 69 {
68 if (!m_Initialized) 70 if (!m_Initialized)
@@ -76,6 +78,8 @@ namespace OpenSim.Services.HypergridService
76 string gridService = serverConfig.GetString("GridService", String.Empty); 78 string gridService = serverConfig.GetString("GridService", String.Empty);
77 string gridUserService = serverConfig.GetString("GridUserService", String.Empty); 79 string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
78 80
81 m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);
82
79 if (gridService == string.Empty || gridUserService == string.Empty) 83 if (gridService == string.Empty || gridUserService == string.Empty)
80 throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); 84 throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));
81 85
@@ -212,11 +216,10 @@ namespace OpenSim.Services.HypergridService
212 216
213 public bool VerifyClient(UUID sessionID, string token) 217 public bool VerifyClient(UUID sessionID, string token)
214 { 218 {
215 m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); 219 if (m_BypassClientVerification)
216 //return true; 220 return true;
217 221
218 // Commenting this for now until I understand better what part of a sender's 222 m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
219 // info stays unchanged throughout a session
220 223
221 if (m_TravelingAgents.ContainsKey(sessionID)) 224 if (m_TravelingAgents.ContainsKey(sessionID))
222 return m_TravelingAgents[sessionID].ClientToken == token; 225 return m_TravelingAgents[sessionID].ClientToken == token;
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index d27c26d..9446126 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -760,10 +760,8 @@ namespace OpenSim.Services.LLLoginService
760 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); 760 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
761 if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) 761 if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
762 { 762 {
763 // We may need to do this at some point, 763 IPAddress addr = NetworkUtil.GetExternalIPOf(clientIP.Address);
764 // so leaving it here in comments. 764 m_UserAgentService.SetClientToken(aCircuit.SessionID, addr.ToString() /* clientIP.Address.ToString() */);
765 //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address);
766 m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString());
767 return true; 765 return true;
768 } 766 }
769 return false; 767 return false;
diff --git a/prebuild.xml b/prebuild.xml
index 9b81542..41221dc 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -255,58 +255,6 @@
255 </Files> 255 </Files>
256 </Project> 256 </Project>
257 257
258 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Configuration.XML" path="OpenSim/Framework/Configuration/XML" type="Library">
259 <Configuration name="Debug">
260 <Options>
261 <OutputPath>../../../../bin/</OutputPath>
262 </Options>
263 </Configuration>
264 <Configuration name="Release">
265 <Options>
266 <OutputPath>../../../../bin/</OutputPath>
267 </Options>
268 </Configuration>
269
270 <ReferencePath>../../../../bin/</ReferencePath>
271 <Reference name="System"/>
272 <Reference name="System.Xml"/>
273 <Reference name="OpenMetaverseTypes.dll"/>
274 <Reference name="XMLRPC.dll"/>
275 <Reference name="OpenSim.Framework"/>
276 <Reference name="OpenSim.Framework.Console"/>
277 <Reference name="OpenSim.Data"/>
278 <Files>
279 <Match pattern="*.cs" recurse="true"/>
280 </Files>
281 </Project>
282
283 <Project frameworkVersion="v3_5" name="OpenSim.Framework.Configuration.HTTP" path="OpenSim/Framework/Configuration/HTTP" type="Library">
284 <Configuration name="Debug">
285 <Options>
286 <OutputPath>../../../../bin/</OutputPath>
287 </Options>
288 </Configuration>
289 <Configuration name="Release">
290 <Options>
291 <OutputPath>../../../../bin/</OutputPath>
292 </Options>
293 </Configuration>
294
295 <ReferencePath>../../../../bin/</ReferencePath>
296 <Reference name="System"/>
297 <Reference name="System.Xml"/>
298 <Reference name="OpenMetaverseTypes.dll"/>
299 <Reference name="XMLRPC.dll"/>
300 <Reference name="OpenSim.Framework"/>
301 <Reference name="OpenSim.Framework.Console"/>
302 <Reference name="OpenSim.Framework.Configuration.XML"/>
303 <Reference name="OpenSim.Data"/>
304 <Reference name="log4net.dll"/>
305 <Files>
306 <Match pattern="*.cs" recurse="true"/>
307 </Files>
308 </Project>
309
310 <Project frameworkVersion="v3_5" name="OpenSim.Framework.AssetLoader.Filesystem" path="OpenSim/Framework/AssetLoader/Filesystem" type="Library"> 258 <Project frameworkVersion="v3_5" name="OpenSim.Framework.AssetLoader.Filesystem" path="OpenSim/Framework/AssetLoader/Filesystem" type="Library">
311 <Configuration name="Debug"> 259 <Configuration name="Debug">
312 <Options> 260 <Options>
@@ -1449,35 +1397,11 @@
1449 <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> 1397 <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/>
1450 <Match pattern="*.cs" recurse="true"> 1398 <Match pattern="*.cs" recurse="true">
1451 <Exclude name="Tests" pattern="Tests" /> 1399 <Exclude name="Tests" pattern="Tests" />
1452 <Exclude name="TerrainDefaultEffects" pattern="World/Terrain/DefaultEffects" />
1453 </Match> 1400 </Match>
1454 <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> 1401 <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/>
1455 </Files> 1402 </Files>
1456 </Project> 1403 </Project>
1457 1404
1458 <Project frameworkVersion="v3_5" name="OpenSim.Region.CoreModules.World.Terrain.DefaultEffects" path="OpenSim/Region/CoreModules/World/Terrain/DefaultEffects" type="Library">
1459 <Configuration name="Debug">
1460 <Options>
1461 <OutputPath>../../../../../../bin/Terrain/</OutputPath>
1462 </Options>
1463 </Configuration>
1464 <Configuration name="Release">
1465 <Options>
1466 <OutputPath>../../../../../../bin/Terrain/</OutputPath>
1467 </Options>
1468 </Configuration>
1469
1470 <ReferencePath>../../../../../../bin/</ReferencePath>
1471 <Reference name="System"/>
1472 <Reference name="OpenSim.Framework"/>
1473 <Reference name="OpenSim.Region.Framework"/>
1474 <Reference name="OpenSim.Region.CoreModules"/>
1475 <Files>
1476 <Match pattern="*.cs" recurse="true"/>
1477 </Files>
1478 </Project>
1479
1480
1481 <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library"> 1405 <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library">
1482 <Configuration name="Debug"> 1406 <Configuration name="Debug">
1483 <Options> 1407 <Options>