From 3c2fb771339193e17e4fdfbd9f3fc93a4b62b8b7 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 25 Sep 2012 18:09:34 -0400 Subject: Format OpenSim.ini.example Make lines fint in 80x24 terminal for easier reading --- bin/OpenSim.ini.example | 100 +++++++++++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 35 deletions(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 3ec4bab..b21a214 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -1,19 +1,23 @@ -;; This is the main configuration file for OpenSimulator. If it's named OpenSim.ini -;; then it will be loaded by OpenSimulator. If it's named OpenSim.ini.example then -;; you will need to copy it to OpenSim.ini first (if that file does not already exist) +;; This is the main configuration file for OpenSimulator. +;; If it's named OpenSim.ini then it will be loaded by OpenSimulator. +;; If it's named OpenSim.ini.example then you will need to copy it to +;; OpenSim.ini first (if that file does not already exist) ;; -;; If you are copying, then once you have copied OpenSim.ini.example to OpenSim.ini you will -;; need to pick an architecture in the [Architecture] section at the end of this file. +;; If you are copying, then once you have copied OpenSim.ini.example to +;; OpenSim.ini you will need to pick an architecture in the [Architecture] +;; section at the end of this file. ;; -;; The settings in this file are in the form " = ". For example, save_crashes = false -;; in the [Startup] section below. +;; The settings in this file are in the form " = ". For example, +;; save_crashes = false in the [Startup] section below. ;; -;; All settings are initially commented out and the default value used, as found in -;; OpenSimDefaults.ini. To change a setting, first uncomment it by deleting the initial semicolon (;) -;; and then change the value. This will override the value in OpenSimDefaults.ini +;; All settings are initially commented out and the default value used, as +;; found in OpenSimDefaults.ini. To change a setting, first uncomment it by +;; deleting the initial semicolon (;) and then change the value. This will +;; override the value in OpenSimDefaults.ini ;; -;; If you want to find out what configuration OpenSimulator has finished with once all the configuration -;; files are loaded then type "config show" on the region console command line. +;; If you want to find out what configuration OpenSimulator has finished with +;; once all the configuration files are loaded then type "config show" on the +;; region console command line. ;; ;; ;; NOTES FOR DEVELOPERS REGARDING THE FORMAT OF THIS FILE @@ -26,13 +30,16 @@ ;; formatted as: ;; {option} {depends on} {question to ask} {choices} default value ;; Any text comments following the declaration, up to the next blank line. -;; will be copied to the generated file (NOTE: generation is not yet implemented) +;; will be copied to the generated file (NOTE: generation is not yet +;; implemented) +;; ;; A * in the choices list will allow an empty entry. ;; An empty question will set the default if the dependencies are ;; satisfied. ;; ;; ; denotes a commented out option. -;; Any options added to OpenSim.ini.example should be initially commented out. +;; Any options added to OpenSim.ini.example should be initially commented +;; out. [Startup] @@ -47,9 +54,12 @@ ;# {save_crashes} {} {Save crashes to disk?} {true false} false ;; Set this to true if you want to log crashes to disk ;; this can be useful when submitting bug reports. - ;; However, this will only log crashes within OpenSimulator that cause the entire program to exit - ;; It will not log crashes caused by virtual machine failures, which includes mono and ODE failures. - ;; You will need to capture these native stack traces by recording the session log itself. + ;; However, this will only log crashes within OpenSimulator that cause the + ;; entire program to exit + ;; It will not log crashes caused by virtual machine failures, which + ;; includes mono and ODE failures. + ;; You will need to capture these native stack traces by recording the + ;; session log itself. ; save_crashes = false ;# {crash_dir} {save_crashes:true} {Directory to save crashes to?} {} crashes @@ -88,35 +98,46 @@ ; allow_regionless = false ;# {NonPhysicalPrimMin} {} {Minimum size of nonphysical prims?} {} 0.001 - ;; Minimum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMin!). + ;; Minimum size for non-physical prims. Affects resizing of existing + ;; prims. This can be overriden in the region config file (as + ;; NonPhysicalPrimMin!). ; NonPhysicalPrimMin = 0.001 ;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256 - ;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMax!). + ;; Maximum size for non-physical prims. Affects resizing of existing + ;; prims. This can be overriden in the region config file (as + ;; NonPhysicalPrimMax!). ; NonPhysicalPrimMax = 256 ;# {PhysicalPrimMin} {} {Minimum size of physical prims?} {} 10 - ;; Maximum size where a prim can be physical. Affects resizing of existing prims. This can be overriden in the region config file. + ;; Maximum size where a prim can be physical. Affects resizing of + ;; existing prims. This can be overriden in the region config file. ; PhysicalPrimMin = 0.01 ;# {PhysicalPrimMax} {} {Maximum size of physical prims?} {} 10 - ;; Maximum size where a prim can be physical. Affects resizing of existing prims. This can be overriden in the region config file. + ;; Maximum size where a prim can be physical. Affects resizing of + ;; existing prims. This can be overriden in the region config file. ; PhysicalPrimMax = 10 ;# {ClampPrimSize} {} {Clamp viewer rezzed prims to max sizes?} {true false} false - ;; If a viewer attempts to rez a prim larger than the non-physical or physical prim max, clamp the dimensions to the appropriate maximum + ;; If a viewer attempts to rez a prim larger than the non-physical or + ;; physical prim max, clamp the dimensions to the appropriate maximum ;; This can be overriden in the region config file. ; ClampPrimSize = false ;# {LinksetPrims} {} {Max prims an object will hold?} {} 0 - ;; Maximum number of prims allowable in a linkset. Affects creating new linksets. Ignored if less than or equal to zero. + ;; Maximum number of prims allowable in a linkset. Affects creating new + ;; linksets. Ignored if less than or equal to zero. ;; This can be overriden in the region config file. ; LinksetPrims = 0 ;# {AllowScriptCrossing} {} {Allow scripts to cross into this region} {true false} true - ;; Allow scripts to keep running when they cross region boundaries, rather than being restarted. State is reloaded on the destination region. - ;; This only applies when crossing to a region running in a different simulator. - ;; For crossings where the regions are on the same simulator the script is always kept running. + ;; Allow scripts to keep running when they cross region boundaries, rather + ;; than being restarted. State is reloaded on the destination region. + ;; This only applies when crossing to a region running in a different + ;; simulator. + ;; For crossings where the regions are on the same simulator the script is + ;; always kept running. ; AllowScriptCrossing = true ;# {TrustBinaries} {AllowScriptCrossing:true} {Accept compiled binary script code? (DANGEROUS!)} {true false} false @@ -186,7 +207,8 @@ ;# {physics} {} {Select physics engine} {OpenDynamicsEngine BulletSim basicphysics POS} OpenDynamicsEngine ;; OpenDynamicsEngine is by some distance the most developed physics engine ;; BulletSim is incomplete and experimental but in active development - ;; basicphysics effectively does not model physics at all, making all objects phantom + ;; basicphysics effectively does not model physics at all, making all + ;; objects phantom ;; Default is OpenDynamicsEngine ; physics = OpenDynamicsEngine ; physics = BulletSim @@ -229,8 +251,9 @@ ;# {simple_build_permissions} {} {Allow building in parcel by access list (no groups)} {true false} false ;; More control over permissions ;; This is definitely not SL! - ;; Provides a simple control for land owners to give build rights to specific avatars - ;; in publicly accessible parcels that disallow object creation in general. + ;; Provides a simple control for land owners to give build rights to + ;; specific avatars in publicly accessible parcels that disallow object + ;; creation in general. ;; Owners specific avatars by adding them to the Access List of the parcel ;; without having to use the Groups feature ; simple_build_permissions = false @@ -266,11 +289,14 @@ ; DrawPrimOnMapTile = true ;# {HttpProxy} {} {Proxy URL for llHTTPRequest and dynamic texture loading} {} http://proxy.com:8080 - ;; Http proxy setting for llHTTPRequest and dynamic texture loading, if required + ;; Http proxy setting for llHTTPRequest and dynamic texture loading, if + ;; required ; HttpProxy = "http://proxy.com:8080" ;# {HttpProxyExceptions} {HttpProxy} {Set of regular expressions defining URL that should not be proxied} {} - ;; If you're using HttpProxy, then you can set HttpProxyExceptions to a list of regular expressions for URLs that you don't want to go through the proxy + ;; If you're using HttpProxy, then you can set HttpProxyExceptions to a + ;; list of regular expressions for URLs that you don't want to go through + ;; the proxy. ;; For example, servers inside your firewall. ;; Separate patterns with a ';' ; HttpProxyExceptions = ".mydomain.com;localhost" @@ -289,13 +315,15 @@ ; SpawnPointRouting = closest ;# {TelehubAllowLandmark} {} {Allow users with landmarks to override telehub routing} {true false} false - ;; TelehubAllowLandmark allows users with landmarks to override telehub routing and land at the landmark coordinates when set to true + ;; TelehubAllowLandmark allows users with landmarks to override telehub + ;; routing and land at the landmark coordinates when set to true ;; default is false ; TelehubAllowLandmark = false ;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {} ;; Bar (|) separated list of viewers which may gain access to the regions. - ;; One can use a substring of the viewer name to enable only certain versions + ;; One can use a substring of the viewer name to enable only certain + ;; versions ;; Example: Agent uses the viewer "Imprudence 1.3.2.0" ;; - "Imprudence" has access ;; - "Imprudence 1.3" has access @@ -304,7 +332,8 @@ ;# {BannedClients} {} {Bar (|) separated list of banned clients} {} ;# Bar (|) separated list of viewers which may not gain access to the regions. - ;; One can use a Substring of the viewer name to disable only certain versions + ;; One can use a Substring of the viewer name to disable only certain + ;; versions ;; Example: Agent uses the viewer "Imprudence 1.3.2.0" ;; - "Imprudence" has no access ;; - "Imprudence 1.3" has no access @@ -450,7 +479,8 @@ [SimulatorFeatures] ;# {MapImageServerURI} {} {URL for the map server} {} - ; Experimental new information sent in SimulatorFeatures cap for Kokua viewers + ; Experimental new information sent in SimulatorFeatures cap for Kokua + ; viewers ; meant to override the MapImage and search server url given at login, and varying ; on a sim-basis. ; Viewers that don't understand it, will ignore it -- cgit v1.1 From 495a3e7daf95c65a1a0e39aaf85c6c66a62424c7 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 25 Sep 2012 19:54:42 -0700 Subject: Oops, that should be inside the curly bracket. --- .../CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index a6698e6..e46dfeb 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -106,7 +106,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return m_ExportedAppearances; } } - #region ISharedRegionModule @@ -149,9 +148,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer base.AddRegion(scene); if (m_Enabled) + { scene.RegisterModuleInterface(this); - - scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; + scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; + } } void OnIncomingSceneObject(SceneObjectGroup so) -- cgit v1.1 From ae58cf42242433c786162b53a2724962f4a8380b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 25 Sep 2012 20:03:49 -0700 Subject: TOS module. WARNING: migration in GridUser table. --- .../Data/MySQL/Resources/GridUserStore.migrations | 8 ++++ .../GridUser/ActivityDetector.cs | 13 +++++- .../GridUser/RemoteGridUserServiceConnector.cs | 46 ++++++++++++++++++++-- OpenSim/Services/Interfaces/IGridUserService.cs | 8 ++++ .../Services/UserAccountService/GridUserService.cs | 2 + bin/OpenSim.ini.example | 28 +++++++++++++ bin/OpenSimDefaults.ini | 4 ++ 7 files changed, 104 insertions(+), 5 deletions(-) diff --git a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations index 32b85ee..440d076 100644 --- a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations +++ b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations @@ -17,3 +17,11 @@ CREATE TABLE `GridUser` ( ) ENGINE=InnoDB; COMMIT; + +:VERSION 2 # -------------------------- + +BEGIN; + +ALTER TABLE `GridUser` ADD COLUMN TOS CHAR(36); + +COMMIT; diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index b0edce7..dd8a8ef 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs @@ -68,8 +68,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); if (sp.PresenceType != PresenceType.Npc) + { + string userid = sp.Scene.UserManagementModule.GetUserUUI(sp.UUID); m_GridUserService.SetLastPosition( - sp.UUID.ToString(), UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + } } public void OnNewClient(IClientAPI client) @@ -83,8 +86,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return; // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); + string userId = client.AgentId.ToString(); + if (client.Scene is Scene) + { + Scene s = (Scene)client.Scene; + userId = s.UserManagementModule.GetUserUUI(client.AgentId); + } m_GridUserService.LoggedOut( - client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, + userId, client.SessionId, client.Scene.RegionInfo.RegionID, client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs index badb552..04acf67 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs @@ -44,6 +44,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private const int KEEPTIME = 30; // 30 secs + private ExpiringCache m_Infos = new ExpiringCache(); + #region ISharedRegionModule private bool m_Enabled = false; @@ -128,23 +131,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) { + if (m_Infos.Contains(userID)) + m_Infos.Remove(userID); + return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); } public bool SetHome(string userID, UUID regionID, Vector3 position, Vector3 lookAt) { - return m_RemoteConnector.SetHome(userID, regionID, position, lookAt); + if (m_RemoteConnector.SetHome(userID, regionID, position, lookAt)) + { + // Update the cache too + GridUserInfo info = null; + if (m_Infos.TryGetValue(userID, out info)) + { + info.HomeRegionID = regionID; + info.HomePosition = position; + info.HomeLookAt = lookAt; + } + return true; + } + + return false; } public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) { - return m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt); + if (m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt)) + { + // Update the cache too + GridUserInfo info = null; + if (m_Infos.TryGetValue(userID, out info)) + { + info.LastRegionID = regionID; + info.LastPosition = position; + info.LastLookAt = lookAt; + } + return true; + } + + return false; } public GridUserInfo GetGridUserInfo(string userID) { - return m_RemoteConnector.GetGridUserInfo(userID); + GridUserInfo info = null; + if (m_Infos.TryGetValue(userID, out info)) + return info; + + info = m_RemoteConnector.GetGridUserInfo(userID); + + m_Infos.AddOrUpdate(userID, info, KEEPTIME); + + return info; } public GridUserInfo[] GetGridUserInfo(string[] userID) diff --git a/OpenSim/Services/Interfaces/IGridUserService.cs b/OpenSim/Services/Interfaces/IGridUserService.cs index 0a52bfa..620ed3a 100644 --- a/OpenSim/Services/Interfaces/IGridUserService.cs +++ b/OpenSim/Services/Interfaces/IGridUserService.cs @@ -50,6 +50,8 @@ namespace OpenSim.Services.Interfaces public DateTime Login; public DateTime Logout; + public string TOS = string.Empty; + public GridUserInfo() {} public GridUserInfo(Dictionary kvp) @@ -78,6 +80,11 @@ namespace OpenSim.Services.Interfaces if (kvp.ContainsKey("Online")) Boolean.TryParse(kvp["Online"].ToString(), out Online); + if (kvp.ContainsKey("TOS")) + TOS = kvp["TOS"].ToString(); + else + TOS = string.Empty; + } public Dictionary ToKeyValuePairs() @@ -97,6 +104,7 @@ namespace OpenSim.Services.Interfaces result["Login"] = Login.ToString(); result["Logout"] = Logout.ToString(); + result["TOS"] = TOS; return result; } diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index ac3d8fd..8eae859 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs @@ -70,6 +70,8 @@ namespace OpenSim.Services.UserAccountService info.Login = Util.ToDateTime(Convert.ToInt32(d.Data["Login"])); info.Logout = Util.ToDateTime(Convert.ToInt32(d.Data["Logout"])); + info.TOS = d.Data["TOS"]; + return info; } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 3ec4bab..a602dcc 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -917,6 +917,34 @@ ;# {InitialTerrain} {} {Initial terrain type} {pinhead-island flat} pinhead-island ; InitialTerrain = "pinhead-island" +[TOSModule] + ;; Terms of Service module. It requires an external web script. Unless you + ;; have that in place, don't enable this module. + + ;# {Enabled} {} {Enable TOS facilities} {true false} false + ; Enabled = false + + ;; Should local users be shown the TOS on first login? + ;# {ShowToLocalUsers} {} {Show TOS to local users} {true false} false + ; ShowToLocalUsers = false + ;; Should foreign users be shown the TOS on first HG login? + ;# {ShowToForeignUsers} {} {Show TOS to foreign users} {true false} true + ; ShowToForeignUsers = true + + ;; Tell the users what this is about + ; Message = "Please read and agree to the Terms of Service" + + ;; How much time do the users have to accept the TOS before they get kicked out? + ;; (in minutes) + ; Timeout = 5 + + ;; This page should have Accept/Decline links somewhere + ;; that affect the GridUsers table. If you don't have such + ;; script in place, don't use the TOSModule + ;# {TOS_URL} {} {The URL for the TOS page} {} + TOS_URL = "http://mygrid.com/tos" + + [Architecture] ;# {Include-Architecture} {} {Choose one of the following architectures} {config-include/Standalone.ini config-include/StandaloneHypergrid.ini config-include/Grid.ini config-include/GridHypergrid.ini config-include/SimianGrid.ini config-include/HyperSimianGrid.ini} config-include/Standalone.ini ;; Uncomment one of the following includes as required. For instance, to create a standalone OpenSim, diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 315ffbe..744187b 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -1624,6 +1624,10 @@ [Terrain] InitialTerrain = "pinhead-island" +[TOSModule] + ;; Enable TOS facilities + Enabled = false + ;; ;; If you are using a simian grid frontend you can enable ;; this module to upload tile images for the mapping fn -- cgit v1.1 From 2f61763923b41c48cea96e76ef691ec63b529a7d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 26 Sep 2012 11:26:51 -0700 Subject: Not really a change, just added a reminder to fix something here. --- .../CoreModules/Framework/UserManagement/HGUserManagementModule.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs index 4eecaa2..acefc97 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs @@ -137,6 +137,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement ud.FirstName = words[0]; ud.LastName = "@" + words[1]; users.Add(ud); + // WARNING! that uriStr is not quite right... it may be missing the / at the end, + // which will cause trouble (duplicate entries on some tables). We should + // get the UUI instead from the UAS. TO BE FIXED. AddUser(userID, names[0], names[1], uriStr); m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} found", words[0], words[1]); } -- cgit v1.1 From 80133f9ebe353fe7c9542533c84a957aa96cf70a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 26 Sep 2012 11:27:31 -0700 Subject: Show the user's home url too on the console command. --- .../CoreModules/Framework/UserManagement/UserManagementModule.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index f4ed67b..36c84c7 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -429,8 +429,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement public void AddUser(UUID uuid, string first, string last, string homeURL) { - // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, first {1}, last {2}, url {3}", uuid, first, last, homeURL); - + //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, first {1}, last {2}, url {3}", uuid, first, last, homeURL); AddUser(uuid, homeURL + ";" + first + " " + last); } @@ -553,8 +552,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement MainConsole.Instance.Output("-----------------------------------------------------------------------------"); foreach (KeyValuePair kvp in m_UserCache) { - MainConsole.Instance.Output(String.Format("{0} {1} {2}", - kvp.Key, kvp.Value.FirstName, kvp.Value.LastName)); + MainConsole.Instance.Output(String.Format("{0} {1} {2} ({3})", + kvp.Key, kvp.Value.FirstName, kvp.Value.LastName, kvp.Value.HomeURL)); } return; -- cgit v1.1 From 3c77b8f463a852aecf3cb29fe4e5f4614f474dbf Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 26 Sep 2012 12:40:41 -0700 Subject: Use GridUser properly for foreign users. --- .../EntityTransfer/HGEntityTransferModule.cs | 2 ++ .../GridUser/ActivityDetector.cs | 6 ++--- .../Services/HypergridService/GatekeeperService.cs | 31 +++++++++++++++++++--- bin/OpenSim.ini.example | 3 ++- bin/config-include/StandaloneHypergrid.ini | 1 + 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 { // Log them out of this grid Scene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId); + string userId = Scene.UserManagementModule.GetUserUUI(sp.UUID); + Scene.GridUserService.LoggedOut(userId, UUID.Zero, Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); } } 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 public void OnMakeRootAgent(ScenePresence sp) { -// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); - if (sp.PresenceType != PresenceType.Npc) { string userid = sp.Scene.UserManagementModule.GetUserUUI(sp.UUID); + //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName); m_GridUserService.SetLastPosition( userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); } @@ -85,13 +84,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser if (client.SceneAgent.IsChildAgent) return; -// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); string userId = client.AgentId.ToString(); if (client.Scene is Scene) { Scene s = (Scene)client.Scene; userId = s.UserManagementModule.GetUserUUI(client.AgentId); } + //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", userId, client.Scene.RegionInfo.RegionName); + m_GridUserService.LoggedOut( userId, client.SessionId, client.Scene.RegionInfo.RegionID, 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 private static IUserAccountService m_UserAccountService; private static IUserAgentService m_UserAgentService; private static ISimulationService m_SimulationService; + private static IGridUserService m_GridUserService; private static string m_AllowedClients = string.Empty; private static string m_DeniedClients = string.Empty; @@ -84,8 +85,9 @@ namespace OpenSim.Services.HypergridService string gridService = serverConfig.GetString("GridService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string simulationService = serverConfig.GetString("SimulationService", String.Empty); + string gridUserService = serverConfig.GetString("GridUserService", String.Empty); - // These 3 are mandatory, the others aren't + // These are mandatory, the others aren't if (gridService == string.Empty || presenceService == string.Empty) throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); @@ -105,6 +107,8 @@ namespace OpenSim.Services.HypergridService m_UserAccountService = ServerUtils.LoadPlugin(accountService, args); if (homeUsersService != string.Empty) m_UserAgentService = ServerUtils.LoadPlugin(homeUsersService, args); + if (gridUserService != string.Empty) + m_GridUserService = ServerUtils.LoadPlugin(gridUserService, args); if (simService != null) m_SimulationService = simService; @@ -295,8 +299,6 @@ namespace OpenSim.Services.HypergridService } } - // May want to authorize - bool isFirstLogin = false; // // Login the presence, if it's not there yet (by the login service) @@ -305,7 +307,8 @@ namespace OpenSim.Services.HypergridService if (presence != null) // it has been placed there by the login service isFirstLogin = true; - else + else + { if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) { reason = "Unable to login presence"; @@ -315,6 +318,26 @@ namespace OpenSim.Services.HypergridService } m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); + // Also login foreigners with GridUser service + if (m_GridUserService != null && account == null) + { + string userId = aCircuit.AgentID.ToString(); + string first = aCircuit.firstname, last = aCircuit.lastname; + if (last.StartsWith("@")) + { + string[] parts = aCircuit.firstname.Split('.'); + if (parts.Length >= 2) + { + first = parts[0]; + last = parts[1]; + } + } + + userId += ";" + aCircuit.ServiceURLs["HomeURI"] + ";" + first + " " + last; + m_GridUserService.LoggedIn(userId); + } + } + // // Get the region // 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 @@ ;; This page should have Accept/Decline links somewhere ;; that affect the GridUsers table. If you don't have such - ;; script in place, don't use the TOSModule + ;; script in place, don't use the TOSModule. The TOSModule appends this URL + ;; with a query ?user={userid}&sid={sessionid} ;# {TOS_URL} {} {The URL for the TOS page} {} TOS_URL = "http://mygrid.com/tos" 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 @@ LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService" ;; for the service UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" + GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" -- cgit v1.1