aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJonathan Freedman2010-10-05 14:17:18 -0400
committerJonathan Freedman2010-10-05 14:17:18 -0400
commit8f1acb890ac49ea004bf43065ce8d3472bb27708 (patch)
tree07e4e5fc77f764232c958bdbf8f93f2651da1663 /OpenSim
parentMerge branch 'master' of git://opensimulator.org/git/opensim (diff)
parentFormatting cleanup. (diff)
downloadopensim-SC-8f1acb890ac49ea004bf43065ce8d3472bb27708.zip
opensim-SC-8f1acb890ac49ea004bf43065ce8d3472bb27708.tar.gz
opensim-SC-8f1acb890ac49ea004bf43065ce8d3472bb27708.tar.bz2
opensim-SC-8f1acb890ac49ea004bf43065ce8d3472bb27708.tar.xz
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/Migration.cs4
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs37
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs47
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs22
-rw-r--r--OpenSim/Region/CoreModules/LightShare/LightShareModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs8
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs2
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs3
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs6
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs25
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs3
-rw-r--r--OpenSim/Server/Handlers/Login/LLLoginHandlers.cs19
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs22
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs8
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs6
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs6
-rw-r--r--OpenSim/Services/Interfaces/ILoginService.cs3
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs20
28 files changed, 213 insertions, 70 deletions
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs
index 2895a71..d606470 100644
--- a/OpenSim/Data/Migration.cs
+++ b/OpenSim/Data/Migration.cs
@@ -138,12 +138,12 @@ namespace OpenSim.Data
138 /// <param name="conn"></param> 138 /// <param name="conn"></param>
139 /// <param name="script">Array of strings, one-per-batch (often just one)</param> 139 /// <param name="script">Array of strings, one-per-batch (often just one)</param>
140 protected virtual void ExecuteScript(DbConnection conn, string[] script) 140 protected virtual void ExecuteScript(DbConnection conn, string[] script)
141 { 141 {
142 using (DbCommand cmd = conn.CreateCommand()) 142 using (DbCommand cmd = conn.CreateCommand())
143 { 143 {
144 cmd.CommandTimeout = 0; 144 cmd.CommandTimeout = 0;
145 foreach (string sql in script) 145 foreach (string sql in script)
146 { 146 {
147 cmd.CommandText = sql; 147 cmd.CommandText = sql;
148 try 148 try
149 { 149 {
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index 783a833..4f89d78 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -108,11 +108,31 @@ namespace OpenSim.Framework
108 public string ServiceSessionID = string.Empty; 108 public string ServiceSessionID = string.Empty;
109 109
110 /// <summary> 110 /// <summary>
111 /// Viewer's version string 111 /// The client's IP address, as captured by the login service
112 /// </summary>
113 public string IPAddress;
114
115 /// <summary>
116 /// Viewer's version string as reported by the viewer at login
112 /// </summary> 117 /// </summary>
113 public string Viewer; 118 public string Viewer;
114 119
115 /// <summary> 120 /// <summary>
121 /// The channel strinf sent by the viewer at login
122 /// </summary>
123 public string Channel;
124
125 /// <summary>
126 /// The Mac address as reported by the viewer at login
127 /// </summary>
128 public string Mac;
129
130 /// <summary>
131 /// The id0 as reported by the viewer at login
132 /// </summary>
133 public string Id0;
134
135 /// <summary>
116 /// Position the Agent's Avatar starts in the region 136 /// Position the Agent's Avatar starts in the region
117 /// </summary> 137 /// </summary>
118 public Vector3 startpos; 138 public Vector3 startpos;
@@ -179,7 +199,11 @@ namespace OpenSim.Framework
179 args["service_session_id"] = OSD.FromString(ServiceSessionID); 199 args["service_session_id"] = OSD.FromString(ServiceSessionID);
180 args["start_pos"] = OSD.FromString(startpos.ToString()); 200 args["start_pos"] = OSD.FromString(startpos.ToString());
181 args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); 201 args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);
202 args["client_ip"] = OSD.FromString(IPAddress);
182 args["viewer"] = OSD.FromString(Viewer); 203 args["viewer"] = OSD.FromString(Viewer);
204 args["channel"] = OSD.FromString(Channel);
205 args["mac"] = OSD.FromString(Mac);
206 args["id0"] = OSD.FromString(Id0);
183 207
184 if (Appearance != null) 208 if (Appearance != null)
185 { 209 {
@@ -279,8 +303,16 @@ namespace OpenSim.Framework
279 SessionID = args["session_id"].AsUUID(); 303 SessionID = args["session_id"].AsUUID();
280 if (args["service_session_id"] != null) 304 if (args["service_session_id"] != null)
281 ServiceSessionID = args["service_session_id"].AsString(); 305 ServiceSessionID = args["service_session_id"].AsString();
306 if (args["client_ip"] != null)
307 IPAddress = args["client_ip"].AsString();
282 if (args["viewer"] != null) 308 if (args["viewer"] != null)
283 Viewer = args["viewer"].AsString(); 309 Viewer = args["viewer"].AsString();
310 if (args["channel"] != null)
311 Channel = args["channel"].AsString();
312 if (args["mac"] != null)
313 Mac = args["mac"].AsString();
314 if (args["id0"] != null)
315 Id0 = args["id0"].AsString();
284 316
285 if (args["start_pos"] != null) 317 if (args["start_pos"] != null)
286 Vector3.TryParse(args["start_pos"].AsString(), out startpos); 318 Vector3.TryParse(args["start_pos"].AsString(), out startpos);
@@ -349,6 +381,9 @@ namespace OpenSim.Framework
349 public float startposy; 381 public float startposy;
350 public float startposz; 382 public float startposz;
351 public string Viewer; 383 public string Viewer;
384 public string Channel;
385 public string Mac;
386 public string Id0;
352 387
353 public sAgentCircuitData() 388 public sAgentCircuitData()
354 { 389 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
index e43f7cf..4cb4aee 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -139,28 +139,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP
139 private void ProcessQueues() 139 private void ProcessQueues()
140 { 140 {
141 // Process all the pending adds 141 // Process all the pending adds
142 OutgoingPacket pendingAdd;
143 while (m_pendingAdds.Dequeue(out pendingAdd))
144 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
145 142
143 OutgoingPacket pendingAdd;
144 if (m_pendingAdds != null)
145 {
146 while (m_pendingAdds.TryDequeue(out pendingAdd))
147 {
148 if (pendingAdd != null && m_packets != null)
149 {
150 m_packets[pendingAdd.SequenceNumber] = pendingAdd;
151 }
152 }
153 }
154
146 // Process all the pending removes, including updating statistics and round-trip times 155 // Process all the pending removes, including updating statistics and round-trip times
147 PendingAck pendingRemove; 156 PendingAck pendingRemove;
148 OutgoingPacket ackedPacket; 157 OutgoingPacket ackedPacket;
149 while (m_pendingRemoves.Dequeue(out pendingRemove)) 158 if (m_pendingRemoves != null)
150 { 159 {
151 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) 160 while (m_pendingRemoves.TryDequeue(out pendingRemove))
152 { 161 {
153 m_packets.Remove(pendingRemove.SequenceNumber); 162 if (m_pendingRemoves != null && m_packets != null)
154
155 // Update stats
156 System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
157
158 if (!pendingRemove.FromResend)
159 { 163 {
160 // Calculate the round-trip time for this packet and its ACK 164 if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
161 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; 165 {
162 if (rtt > 0) 166 m_packets.Remove(pendingRemove.SequenceNumber);
163 ackedPacket.Client.UpdateRoundTrip(rtt); 167
168 // Update stats
169 System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
170
171 if (!pendingRemove.FromResend)
172 {
173 // Calculate the round-trip time for this packet and its ACK
174 int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
175 if (rtt > 0)
176 ackedPacket.Client.UpdateRoundTrip(rtt);
177 }
178 }
164 } 179 }
165 } 180 }
166 } 181 }
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index 9eaa758..6ed4867 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -252,7 +252,7 @@ namespace Flotsam.RegionModules.AssetCache
252 } 252 }
253 else 253 else
254 { 254 {
255 m_MemoryCache.AddOrUpdate(key, asset, DateTime.MaxValue); 255 m_MemoryCache.AddOrUpdate(key, asset, Double.MaxValue);
256 } 256 }
257 } 257 }
258 } 258 }
@@ -863,4 +863,4 @@ namespace Flotsam.RegionModules.AssetCache
863 863
864 #endregion 864 #endregion
865 } 865 }
866} \ No newline at end of file 866}
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 28c50ab..457e0bb 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -307,7 +307,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
307 /// <param name="remoteClient"></param> 307 /// <param name="remoteClient"></param>
308 /// <param name="itemID"></param> 308 /// <param name="itemID"></param>
309 /// <param name="AttachmentPt"></param> 309 /// <param name="AttachmentPt"></param>
310 /// <returns></returns> 310 /// <returns></returns>
311 protected UUID ShowAttachInUserInventory( 311 protected UUID ShowAttachInUserInventory(
312 SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) 312 SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
313 { 313 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 7a21d5e..b3f0a25 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -318,12 +318,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
318 318
319 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, fromAgentID); 319 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, fromAgentID);
320 320
321 PresenceInfo presence = null; 321 PresenceInfo presence = null;
322 PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); 322 PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid });
323 if (presences != null && presences.Length > 0) 323 if (presences != null && presences.Length > 0)
324 presence = presences[0]; 324 presence = presences[0];
325 if (presence != null) 325 if (presence != null)
326 im.offline = 0; 326 im.offline = 0;
327 327
328 im.fromAgentID = fromAgentID.Guid; 328 im.fromAgentID = fromAgentID.Guid;
329 im.fromAgentName = account.FirstName + " " + account.LastName; 329 im.fromAgentName = account.FirstName + " " + account.LastName;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 828c4e7..3791e1d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -301,7 +301,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
301 if (currentAgentCircuit != null) 301 if (currentAgentCircuit != null)
302 { 302 {
303 agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs; 303 agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs;
304 agentCircuit.IPAddress = currentAgentCircuit.IPAddress;
304 agentCircuit.Viewer = currentAgentCircuit.Viewer; 305 agentCircuit.Viewer = currentAgentCircuit.Viewer;
306 agentCircuit.Channel = currentAgentCircuit.Channel;
307 agentCircuit.Mac = currentAgentCircuit.Mac;
308 agentCircuit.Id0 = currentAgentCircuit.Id0;
305 } 309 }
306 310
307 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) 311 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
@@ -943,16 +947,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
943 agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 947 agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
944 948
945 agent.ChildrenCapSeeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); 949 agent.ChildrenCapSeeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
946 m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count); 950 //m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count);
947 951
948 if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle)) 952 if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle))
949 agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath); 953 agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath);
950 m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count); 954 //m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count);
951 955
952 sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath); 956 sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath);
953 foreach (ulong h in agent.ChildrenCapSeeds.Keys) 957 //foreach (ulong h in agent.ChildrenCapSeeds.Keys)
954 m_log.DebugFormat("[XXX] --> {0}", h); 958 // m_log.DebugFormat("[XXX] --> {0}", h);
955 m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle); 959 //m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle);
956 agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath); 960 agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath);
957 961
958 if (sp.Scene.CapsModule != null) 962 if (sp.Scene.CapsModule != null)
@@ -963,7 +967,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
963 if (currentAgentCircuit != null) 967 if (currentAgentCircuit != null)
964 { 968 {
965 agent.ServiceURLs = currentAgentCircuit.ServiceURLs; 969 agent.ServiceURLs = currentAgentCircuit.ServiceURLs;
970 agent.IPAddress = currentAgentCircuit.IPAddress;
966 agent.Viewer = currentAgentCircuit.Viewer; 971 agent.Viewer = currentAgentCircuit.Viewer;
972 agent.Channel = currentAgentCircuit.Channel;
973 agent.Mac = currentAgentCircuit.Mac;
974 agent.Id0 = currentAgentCircuit.Id0;
967 } 975 }
968 976
969 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; 977 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
@@ -1052,7 +1060,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1052 if (currentAgentCircuit != null) 1060 if (currentAgentCircuit != null)
1053 { 1061 {
1054 agent.ServiceURLs = currentAgentCircuit.ServiceURLs; 1062 agent.ServiceURLs = currentAgentCircuit.ServiceURLs;
1063 agent.IPAddress = currentAgentCircuit.IPAddress;
1055 agent.Viewer = currentAgentCircuit.Viewer; 1064 agent.Viewer = currentAgentCircuit.Viewer;
1065 agent.Channel = currentAgentCircuit.Channel;
1066 agent.Mac = currentAgentCircuit.Mac;
1067 agent.Id0 = currentAgentCircuit.Id0;
1056 } 1068 }
1057 1069
1058 if (newRegions.Contains(neighbour.RegionHandle)) 1070 if (newRegions.Contains(neighbour.RegionHandle))
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
index e6cab1d..412dbb6 100644
--- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
@@ -91,6 +91,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
91 m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent; 91 m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent;
92 m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile; 92 m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile;
93 m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted; 93 m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted;
94 m_scene.LoadWindlightProfile();
94 } 95 }
95 96
96 InstallCommands(); 97 InstallCommands();
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
index 7c12b8c..e7cfda1 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs
@@ -53,9 +53,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
53 public void Cache(UUID userID, UserAccount account) 53 public void Cache(UUID userID, UserAccount account)
54 { 54 {
55 // Cache even null accounts 55 // Cache even null accounts
56 m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); 56 m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS);
57 if (account != null) 57 if (account != null)
58 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); 58 m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS);
59 59
60 m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); 60 m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
61 } 61 }
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
index a99b20c..49b4364 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
@@ -352,6 +352,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
352 Face face = renderMesh.Faces[i]; 352 Face face = renderMesh.Faces[i];
353 string meshName = primID + "-Face-" + i.ToString(); 353 string meshName = primID + "-Face-" + i.ToString();
354 354
355 // Avoid adding duplicate meshes to the scene
356 if (renderer.Scene.objectData.ContainsKey(meshName))
357 {
358 continue;
359 }
360
355 warp_Object faceObj = new warp_Object(face.Vertices.Count, face.Indices.Count / 3); 361 warp_Object faceObj = new warp_Object(face.Vertices.Count, face.Indices.Count / 3);
356 362
357 for (int j = 0; j < face.Vertices.Count; j++) 363 for (int j = 0; j < face.Vertices.Count; j++)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index a79dc98..f81c551 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1073,7 +1073,7 @@ namespace OpenSim.Region.Framework.Scenes
1073 catch (Exception e) 1073 catch (Exception e)
1074 { 1074 {
1075 // Catch it and move on. This includes situations where splist has inconsistent info 1075 // Catch it and move on. This includes situations where splist has inconsistent info
1076 m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.Message); 1076 m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.ToString());
1077 } 1077 }
1078 } 1078 }
1079 } 1079 }
@@ -1114,7 +1114,6 @@ namespace OpenSim.Region.Framework.Scenes
1114 catch (Exception e) 1114 catch (Exception e)
1115 { 1115 {
1116 m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString()); 1116 m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
1117 m_log.Info("[BUG] Stack Trace: " + e.StackTrace);
1118 } 1117 }
1119 } 1118 }
1120 } 1119 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index a8e76e3..8140d42 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2763,7 +2763,7 @@ namespace OpenSim.Region.Framework.Scenes
2763 UUID = UUID.Random(); 2763 UUID = UUID.Random();
2764 LinkNum = linkNum; 2764 LinkNum = linkNum;
2765 LocalId = 0; 2765 LocalId = 0;
2766 Inventory.ResetInventoryIDs(); 2766 Inventory.ResetInventoryIDs();
2767 } 2767 }
2768 2768
2769 /// <summary> 2769 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a4533fa..13d9964 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1523,7 +1523,7 @@ namespace OpenSim.Region.Framework.Scenes
1523 } 1523 }
1524 1524
1525 // If the agent update does move the avatar, then calculate the force ready for the velocity update, 1525 // If the agent update does move the avatar, then calculate the force ready for the velocity update,
1526 // which occurs later in the main scene loop 1526 // which occurs later in the main scene loop
1527 if (update_movementflag || (update_rotation && DCFlagKeyPressed)) 1527 if (update_movementflag || (update_rotation && DCFlagKeyPressed))
1528 { 1528 {
1529 // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); 1529 // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed));
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index e6ff0c0..5616a4e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
210 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 210 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
211 { Name = childPartName, UUID = childPartUuid }; 211 { Name = childPartName, UUID = childPartUuid };
212 212
213 SceneObjectGroup sog = new SceneObjectGroup(rootPart); 213 SceneObjectGroup sog = new SceneObjectGroup(rootPart);
214 sog.AddPart(linkPart); 214 sog.AddPart(linkPart);
215 215
216 Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); 216 Assert.That(sog.UUID, Is.EqualTo(rootPartUuid));
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
221 sog.UUID = newRootPartUuid; 221 sog.UUID = newRootPartUuid;
222 222
223 Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); 223 Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid));
224 Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); 224 Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid));
225 Assert.That(sog.Parts.Length, Is.EqualTo(2)); 225 Assert.That(sog.Parts.Length, Is.EqualTo(2));
226 } 226 }
227 } 227 }
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
index e42dbf2..7e1b5ac 100644
--- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
@@ -812,7 +812,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
812 // gets the object data. If the data sent by the client doesn't match the object, the viewer probably has an 812 // gets the object data. If the data sent by the client doesn't match the object, the viewer probably has an
813 // old idea of what the object properties are. Viewer developer Hazim informed us that the base module 813 // old idea of what the object properties are. Viewer developer Hazim informed us that the base module
814 // didn't check the client sent data against the object do any. Since the base modules are the 814 // didn't check the client sent data against the object do any. Since the base modules are the
815 // 'crowning glory' examples of good practice.. 815 // 'crowning glory' examples of good practice..
816 816
817 // Validate that the object exists in the scene the user is in 817 // Validate that the object exists in the scene the user is in
818 SceneObjectPart part = s.GetSceneObjectPart(localID); 818 SceneObjectPart part = s.GetSceneObjectPart(localID);
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index c37c9bd..c91658e 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -188,7 +188,7 @@ namespace OpenSim.Region.Physics.OdePlugin
188 public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, 188 public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size,
189 Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) 189 Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode)
190 { 190 {
191 Name = primName; 191 Name = primName;
192 m_vehicle = new ODEDynamics(); 192 m_vehicle = new ODEDynamics();
193 //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned); 193 //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned);
194 ode = dode; 194 ode = dode;
@@ -620,7 +620,7 @@ namespace OpenSim.Region.Physics.OdePlugin
620 volume *= (1.0f - hollowVolume); 620 volume *= (1.0f - hollowVolume);
621 } 621 }
622 } 622 }
623 break; 623 break;
624 624
625 default: 625 default:
626 break; 626 break;
@@ -658,7 +658,7 @@ namespace OpenSim.Region.Physics.OdePlugin
658 658
659 taperY = _pbs.PathTaperY * 0.01f; 659 taperY = _pbs.PathTaperY * 0.01f;
660 if (taperY < 0.0f) 660 if (taperY < 0.0f)
661 taperY = -taperY; 661 taperY = -taperY;
662 taperY1 = 1.0f - taperY; 662 taperY1 = 1.0f - taperY;
663 663
664 } 664 }
@@ -1059,7 +1059,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1059 } 1059 }
1060 1060
1061 foreach (OdePrim prm in childrenPrim) 1061 foreach (OdePrim prm in childrenPrim)
1062 { 1062 {
1063 prm.m_collisionCategories |= CollisionCategories.Body; 1063 prm.m_collisionCategories |= CollisionCategories.Body;
1064 prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); 1064 prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
1065 1065
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 18f0f24..2652ff2 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -176,7 +176,7 @@ namespace OpenSim.Server.Base
176 OpenSimAppender consoleAppender = null; 176 OpenSimAppender consoleAppender = null;
177 FileAppender fileAppender = null; 177 FileAppender fileAppender = null;
178 178
179 if ( logConfig != null ) 179 if (logConfig != null)
180 { 180 {
181 FileInfo cfg = new FileInfo(logConfig); 181 FileInfo cfg = new FileInfo(logConfig);
182 XmlConfigurator.Configure(cfg); 182 XmlConfigurator.Configure(cfg);
diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
index c951653..31eefb1 100644
--- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
@@ -54,9 +54,10 @@ namespace OpenSim.Server.Handlers.Hypergrid
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 private IGatekeeperService m_GatekeeperService; 55 private IGatekeeperService m_GatekeeperService;
56 56
57 public GatekeeperAgentHandler(IGatekeeperService gatekeeper) 57 public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy)
58 { 58 {
59 m_GatekeeperService = gatekeeper; 59 m_GatekeeperService = gatekeeper;
60 m_Proxy = proxy;
60 } 61 }
61 62
62 protected override bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) 63 protected override bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
index dcb2725..49de8b1 100644
--- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
@@ -51,6 +51,8 @@ namespace OpenSim.Server.Handlers.Hypergrid
51 get { return m_GatekeeperService; } 51 get { return m_GatekeeperService; }
52 } 52 }
53 53
54 bool m_Proxy = false;
55
54 public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, ISimulationService simService) : 56 public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, ISimulationService simService) :
55 base(config, server, String.Empty) 57 base(config, server, String.Empty)
56 { 58 {
@@ -65,11 +67,13 @@ namespace OpenSim.Server.Handlers.Hypergrid
65 if (m_GatekeeperService == null) 67 if (m_GatekeeperService == null)
66 throw new Exception("Gatekeeper server connector cannot proceed because of missing service"); 68 throw new Exception("Gatekeeper server connector cannot proceed because of missing service");
67 69
70 m_Proxy = gridConfig.GetBoolean("HasProxy", false);
71
68 HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService); 72 HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService);
69 server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false); 73 server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false);
70 server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false); 74 server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false);
71 75
72 server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService).Handler); 76 server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService, m_Proxy).Handler);
73 } 77 }
74 78
75 public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server) 79 public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server)
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index d10d6fc..f64a079 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -55,11 +55,13 @@ namespace OpenSim.Server.Handlers.Hypergrid
55 private IUserAgentService m_UserAgentService; 55 private IUserAgentService m_UserAgentService;
56 56
57 private string m_LoginServerIP; 57 private string m_LoginServerIP;
58 private bool m_Proxy = false;
58 59
59 public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP) 60 public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy)
60 { 61 {
61 m_UserAgentService = userAgentService; 62 m_UserAgentService = userAgentService;
62 m_LoginServerIP = loginServerIP; 63 m_LoginServerIP = loginServerIP;
64 m_Proxy = proxy;
63 } 65 }
64 66
65 public Hashtable Handler(Hashtable request) 67 public Hashtable Handler(Hashtable request)
@@ -153,11 +155,11 @@ namespace OpenSim.Server.Handlers.Hypergrid
153 string ip_str = args["client_ip"].ToString(); 155 string ip_str = args["client_ip"].ToString();
154 try 156 try
155 { 157 {
156 string callerIP = Util.GetCallerIP(request); 158 string callerIP = GetCallerIP(request);
157 // Verify if this caller has authority to send the client IP 159 // Verify if this caller has authority to send the client IP
158 if (callerIP == m_LoginServerIP) 160 if (callerIP == m_LoginServerIP)
159 client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0); 161 client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0);
160 else 162 else // leaving this for now, but this warning should be removed
161 m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str); 163 m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str);
162 } 164 }
163 catch 165 catch
@@ -198,6 +200,23 @@ namespace OpenSim.Server.Handlers.Hypergrid
198 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); 200 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp);
199 } 201 }
200 202
203 private string GetCallerIP(Hashtable request)
204 {
205 if (!m_Proxy)
206 return Util.GetCallerIP(request);
207
208 // We're behind a proxy
209 Hashtable headers = (Hashtable)request["headers"];
210 if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null)
211 {
212 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]);
213 if (ep != null)
214 return ep.Address.ToString();
215 }
216
217 // Oops
218 return Util.GetCallerIP(request);
219 }
201 } 220 }
202 221
203} 222}
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index 70157d5..e5f6a5d 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -67,6 +67,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
67 throw new Exception("UserAgent server connector cannot proceed because of missing service"); 67 throw new Exception("UserAgent server connector cannot proceed because of missing service");
68 68
69 string loginServerIP = gridConfig.GetString("LoginServerIP", "127.0.0.1"); 69 string loginServerIP = gridConfig.GetString("LoginServerIP", "127.0.0.1");
70 bool proxy = gridConfig.GetBoolean("HasProxy", false);
70 71
71 server.AddXmlRPCHandler("agent_is_coming_home", AgentIsComingHome, false); 72 server.AddXmlRPCHandler("agent_is_coming_home", AgentIsComingHome, false);
72 server.AddXmlRPCHandler("get_home_region", GetHomeRegion, false); 73 server.AddXmlRPCHandler("get_home_region", GetHomeRegion, false);
@@ -74,7 +75,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
74 server.AddXmlRPCHandler("verify_client", VerifyClient, false); 75 server.AddXmlRPCHandler("verify_client", VerifyClient, false);
75 server.AddXmlRPCHandler("logout_agent", LogoutAgent, false); 76 server.AddXmlRPCHandler("logout_agent", LogoutAgent, false);
76 77
77 server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP).Handler); 78 server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP, proxy).Handler);
78 } 79 }
79 80
80 public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient) 81 public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient)
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
index 30dc65e..48f5f99 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
@@ -88,14 +88,26 @@ namespace OpenSim.Server.Handlers.Login
88 startLocation = requestData["start"].ToString(); 88 startLocation = requestData["start"].ToString();
89 89
90 string clientVersion = "Unknown"; 90 string clientVersion = "Unknown";
91 if (requestData.Contains("version")) 91 if (requestData.Contains("version") && requestData["version"] != null)
92 clientVersion = requestData["version"].ToString(); 92 clientVersion = requestData["version"].ToString();
93 // We should do something interesting with the client version... 93 // We should do something interesting with the client version...
94 94
95 string channel = "Unknown";
96 if (requestData.Contains("channel") && requestData["channel"] != null)
97 channel = requestData["channel"].ToString();
98
99 string mac = "Unknown";
100 if (requestData.Contains("mac") && requestData["mac"] != null)
101 mac = requestData["mac"].ToString();
102
103 string id0 = "Unknown";
104 if (requestData.Contains("id0") && requestData["id0"] != null)
105 id0 = requestData["id0"].ToString();
106
95 //m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); 107 //m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion);
96 108
97 LoginResponse reply = null; 109 LoginResponse reply = null;
98 reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, remoteClient); 110 reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, channel, mac, id0, remoteClient);
99 111
100 XmlRpcResponse response = new XmlRpcResponse(); 112 XmlRpcResponse response = new XmlRpcResponse();
101 response.Value = reply.ToHashtable(); 113 response.Value = reply.ToHashtable();
@@ -166,7 +178,8 @@ namespace OpenSim.Server.Handlers.Login
166 m_log.Info("[LOGIN]: LLSD Login Requested for: '" + map["first"].AsString() + "' '" + map["last"].AsString() + "' / " + startLocation); 178 m_log.Info("[LOGIN]: LLSD Login Requested for: '" + map["first"].AsString() + "' '" + map["last"].AsString() + "' / " + startLocation);
167 179
168 LoginResponse reply = null; 180 LoginResponse reply = null;
169 reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, String.Empty, remoteClient); 181 reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID,
182 map["version"].AsString(), map["channel"].AsString(), map["mac"].AsString(), map["id0"].AsString(), remoteClient);
170 return reply.ToOSDMap(); 183 return reply.ToOSDMap();
171 184
172 } 185 }
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 2997430..1f7e502 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -52,6 +52,8 @@ namespace OpenSim.Server.Handlers.Simulation
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 private ISimulationService m_SimulationService; 53 private ISimulationService m_SimulationService;
54 54
55 protected bool m_Proxy = false;
56
55 public AgentHandler() { } 57 public AgentHandler() { }
56 58
57 public AgentHandler(ISimulationService sim) 59 public AgentHandler(ISimulationService sim)
@@ -179,13 +181,31 @@ namespace OpenSim.Server.Handlers.Simulation
179 resp["reason"] = OSD.FromString(reason); 181 resp["reason"] = OSD.FromString(reason);
180 resp["success"] = OSD.FromBoolean(result); 182 resp["success"] = OSD.FromBoolean(result);
181 // Let's also send out the IP address of the caller back to the caller (HG 1.5) 183 // Let's also send out the IP address of the caller back to the caller (HG 1.5)
182 resp["your_ip"] = OSD.FromString(Util.GetCallerIP(request)); 184 resp["your_ip"] = OSD.FromString(GetCallerIP(request));
183 185
184 // TODO: add reason if not String.Empty? 186 // TODO: add reason if not String.Empty?
185 responsedata["int_response_code"] = HttpStatusCode.OK; 187 responsedata["int_response_code"] = HttpStatusCode.OK;
186 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); 188 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp);
187 } 189 }
188 190
191 private string GetCallerIP(Hashtable request)
192 {
193 if (!m_Proxy)
194 return Util.GetCallerIP(request);
195
196 // We're behind a proxy
197 Hashtable headers = (Hashtable)request["headers"];
198 if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null)
199 {
200 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]);
201 if (ep != null)
202 return ep.Address.ToString();
203 }
204
205 // Oops
206 return Util.GetCallerIP(request);
207 }
208
189 // subclasses can override this 209 // subclasses can override this
190 protected virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) 210 protected virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
191 { 211 {
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 6d3c64a..247dd7e 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -238,8 +238,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
238 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); 238 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
239 args["destination_name"] = OSD.FromString(destination.RegionName); 239 args["destination_name"] = OSD.FromString(destination.RegionName);
240 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 240 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
241 if (ipaddress != null) 241
242 args["client_ip"] = OSD.FromString(ipaddress.Address.ToString()); 242 // 10/3/2010
243 // I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here.
244 // This need cleaning elsewhere...
245 //if (ipaddress != null)
246 // args["client_ip"] = OSD.FromString(ipaddress.Address.ToString());
243 247
244 return args; 248 return args;
245 } 249 }
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index ddd2322..9c150ee 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -147,7 +147,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
147 if (account == null) 147 if (account == null)
148 { 148 {
149 // Store null responses too, to avoid repeated lookups for missing accounts 149 // Store null responses too, to avoid repeated lookups for missing accounts
150 m_accountCache.AddOrUpdate(userID, null, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); 150 m_accountCache.AddOrUpdate(userID, null, CACHE_EXPIRATION_SECONDS);
151 } 151 }
152 152
153 return account; 153 return account;
@@ -225,7 +225,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
225 if (success) 225 if (success)
226 { 226 {
227 // Cache the user account info 227 // Cache the user account info
228 m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); 228 m_accountCache.AddOrUpdate(data.PrincipalID, data, CACHE_EXPIRATION_SECONDS);
229 } 229 }
230 else 230 else
231 { 231 {
@@ -290,7 +290,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
290 GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); 290 GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName);
291 291
292 // Cache the user account info 292 // Cache the user account info
293 m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); 293 m_accountCache.AddOrUpdate(account.PrincipalID, account, CACHE_EXPIRATION_SECONDS);
294 294
295 return account; 295 return account;
296 } 296 }
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 4653b31..d5dda11 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -148,7 +148,6 @@ namespace OpenSim.Services.HypergridService
148 agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random(); 148 agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random();
149 TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); 149 TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
150 150
151 //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
152 bool success = false; 151 bool success = false;
153 string myExternalIP = string.Empty; 152 string myExternalIP = string.Empty;
154 string gridName = gatekeeper.ServerURI; 153 string gridName = gatekeeper.ServerURI;
@@ -200,6 +199,11 @@ namespace OpenSim.Services.HypergridService
200 { 199 {
201 if (m_TravelingAgents.ContainsKey(agentCircuit.SessionID)) 200 if (m_TravelingAgents.ContainsKey(agentCircuit.SessionID))
202 { 201 {
202 // Very important! Override whatever this agent comes with.
203 // UserAgentService always sets the IP for every new agent
204 // with the original IP address.
205 agentCircuit.IPAddress = m_TravelingAgents[agentCircuit.SessionID].ClientIPAddress;
206
203 old = m_TravelingAgents[agentCircuit.SessionID]; 207 old = m_TravelingAgents[agentCircuit.SessionID];
204 } 208 }
205 209
diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs
index 9e57339..ee9b0b1 100644
--- a/OpenSim/Services/Interfaces/ILoginService.cs
+++ b/OpenSim/Services/Interfaces/ILoginService.cs
@@ -47,7 +47,8 @@ namespace OpenSim.Services.Interfaces
47 47
48 public interface ILoginService 48 public interface ILoginService
49 { 49 {
50 LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP); 50 LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID,
51 string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP);
51 Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); 52 Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP);
52 } 53 }
53 54
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index d30c149..127c4b2 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -208,7 +208,8 @@ namespace OpenSim.Services.LLLoginService
208 return response; 208 return response;
209 } 209 }
210 210
211 public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP) 211 public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID,
212 string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP)
212 { 213 {
213 bool success = false; 214 bool success = false;
214 UUID session = UUID.Random(); 215 UUID session = UUID.Random();
@@ -340,7 +341,8 @@ namespace OpenSim.Services.LLLoginService
340 // 341 //
341 string reason = string.Empty; 342 string reason = string.Empty;
342 GridRegion dest; 343 GridRegion dest;
343 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason, out dest); 344 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where,
345 clientVersion, channel, mac, id0, clientIP, out where, out reason, out dest);
344 destination = dest; 346 destination = dest;
345 if (aCircuit == null) 347 if (aCircuit == null)
346 { 348 {
@@ -600,7 +602,8 @@ namespace OpenSim.Services.LLLoginService
600 } 602 }
601 603
602 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, 604 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar,
603 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) 605 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0,
606 IPEndPoint clientIP, out string where, out string reason, out GridRegion dest)
604 { 607 {
605 where = currentWhere; 608 where = currentWhere;
606 ISimulationService simConnector = null; 609 ISimulationService simConnector = null;
@@ -640,7 +643,7 @@ namespace OpenSim.Services.LLLoginService
640 if (m_UserAgentService == null && simConnector != null) 643 if (m_UserAgentService == null && simConnector != null)
641 { 644 {
642 circuitCode = (uint)Util.RandomClass.Next(); ; 645 circuitCode = (uint)Util.RandomClass.Next(); ;
643 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); 646 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
644 success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); 647 success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason);
645 if (!success && m_GridService != null) 648 if (!success && m_GridService != null)
646 { 649 {
@@ -665,7 +668,7 @@ namespace OpenSim.Services.LLLoginService
665 if (m_UserAgentService != null) 668 if (m_UserAgentService != null)
666 { 669 {
667 circuitCode = (uint)Util.RandomClass.Next(); ; 670 circuitCode = (uint)Util.RandomClass.Next(); ;
668 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); 671 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
669 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); 672 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
670 if (!success && m_GridService != null) 673 if (!success && m_GridService != null)
671 { 674 {
@@ -694,7 +697,8 @@ namespace OpenSim.Services.LLLoginService
694 } 697 }
695 698
696 private AgentCircuitData MakeAgent(GridRegion region, UserAccount account, 699 private AgentCircuitData MakeAgent(GridRegion region, UserAccount account,
697 AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, string viewer) 700 AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position,
701 string ipaddress, string viewer, string channel, string mac, string id0)
698 { 702 {
699 AgentCircuitData aCircuit = new AgentCircuitData(); 703 AgentCircuitData aCircuit = new AgentCircuitData();
700 704
@@ -715,7 +719,11 @@ namespace OpenSim.Services.LLLoginService
715 aCircuit.SecureSessionID = secureSession; 719 aCircuit.SecureSessionID = secureSession;
716 aCircuit.SessionID = session; 720 aCircuit.SessionID = session;
717 aCircuit.startpos = position; 721 aCircuit.startpos = position;
722 aCircuit.IPAddress = ipaddress;
718 aCircuit.Viewer = viewer; 723 aCircuit.Viewer = viewer;
724 aCircuit.Channel = channel;
725 aCircuit.Mac = mac;
726 aCircuit.Id0 = id0;
719 SetServiceURLs(aCircuit, account); 727 SetServiceURLs(aCircuit, account);
720 728
721 return aCircuit; 729 return aCircuit;