aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2012-09-26 12:40:41 -0700
committerDiva Canto2012-09-26 12:40:41 -0700
commit3c77b8f463a852aecf3cb29fe4e5f4614f474dbf (patch)
tree9cce23033cbfeb3e08fac879365453874f0d1ae6
parentShow the user's home url too on the console command. (diff)
downloadopensim-SC_OLD-3c77b8f463a852aecf3cb29fe4e5f4614f474dbf.zip
opensim-SC_OLD-3c77b8f463a852aecf3cb29fe4e5f4614f474dbf.tar.gz
opensim-SC_OLD-3c77b8f463a852aecf3cb29fe4e5f4614f474dbf.tar.bz2
opensim-SC_OLD-3c77b8f463a852aecf3cb29fe4e5f4614f474dbf.tar.xz
Use GridUser properly for foreign users.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs6
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs31
-rw-r--r--bin/OpenSim.ini.example3
-rw-r--r--bin/config-include/StandaloneHypergrid.ini1
5 files changed, 35 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index e46dfeb..aa1e127 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -245,6 +245,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
245 { 245 {
246 // Log them out of this grid 246 // Log them out of this grid
247 Scene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId); 247 Scene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
248 string userId = Scene.UserManagementModule.GetUserUUI(sp.UUID);
249 Scene.GridUserService.LoggedOut(userId, UUID.Zero, Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
248 } 250 }
249 } 251 }
250 252
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
index dd8a8ef..221f815 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
@@ -65,11 +65,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
65 65
66 public void OnMakeRootAgent(ScenePresence sp) 66 public void OnMakeRootAgent(ScenePresence sp)
67 { 67 {
68// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName);
69
70 if (sp.PresenceType != PresenceType.Npc) 68 if (sp.PresenceType != PresenceType.Npc)
71 { 69 {
72 string userid = sp.Scene.UserManagementModule.GetUserUUI(sp.UUID); 70 string userid = sp.Scene.UserManagementModule.GetUserUUI(sp.UUID);
71 //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName);
73 m_GridUserService.SetLastPosition( 72 m_GridUserService.SetLastPosition(
74 userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); 73 userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
75 } 74 }
@@ -85,13 +84,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
85 if (client.SceneAgent.IsChildAgent) 84 if (client.SceneAgent.IsChildAgent)
86 return; 85 return;
87 86
88// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
89 string userId = client.AgentId.ToString(); 87 string userId = client.AgentId.ToString();
90 if (client.Scene is Scene) 88 if (client.Scene is Scene)
91 { 89 {
92 Scene s = (Scene)client.Scene; 90 Scene s = (Scene)client.Scene;
93 userId = s.UserManagementModule.GetUserUUI(client.AgentId); 91 userId = s.UserManagementModule.GetUserUUI(client.AgentId);
94 } 92 }
93 //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", userId, client.Scene.RegionInfo.RegionName);
94
95 m_GridUserService.LoggedOut( 95 m_GridUserService.LoggedOut(
96 userId, client.SessionId, client.Scene.RegionInfo.RegionID, 96 userId, client.SessionId, client.Scene.RegionInfo.RegionID,
97 client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); 97 client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat);
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 0f7d7c6..004311f 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -57,6 +57,7 @@ namespace OpenSim.Services.HypergridService
57 private static IUserAccountService m_UserAccountService; 57 private static IUserAccountService m_UserAccountService;
58 private static IUserAgentService m_UserAgentService; 58 private static IUserAgentService m_UserAgentService;
59 private static ISimulationService m_SimulationService; 59 private static ISimulationService m_SimulationService;
60 private static IGridUserService m_GridUserService;
60 61
61 private static string m_AllowedClients = string.Empty; 62 private static string m_AllowedClients = string.Empty;
62 private static string m_DeniedClients = string.Empty; 63 private static string m_DeniedClients = string.Empty;
@@ -84,8 +85,9 @@ namespace OpenSim.Services.HypergridService
84 string gridService = serverConfig.GetString("GridService", String.Empty); 85 string gridService = serverConfig.GetString("GridService", String.Empty);
85 string presenceService = serverConfig.GetString("PresenceService", String.Empty); 86 string presenceService = serverConfig.GetString("PresenceService", String.Empty);
86 string simulationService = serverConfig.GetString("SimulationService", String.Empty); 87 string simulationService = serverConfig.GetString("SimulationService", String.Empty);
88 string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
87 89
88 // These 3 are mandatory, the others aren't 90 // These are mandatory, the others aren't
89 if (gridService == string.Empty || presenceService == string.Empty) 91 if (gridService == string.Empty || presenceService == string.Empty)
90 throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); 92 throw new Exception("Incomplete specifications, Gatekeeper Service cannot function.");
91 93
@@ -105,6 +107,8 @@ namespace OpenSim.Services.HypergridService
105 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); 107 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
106 if (homeUsersService != string.Empty) 108 if (homeUsersService != string.Empty)
107 m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); 109 m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args);
110 if (gridUserService != string.Empty)
111 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
108 112
109 if (simService != null) 113 if (simService != null)
110 m_SimulationService = simService; 114 m_SimulationService = simService;
@@ -295,8 +299,6 @@ namespace OpenSim.Services.HypergridService
295 } 299 }
296 } 300 }
297 301
298 // May want to authorize
299
300 bool isFirstLogin = false; 302 bool isFirstLogin = false;
301 // 303 //
302 // Login the presence, if it's not there yet (by the login service) 304 // Login the presence, if it's not there yet (by the login service)
@@ -305,7 +307,8 @@ namespace OpenSim.Services.HypergridService
305 if (presence != null) // it has been placed there by the login service 307 if (presence != null) // it has been placed there by the login service
306 isFirstLogin = true; 308 isFirstLogin = true;
307 309
308 else 310 else
311 {
309 if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) 312 if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID))
310 { 313 {
311 reason = "Unable to login presence"; 314 reason = "Unable to login presence";
@@ -315,6 +318,26 @@ namespace OpenSim.Services.HypergridService
315 } 318 }
316 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); 319 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok");
317 320
321 // Also login foreigners with GridUser service
322 if (m_GridUserService != null && account == null)
323 {
324 string userId = aCircuit.AgentID.ToString();
325 string first = aCircuit.firstname, last = aCircuit.lastname;
326 if (last.StartsWith("@"))
327 {
328 string[] parts = aCircuit.firstname.Split('.');
329 if (parts.Length >= 2)
330 {
331 first = parts[0];
332 last = parts[1];
333 }
334 }
335
336 userId += ";" + aCircuit.ServiceURLs["HomeURI"] + ";" + first + " " + last;
337 m_GridUserService.LoggedIn(userId);
338 }
339 }
340
318 // 341 //
319 // Get the region 342 // Get the region
320 // 343 //
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 22b39ce..6dbb611 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -970,7 +970,8 @@
970 970
971 ;; This page should have Accept/Decline links somewhere 971 ;; This page should have Accept/Decline links somewhere
972 ;; that affect the GridUsers table. If you don't have such 972 ;; that affect the GridUsers table. If you don't have such
973 ;; script in place, don't use the TOSModule 973 ;; script in place, don't use the TOSModule. The TOSModule appends this URL
974 ;; with a query ?user={userid}&sid={sessionid}
974 ;# {TOS_URL} {} {The URL for the TOS page} {} 975 ;# {TOS_URL} {} {The URL for the TOS page} {}
975 TOS_URL = "http://mygrid.com/tos" 976 TOS_URL = "http://mygrid.com/tos"
976 977
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini
index b0ae351..76d588c 100644
--- a/bin/config-include/StandaloneHypergrid.ini
+++ b/bin/config-include/StandaloneHypergrid.ini
@@ -130,6 +130,7 @@
130 LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService" 130 LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService"
131 ;; for the service 131 ;; for the service
132 UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" 132 UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
133 GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService"
133 UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService" 134 UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService"
134 PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" 135 PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
135 GridService = "OpenSim.Services.GridService.dll:GridService" 136 GridService = "OpenSim.Services.GridService.dll:GridService"