aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.nant/local.include1
-rw-r--r--OpenSim/Framework/AgentCircuitManager.cs26
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs12
-rw-r--r--OpenSim/Framework/IScene.cs2
-rw-r--r--OpenSim/Framework/Servers/MessageServerInfo.cs48
-rw-r--r--OpenSim/Region/Application/Application.cs117
-rw-r--r--OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs95
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs5
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs5
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs29
-rw-r--r--OpenSim/Services/Interfaces/IGatekeeperService.cs1
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs36
-rw-r--r--bin/OpenSim.ini.example3
-rw-r--r--bin/config-include/StandaloneHypergrid.ini3
18 files changed, 284 insertions, 111 deletions
diff --git a/.nant/local.include b/.nant/local.include
index b78b3ef..97353e0 100644
--- a/.nant/local.include
+++ b/.nant/local.include
@@ -20,6 +20,7 @@
20 <delete dir="${distbindir}/.nant"/> 20 <delete dir="${distbindir}/.nant"/>
21 <delete> 21 <delete>
22 <fileset basedir="${distbindir}"> 22 <fileset basedir="${distbindir}">
23 <include name="BUILDING.txt"/>
23 <include name="Makefile"/> 24 <include name="Makefile"/>
24 <include name="nant-color"/> 25 <include name="nant-color"/>
25 <include name="OpenSim.*"/> 26 <include name="OpenSim.*"/>
diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs
index e5dbb5a..49d7822 100644
--- a/OpenSim/Framework/AgentCircuitManager.cs
+++ b/OpenSim/Framework/AgentCircuitManager.cs
@@ -36,6 +36,7 @@ namespace OpenSim.Framework
36 public class AgentCircuitManager 36 public class AgentCircuitManager
37 { 37 {
38 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); 38 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
39 public Dictionary<UUID, AgentCircuitData> AgentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>();
39 40
40 public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) 41 public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
41 { 42 {
@@ -86,10 +87,12 @@ namespace OpenSim.Framework
86 if (AgentCircuits.ContainsKey(circuitCode)) 87 if (AgentCircuits.ContainsKey(circuitCode))
87 { 88 {
88 AgentCircuits[circuitCode] = agentData; 89 AgentCircuits[circuitCode] = agentData;
90 AgentCircuitsByUUID[agentData.AgentID] = agentData;
89 } 91 }
90 else 92 else
91 { 93 {
92 AgentCircuits.Add(circuitCode, agentData); 94 AgentCircuits.Add(circuitCode, agentData);
95 AgentCircuitsByUUID.Add(agentData.AgentID, agentData);
93 } 96 }
94 } 97 }
95 } 98 }
@@ -99,10 +102,26 @@ namespace OpenSim.Framework
99 lock (AgentCircuits) 102 lock (AgentCircuits)
100 { 103 {
101 if (AgentCircuits.ContainsKey(circuitCode)) 104 if (AgentCircuits.ContainsKey(circuitCode))
105 {
106 UUID agentID = AgentCircuits[circuitCode].AgentID;
102 AgentCircuits.Remove(circuitCode); 107 AgentCircuits.Remove(circuitCode);
108 AgentCircuitsByUUID.Remove(agentID);
109 }
103 } 110 }
104 } 111 }
105 112
113 public virtual void RemoveCircuit(UUID agentID)
114 {
115 lock (AgentCircuits)
116 {
117 if (AgentCircuitsByUUID.ContainsKey(agentID))
118 {
119 uint circuitCode = AgentCircuitsByUUID[agentID].circuitcode;
120 AgentCircuits.Remove(circuitCode);
121 AgentCircuitsByUUID.Remove(agentID);
122 }
123 }
124 }
106 public AgentCircuitData GetAgentCircuitData(uint circuitCode) 125 public AgentCircuitData GetAgentCircuitData(uint circuitCode)
107 { 126 {
108 AgentCircuitData agentCircuit = null; 127 AgentCircuitData agentCircuit = null;
@@ -110,6 +129,13 @@ namespace OpenSim.Framework
110 return agentCircuit; 129 return agentCircuit;
111 } 130 }
112 131
132 public AgentCircuitData GetAgentCircuitData(UUID agentID)
133 {
134 AgentCircuitData agentCircuit = null;
135 AgentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
136 return agentCircuit;
137 }
138
113 public void UpdateAgentData(AgentCircuitData agentData) 139 public void UpdateAgentData(AgentCircuitData agentData)
114 { 140 {
115 if (AgentCircuits.ContainsKey((uint) agentData.circuitcode)) 141 if (AgentCircuits.ContainsKey((uint) agentData.circuitcode))
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index b27d011..62a1e17 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -99,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. 99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
100 100
101 //private string eventQueue = "0100/"; 101 //private string eventQueue = "0100/";
102 private IScene m_Scene;
102 private IHttpServer m_httpListener; 103 private IHttpServer m_httpListener;
103 private UUID m_agentID; 104 private UUID m_agentID;
104 private IAssetService m_assetCache; 105 private IAssetService m_assetCache;
@@ -130,9 +131,10 @@ namespace OpenSim.Framework.Capabilities
130 public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null; 131 public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
131 public GetClientDelegate GetClient = null; 132 public GetClientDelegate GetClient = null;
132 133
133 public Caps(IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath, 134 public Caps(IScene scene, IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
134 UUID agent, bool dumpAssetsToFile, string regionName) 135 UUID agent, bool dumpAssetsToFile, string regionName)
135 { 136 {
137 m_Scene = scene;
136 m_assetCache = assetCache; 138 m_assetCache = assetCache;
137 m_capsObjectPath = capsPath; 139 m_capsObjectPath = capsPath;
138 m_httpListener = httpServer; 140 m_httpListener = httpServer;
@@ -278,7 +280,13 @@ namespace OpenSim.Framework.Capabilities
278 public string CapsRequest(string request, string path, string param, 280 public string CapsRequest(string request, string path, string param,
279 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 281 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
280 { 282 {
281 //m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); 283 m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
284
285 if (!m_Scene.CheckClient(m_agentID, httpRequest.RemoteIPEndPoint))
286 {
287 m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
288 return string.Empty;
289 }
282 290
283 string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails); 291 string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails);
284 292
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 19ab409..6798b7b 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -102,5 +102,7 @@ namespace OpenSim.Framework
102 void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback); 102 void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
103 103
104 ISceneObject DeserializeObject(string representation); 104 ISceneObject DeserializeObject(string representation);
105
106 bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
105 } 107 }
106} 108}
diff --git a/OpenSim/Framework/Servers/MessageServerInfo.cs b/OpenSim/Framework/Servers/MessageServerInfo.cs
deleted file mode 100644
index 57ceb71..0000000
--- a/OpenSim/Framework/Servers/MessageServerInfo.cs
+++ /dev/null
@@ -1,48 +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.Collections.Generic;
29
30namespace OpenSim.Framework.Servers
31{
32 public class MessageServerInfo
33 {
34 public string URI;
35 public string sendkey;
36 public string recvkey;
37 public List<ulong> responsibleForRegions;
38
39 public MessageServerInfo()
40 {
41 }
42
43 public override string ToString()
44 {
45 return URI;
46 }
47 }
48}
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 7721cdf..b860cf6 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -105,7 +105,7 @@ namespace OpenSim
105 105
106 // Check if the system is compatible with OpenSimulator. 106 // Check if the system is compatible with OpenSimulator.
107 // Ensures that the minimum system requirements are met 107 // Ensures that the minimum system requirements are met
108 m_log.Info("Performing compatibility checks... "); 108 m_log.Info("Performing compatibility checks... \n");
109 string supported = String.Empty; 109 string supported = String.Empty;
110 if (Util.IsEnvironmentSupported(ref supported)) 110 if (Util.IsEnvironmentSupported(ref supported))
111 { 111 {
@@ -120,6 +120,113 @@ namespace OpenSim
120 Culture.SetCurrentCulture(); 120 Culture.SetCurrentCulture();
121 121
122 122
123 // Validate that the user has the most basic configuration done
124 // If not, offer to do the most basic configuration for them warning them along the way of the importance of
125 // reading these files.
126 /*
127 m_log.Info("Checking for reguired configuration...\n");
128
129 bool OpenSim_Ini = (File.Exists(Path.Combine(Util.configDir(), "OpenSim.ini")))
130 || (File.Exists(Path.Combine(Util.configDir(), "opensim.ini")))
131 || (File.Exists(Path.Combine(Util.configDir(), "openSim.ini")))
132 || (File.Exists(Path.Combine(Util.configDir(), "Opensim.ini")));
133
134 bool StanaloneCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini"));
135 bool StanaloneCommon_lowercased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "standalonecommon.ini"));
136 bool GridCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "GridCommon.ini"));
137 bool GridCommon_lowerCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "gridcommon.ini"));
138
139 if ((OpenSim_Ini)
140 && (
141 (StanaloneCommon_ProperCased
142 || StanaloneCommon_lowercased
143 || GridCommon_ProperCased
144 || GridCommon_lowerCased
145 )))
146 {
147 m_log.Info("Required Configuration Files Found\n");
148 }
149 else
150 {
151 MainConsole.Instance = new LocalConsole("Region");
152 string resp = MainConsole.Instance.CmdPrompt(
153 "\n\n*************Required Configuration files not found.*************\n\n OpenSimulator will not run without these files.\n\nRemember, these file names are Case Sensitive in Linux and Proper Cased.\n1. ./OpenSim.ini\nand\n2. ./config-include/StandaloneCommon.ini \nor\n3. ./config-include/GridCommon.ini\n\nAlso, you will want to examine these files in great detail because only the basic system will load by default. OpenSimulator can do a LOT more if you spend a little time going through these files.\n\n" + ": " + "Do you want to copy the most basic Defaults from standalone?",
154 "yes");
155 if (resp == "yes")
156 {
157
158 if (!(OpenSim_Ini))
159 {
160 try
161 {
162 File.Copy(Path.Combine(Util.configDir(), "OpenSim.ini.example"),
163 Path.Combine(Util.configDir(), "OpenSim.ini"));
164 } catch (UnauthorizedAccessException)
165 {
166 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, Make sure OpenSim has have the required permissions\n");
167 } catch (ArgumentException)
168 {
169 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, The current directory is invalid.\n");
170 } catch (System.IO.PathTooLongException)
171 {
172 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the Path to these files is too long.\n");
173 } catch (System.IO.DirectoryNotFoundException)
174 {
175 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the current directory is reporting as not found.\n");
176 } catch (System.IO.FileNotFoundException)
177 {
178 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
179 } catch (System.IO.IOException)
180 {
181 // Destination file exists already or a hard drive failure... .. so we can just drop this one
182 //MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
183 } catch (System.NotSupportedException)
184 {
185 MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, The current directory is invalid.\n");
186 }
187
188 }
189 if (!(StanaloneCommon_ProperCased || StanaloneCommon_lowercased))
190 {
191 try
192 {
193 File.Copy(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini.example"),
194 Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini"));
195 }
196 catch (UnauthorizedAccessException)
197 {
198 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, Make sure OpenSim has the required permissions\n");
199 }
200 catch (ArgumentException)
201 {
202 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, The current directory is invalid.\n");
203 }
204 catch (System.IO.PathTooLongException)
205 {
206 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the Path to these files is too long.\n");
207 }
208 catch (System.IO.DirectoryNotFoundException)
209 {
210 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the current directory is reporting as not found.\n");
211 }
212 catch (System.IO.FileNotFoundException)
213 {
214 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the example is not found, please make sure that the example files exist.\n");
215 }
216 catch (System.IO.IOException)
217 {
218 // Destination file exists already or a hard drive failure... .. so we can just drop this one
219 //MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
220 }
221 catch (System.NotSupportedException)
222 {
223 MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, The current directory is invalid.\n");
224 }
225 }
226 }
227 MainConsole.Instance = null;
228 }
229 */
123 configSource.Alias.AddAlias("On", true); 230 configSource.Alias.AddAlias("On", true);
124 configSource.Alias.AddAlias("Off", false); 231 configSource.Alias.AddAlias("Off", false);
125 configSource.Alias.AddAlias("True", true); 232 configSource.Alias.AddAlias("True", true);
@@ -145,6 +252,8 @@ namespace OpenSim
145 // load Crash directory config 252 // load Crash directory config
146 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); 253 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
147 254
255
256
148 if (background) 257 if (background)
149 { 258 {
150 m_sim = new OpenSimBackground(configSource); 259 m_sim = new OpenSimBackground(configSource);
@@ -152,8 +261,14 @@ namespace OpenSim
152 } 261 }
153 else 262 else
154 { 263 {
264
265
266
267
155 m_sim = new OpenSim(configSource); 268 m_sim = new OpenSim(configSource);
156 269
270
271
157 m_sim.Startup(); 272 m_sim.Startup();
158 273
159 while (true) 274 while (true)
diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
index 2a1355b..a6f5d97 100644
--- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
107 } 107 }
108 108
109 Caps caps 109 Caps caps
110 = new Caps( 110 = new Caps(m_scene,
111 m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName, 111 m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
112 MainServer.Instance.Port, 112 MainServer.Instance.Port,
113 capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); 113 capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index acc3a78..9c8cbc6 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -286,6 +286,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
286 fromName = avatar.Name; 286 fromName = avatar.Name;
287 sourceType = ChatSourceType.Agent; 287 sourceType = ChatSourceType.Agent;
288 } 288 }
289 else if (c.SenderUUID != UUID.Zero)
290 {
291 fromID = c.SenderUUID;
292 }
289 293
290 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); 294 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
291 if (c.Scene != null) 295 if (c.Scene != null)
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
index 9df6074..a895d6e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
@@ -143,10 +143,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
143 } 143 }
144 144
145 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) 145 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
146 { 146 {
147 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
148 try 147 try
149 { 148 {
149 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
150
150 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) 151 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
151 { 152 {
152 avatar.Invulnerable = false; 153 avatar.Invulnerable = false;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e920ff5..5973847 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2657,34 +2657,23 @@ namespace OpenSim.Region.Framework.Scenes
2657 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); 2657 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
2658 2658
2659 // Do the verification here 2659 // Do the verification here
2660 System.Net.EndPoint ep = client.GetClientEP(); 2660 System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP();
2661 if (aCircuit != null) 2661 if (aCircuit != null)
2662 { 2662 {
2663 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) 2663 if (!VerifyClient(aCircuit, ep, out vialogin))
2664 { 2664 {
2665 m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2665 // uh-oh, this is fishy
2666 vialogin = true; 2666 m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
2667 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); 2667 client.AgentId, client.SessionId, ep.ToString());
2668 if (userVerification != null && ep != null) 2668 try
2669 { 2669 {
2670 if (!userVerification.VerifyClient(aCircuit, ep.ToString())) 2670 client.Close();
2671 { 2671 }
2672 // uh-oh, this is fishy 2672 catch (Exception e)
2673 m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", 2673 {
2674 client.AgentId, client.SessionId, ep.ToString()); 2674 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
2675 try
2676 {
2677 client.Close();
2678 }
2679 catch (Exception e)
2680 {
2681 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
2682 }
2683 return;
2684 }
2685 else
2686 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} returned true", aCircuit.firstname, aCircuit.lastname);
2687 } 2675 }
2676 return;
2688 } 2677 }
2689 } 2678 }
2690 2679
@@ -2710,7 +2699,65 @@ namespace OpenSim.Region.Framework.Scenes
2710 EventManager.TriggerOnClientLogin(client); 2699 EventManager.TriggerOnClientLogin(client);
2711 } 2700 }
2712 2701
2713 2702 private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin)
2703 {
2704 vialogin = false;
2705
2706 // Do the verification here
2707 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
2708 {
2709 m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2710 vialogin = true;
2711 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
2712 if (userVerification != null && ep != null)
2713 {
2714 if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
2715 {
2716 // uh-oh, this is fishy
2717 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2718 return false;
2719 }
2720 else
2721 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2722 }
2723 }
2724
2725 return true;
2726 }
2727
2728 // Called by Caps, on the first HTTP contact from the client
2729 public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
2730 {
2731 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(agentID);
2732 if (aCircuit != null)
2733 {
2734 bool vialogin = false;
2735 if (!VerifyClient(aCircuit, ep, out vialogin))
2736 {
2737 // if it doesn't pass, we remove the agentcircuitdata altogether
2738 // and the scene presence and the client, if they exist
2739 try
2740 {
2741 ScenePresence sp = GetScenePresence(agentID);
2742 if (sp != null)
2743 sp.ControllingClient.Close();
2744
2745 // BANG! SLASH!
2746 m_authenticateHandler.RemoveCircuit(agentID);
2747
2748 return false;
2749 }
2750 catch (Exception e)
2751 {
2752 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
2753 }
2754 }
2755 else
2756 return true;
2757 }
2758
2759 return false;
2760 }
2714 2761
2715 /// <summary> 2762 /// <summary>
2716 /// Register for events from the client 2763 /// Register for events from the client
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 3218dad..bfc19b7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -536,5 +536,6 @@ namespace OpenSim.Region.Framework.Scenes
536 get { return false; } 536 get { return false; }
537 } 537 }
538 538
539 public abstract bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
539 } 540 }
540} 541}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
index dd9f8f6..42587c1 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
@@ -70,6 +70,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
70 { 70 {
71 throw new NotImplementedException(); 71 throw new NotImplementedException();
72 } 72 }
73
74 public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
75 {
76 throw new NotImplementedException();
77 }
73 } 78 }
74 79
75 [Test] 80 [Test]
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 3e91e3a..42eca05 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -204,6 +204,11 @@ namespace OpenSim.Services.Connectors.Hypergrid
204 return args; 204 return args;
205 } 205 }
206 206
207 public void SetClientToken(UUID sessionID, string token)
208 {
209 // no-op
210 }
211
207 public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) 212 public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt)
208 { 213 {
209 position = Vector3.UnitY; lookAt = Vector3.UnitY; 214 position = Vector3.UnitY; lookAt = Vector3.UnitY;
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 64f7e8a..2f1fed4 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -148,6 +148,15 @@ namespace OpenSim.Services.HypergridService
148 return true; 148 return true;
149 } 149 }
150 150
151 public void SetClientToken(UUID sessionID, string token)
152 {
153 if (m_TravelingAgents.ContainsKey(sessionID))
154 {
155 m_log.DebugFormat("[USER AGENT SERVICE]: Setting token {0} for session {1}", token, sessionID);
156 m_TravelingAgents[sessionID].ClientToken = token;
157 }
158 }
159
151 TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region) 160 TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region)
152 { 161 {
153 TravelingAgentInfo travel = new TravelingAgentInfo(); 162 TravelingAgentInfo travel = new TravelingAgentInfo();
@@ -203,22 +212,16 @@ namespace OpenSim.Services.HypergridService
203 212
204 public bool VerifyClient(UUID sessionID, string token) 213 public bool VerifyClient(UUID sessionID, string token)
205 { 214 {
206 return true; 215 m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
216 //return true;
207 217
208 // Commenting this for now until I understand better what part of a sender's 218 // Commenting this for now until I understand better what part of a sender's
209 // info stays unchanged throughout a session 219 // info stays unchanged throughout a session
210 // 220
211 //if (m_TravelingAgents.ContainsKey(sessionID)) 221 if (m_TravelingAgents.ContainsKey(sessionID))
212 //{ 222 return m_TravelingAgents[sessionID].ClientToken == token;
213 // // Aquiles heel. Must trust the first grid upon login 223
214 // if (m_TravelingAgents[sessionID].ClientToken == string.Empty) 224 return false;
215 // {
216 // m_TravelingAgents[sessionID].ClientToken = token;
217 // return true;
218 // }
219 // return m_TravelingAgents[sessionID].ClientToken == token;
220 //}
221 //return false;
222 } 225 }
223 226
224 public bool VerifyAgent(UUID sessionID, string token) 227 public bool VerifyAgent(UUID sessionID, string token)
diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs
index ca7b9b3..2d397bc 100644
--- a/OpenSim/Services/Interfaces/IGatekeeperService.cs
+++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Services.Interfaces
49 public interface IUserAgentService 49 public interface IUserAgentService
50 { 50 {
51 bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); 51 bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason);
52 void SetClientToken(UUID sessionID, string token);
52 void LogoutAgent(UUID userID, UUID sessionID); 53 void LogoutAgent(UUID userID, UUID sessionID);
53 GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); 54 GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt);
54 55
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 398fe4f..c85d35a 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -58,21 +58,21 @@ namespace OpenSim.Services.LLLoginService
58 protected IInventoryService m_InventoryService; 58 protected IInventoryService m_InventoryService;
59 protected IGridService m_GridService; 59 protected IGridService m_GridService;
60 protected IPresenceService m_PresenceService; 60 protected IPresenceService m_PresenceService;
61 private ISimulationService m_LocalSimulationService; 61 protected ISimulationService m_LocalSimulationService;
62 private ISimulationService m_RemoteSimulationService; 62 protected ISimulationService m_RemoteSimulationService;
63 protected ILibraryService m_LibraryService; 63 protected ILibraryService m_LibraryService;
64 protected IFriendsService m_FriendsService; 64 protected IFriendsService m_FriendsService;
65 protected IAvatarService m_AvatarService; 65 protected IAvatarService m_AvatarService;
66 private IUserAgentService m_UserAgentService; 66 protected IUserAgentService m_UserAgentService;
67 67
68 private GatekeeperServiceConnector m_GatekeeperConnector; 68 protected GatekeeperServiceConnector m_GatekeeperConnector;
69 69
70 private string m_DefaultRegionName; 70 protected string m_DefaultRegionName;
71 protected string m_WelcomeMessage; 71 protected string m_WelcomeMessage;
72 private bool m_RequireInventory; 72 protected bool m_RequireInventory;
73 protected int m_MinLoginLevel; 73 protected int m_MinLoginLevel;
74 private string m_GatekeeperURL; 74 protected string m_GatekeeperURL;
75 private bool m_AllowRemoteSetLoginLevel; 75 protected bool m_AllowRemoteSetLoginLevel;
76 76
77 IConfig m_LoginServerConfig; 77 IConfig m_LoginServerConfig;
78 78
@@ -335,7 +335,7 @@ namespace OpenSim.Services.LLLoginService
335 // Instantiate/get the simulation interface and launch an agent at the destination 335 // Instantiate/get the simulation interface and launch an agent at the destination
336 // 336 //
337 string reason = string.Empty; 337 string reason = string.Empty;
338 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason); 338 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason);
339 339
340 if (aCircuit == null) 340 if (aCircuit == null)
341 { 341 {
@@ -595,7 +595,7 @@ namespace OpenSim.Services.LLLoginService
595 } 595 }
596 596
597 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, 597 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar,
598 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason) 598 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason)
599 { 599 {
600 where = currentWhere; 600 where = currentWhere;
601 ISimulationService simConnector = null; 601 ISimulationService simConnector = null;
@@ -661,7 +661,7 @@ namespace OpenSim.Services.LLLoginService
661 { 661 {
662 circuitCode = (uint)Util.RandomClass.Next(); ; 662 circuitCode = (uint)Util.RandomClass.Next(); ;
663 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); 663 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer);
664 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason); 664 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
665 if (!success && m_GridService != null) 665 if (!success && m_GridService != null)
666 { 666 {
667 // Try the fallback regions 667 // Try the fallback regions
@@ -670,7 +670,7 @@ namespace OpenSim.Services.LLLoginService
670 { 670 {
671 foreach (GridRegion r in fallbacks) 671 foreach (GridRegion r in fallbacks)
672 { 672 {
673 success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, out reason); 673 success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, clientIP, out reason);
674 if (success) 674 if (success)
675 { 675 {
676 where = "safe"; 676 where = "safe";
@@ -747,10 +747,18 @@ namespace OpenSim.Services.LLLoginService
747 return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); 747 return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason);
748 } 748 }
749 749
750 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) 750 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)
751 { 751 {
752 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); 752 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
753 return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); 753 if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
754 {
755 // We may need to do this at some point,
756 // so leaving it here in comments.
757 //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address);
758 m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString());
759 return true;
760 }
761 return false;
754 } 762 }
755 763
756 #region Console Commands 764 #region Console Commands
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 1f8fca2..6d5ee14 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -87,9 +87,6 @@
87 ; YOU HAVE BEEN WARNED!!! 87 ; YOU HAVE BEEN WARNED!!!
88 TrustBinaries = false 88 TrustBinaries = false
89 89
90 ; How many prims to send to each avatar in the scene on each Update()
91 ; MaxPrimsPerFrame = 200
92
93 ; Combine all contiguous regions into one large region 90 ; Combine all contiguous regions into one large region
94 ; Order your regions from South to North, West to East in your regions.ini and then set this to true 91 ; Order your regions from South to North, West to East in your regions.ini and then set this to true
95 ; Warning! Don't use this with regions that have existing content!, This will likely break them 92 ; Warning! Don't use this with regions that have existing content!, This will likely break them
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini
index 32b240b..52e30e2 100644
--- a/bin/config-include/StandaloneHypergrid.ini
+++ b/bin/config-include/StandaloneHypergrid.ini
@@ -42,7 +42,6 @@
42 42
43[AvatarService] 43[AvatarService]
44 LocalServiceModule = "OpenSim.Services.AvatarService.dll:AvatarService" 44 LocalServiceModule = "OpenSim.Services.AvatarService.dll:AvatarService"
45 ConnectionString = "URI=file:avatars.db,version=3"
46 45
47[LibraryService] 46[LibraryService]
48 LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService" 47 LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService"
@@ -54,7 +53,6 @@
54 53
55[AuthenticationService] 54[AuthenticationService]
56 LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" 55 LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
57 ConnectionString = "URI=file:auth.db,version=3"
58 56
59[GridService] 57[GridService]
60 ; LocalGridServicesConnector needs this 58 ; LocalGridServicesConnector needs this
@@ -82,7 +80,6 @@
82 80
83[FriendsService] 81[FriendsService]
84 LocalServiceModule = "OpenSim.Services.FriendsService.dll" 82 LocalServiceModule = "OpenSim.Services.FriendsService.dll"
85 ConnectionString = "URI=file:friends.db,version=3"
86 83
87[Friends] 84[Friends]
88 Connector = "OpenSim.Services.FriendsService.dll" 85 Connector = "OpenSim.Services.FriendsService.dll"