aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs2
-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/InventoryService/XInventoryService.cs2
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs20
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs26
7 files changed, 62 insertions, 23 deletions
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
index a29ac28..d7cb015 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Services.Connectors.Friends
158 } 158 }
159 catch (Exception e) 159 catch (Exception e)
160 { 160 {
161 m_log.DebugFormat("[FRIENDS CONNECTOR]: Exception when contacting remote sim: {0}", e.Message); 161 m_log.DebugFormat("[FRIENDS CONNECTOR]: Exception when contacting remote sim: {0}", e.ToString());
162 } 162 }
163 163
164 return false; 164 return false;
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/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 4d7103b..974caf0 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -386,7 +386,7 @@ namespace OpenSim.Services.InventoryService
386 XInventoryItem[] items = m_Database.GetActiveGestures(principalID); 386 XInventoryItem[] items = m_Database.GetActiveGestures(principalID);
387 387
388 if (items.Length == 0) 388 if (items.Length == 0)
389 return null; 389 return new List<InventoryItemBase>();
390 390
391 List<InventoryItemBase> ret = new List<InventoryItemBase>(); 391 List<InventoryItemBase> ret = new List<InventoryItemBase>();
392 392
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index d1dcfe7..54d53fb 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -217,12 +217,14 @@ namespace OpenSim.Services.LLLoginService
217 217
218 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, 218 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
219 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, 219 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
220 string where, string startlocation, Vector3 position, Vector3 lookAt, string message, 220 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
221 GridRegion home, IPEndPoint clientIP) 221 GridRegion home, IPEndPoint clientIP)
222 : this() 222 : this()
223 { 223 {
224 FillOutInventoryData(invSkel, libService); 224 FillOutInventoryData(invSkel, libService);
225 225
226 FillOutActiveGestures(gestures);
227
226 CircuitCode = (int)aCircuit.circuitcode; 228 CircuitCode = (int)aCircuit.circuitcode;
227 Lastname = account.LastName; 229 Lastname = account.LastName;
228 Firstname = account.FirstName; 230 Firstname = account.FirstName;
@@ -283,6 +285,22 @@ namespace OpenSim.Services.LLLoginService
283 } 285 }
284 } 286 }
285 287
288 private void FillOutActiveGestures(List<InventoryItemBase> gestures)
289 {
290 ArrayList list = new ArrayList();
291 if (gestures != null)
292 {
293 foreach (InventoryItemBase gesture in gestures)
294 {
295 Hashtable item = new Hashtable();
296 item["item_id"] = gesture.ID.ToString();
297 item["asset_id"] = gesture.AssetID.ToString();
298 list.Add(item);
299 }
300 }
301 ActiveGestures = list;
302 }
303
286 private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) 304 private void FillOutHomeData(GridUserInfo pinfo, GridRegion home)
287 { 305 {
288 int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; 306 int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize;
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 9e24a39..6319cc4 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -272,6 +272,10 @@ namespace OpenSim.Services.LLLoginService
272 return LLFailedLoginResponse.InventoryProblem; 272 return LLFailedLoginResponse.InventoryProblem;
273 } 273 }
274 274
275 // Get active gestures
276 List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(account.PrincipalID);
277 m_log.DebugFormat("[LLOGIN SERVICE]: {0} active gestures", gestures.Count);
278
275 // 279 //
276 // Login the presence 280 // Login the presence
277 // 281 //
@@ -329,7 +333,7 @@ namespace OpenSim.Services.LLLoginService
329 // Instantiate/get the simulation interface and launch an agent at the destination 333 // Instantiate/get the simulation interface and launch an agent at the destination
330 // 334 //
331 string reason = string.Empty; 335 string reason = string.Empty;
332 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason); 336 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason);
333 337
334 if (aCircuit == null) 338 if (aCircuit == null)
335 { 339 {
@@ -350,7 +354,7 @@ namespace OpenSim.Services.LLLoginService
350 // Finally, fill out the response and return it 354 // Finally, fill out the response and return it
351 // 355 //
352 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, 356 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
353 where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP); 357 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP);
354 358
355 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); 359 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
356 return response; 360 return response;
@@ -589,7 +593,7 @@ namespace OpenSim.Services.LLLoginService
589 } 593 }
590 594
591 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, 595 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar,
592 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason) 596 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason)
593 { 597 {
594 where = currentWhere; 598 where = currentWhere;
595 ISimulationService simConnector = null; 599 ISimulationService simConnector = null;
@@ -655,7 +659,7 @@ namespace OpenSim.Services.LLLoginService
655 { 659 {
656 circuitCode = (uint)Util.RandomClass.Next(); ; 660 circuitCode = (uint)Util.RandomClass.Next(); ;
657 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); 661 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer);
658 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason); 662 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
659 if (!success && m_GridService != null) 663 if (!success && m_GridService != null)
660 { 664 {
661 // Try the fallback regions 665 // Try the fallback regions
@@ -664,7 +668,7 @@ namespace OpenSim.Services.LLLoginService
664 { 668 {
665 foreach (GridRegion r in fallbacks) 669 foreach (GridRegion r in fallbacks)
666 { 670 {
667 success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, out reason); 671 success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, clientIP, out reason);
668 if (success) 672 if (success)
669 { 673 {
670 where = "safe"; 674 where = "safe";
@@ -741,10 +745,18 @@ namespace OpenSim.Services.LLLoginService
741 return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); 745 return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason);
742 } 746 }
743 747
744 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) 748 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)
745 { 749 {
746 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); 750 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
747 return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); 751 if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
752 {
753 // We may need to do this at some point,
754 // so leaving it here in comments.
755 //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address);
756 m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString());
757 return true;
758 }
759 return false;
748 } 760 }
749 761
750 #region Console Commands 762 #region Console Commands