From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 39 ++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 211 +++++++++++++++------ .../LLLoginService/Properties/AssemblyInfo.cs | 10 +- 3 files changed, 186 insertions(+), 74 deletions(-) (limited to 'OpenSim/Services/LLLoginService') diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index c3756d0..823fd36 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -55,12 +55,13 @@ namespace OpenSim.Services.LLLoginService public static LLFailedLoginResponse InventoryProblem; public static LLFailedLoginResponse DeadRegionProblem; public static LLFailedLoginResponse LoginBlockedProblem; + public static LLFailedLoginResponse UnverifiedAccountProblem; public static LLFailedLoginResponse AlreadyLoggedInProblem; public static LLFailedLoginResponse InternalError; static LLFailedLoginResponse() { - UserProblem = new LLFailedLoginResponse("key", + UserProblem = new LLFailedLoginResponse("key", "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "false"); GridProblem = new LLFailedLoginResponse("key", @@ -75,11 +76,14 @@ namespace OpenSim.Services.LLLoginService LoginBlockedProblem = new LLFailedLoginResponse("presence", "Logins are currently restricted. Please try again later.", "false"); + UnverifiedAccountProblem = new LLFailedLoginResponse("presence", + "Your account has not yet been verified. Please check " + + "your email and click the provided link.", + "false"); AlreadyLoggedInProblem = new LLFailedLoginResponse("presence", "You appear to be already logged in. " + - "If this is not the case please wait for your session to timeout. " + - "If this takes longer than a few minutes please contact the grid owner. " + - "Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.", + "Please wait a a minute or two and retry. " + + "If this takes longer than a few minutes please contact the grid owner. ", "false"); InternalError = new LLFailedLoginResponse("Internal Error", "Error generating Login Response", "false"); } @@ -145,6 +149,7 @@ namespace OpenSim.Services.LLLoginService private UUID agentID; private UUID sessionID; private UUID secureSessionID; + private UUID realID; // Login Flags private string dst; @@ -228,8 +233,9 @@ namespace OpenSim.Services.LLLoginService public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, GridRegion destination, List invSkel, FriendInfo[] friendsList, ILibraryService libService, string where, string startlocation, Vector3 position, Vector3 lookAt, List gestures, string message, - GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency, - string DSTZone, string destinationsURL, string avatarsURL, string classifiedFee, int maxAgentGroups) + + GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency, + string DSTZone, string destinationsURL, string avatarsURL, UUID realID, string classifiedFee,int maxAgentGroups) : this() { FillOutInventoryData(invSkel, libService); @@ -242,6 +248,7 @@ namespace OpenSim.Services.LLLoginService AgentID = account.PrincipalID; SessionID = aCircuit.SessionID; SecureSessionID = aCircuit.SecureSessionID; + RealID = realID; Message = message; BuddList = ConvertFriendListItem(friendsList); StartLocation = where; @@ -299,7 +306,7 @@ namespace OpenSim.Services.LLLoginService { DST = dstTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; } - + break; } } @@ -383,6 +390,7 @@ namespace OpenSim.Services.LLLoginService private void FillOutRegionData(GridRegion destination) { IPEndPoint endPoint = destination.ExternalEndPoint; + if (endPoint == null) return; SimAddress = endPoint.Address.ToString(); SimPort = (uint)endPoint.Port; RegionX = (uint)destination.RegionLocX; @@ -408,7 +416,7 @@ namespace OpenSim.Services.LLLoginService // try // { // // First try to fetch DST from Pacific Standard Time, because this is -// // the one expected by the viewer. "US/Pacific" is the string to search +// // the one expected by the viewer. "US/Pacific" is the string to search // // on linux and mac, and should work also on Windows (to confirm) // gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific"); // } @@ -438,7 +446,7 @@ namespace OpenSim.Services.LLLoginService ErrorReason = "key"; welcomeMessage = "Welcome to OpenSim!"; seedCapability = String.Empty; - home = "{'region_handle':[" + home = "{'region_handle':[" + "r" + Util.RegionToWorldLoc(1000).ToString() + "," + "r" + Util.RegionToWorldLoc(1000).ToString() @@ -473,6 +481,7 @@ namespace OpenSim.Services.LLLoginService SessionID = UUID.Random(); SecureSessionID = UUID.Random(); AgentID = UUID.Random(); + RealID = UUID.Zero; Hashtable InitialOutfitHash = new Hashtable(); InitialOutfitHash["folder_name"] = "Nightclub Female"; @@ -518,6 +527,7 @@ namespace OpenSim.Services.LLLoginService responseData["http_port"] = (Int32)SimHttpPort; responseData["agent_id"] = AgentID.ToString(); + responseData["real_id"] = RealID.ToString(); responseData["session_id"] = SessionID.ToString(); responseData["secure_session_id"] = SecureSessionID.ToString(); responseData["circuit_code"] = CircuitCode; @@ -582,7 +592,7 @@ namespace OpenSim.Services.LLLoginService // responseData["real_currency"] = currency; responseData["currency"] = currency; } - + if (ClassifiedFee != String.Empty) responseData["classified_fee"] = ClassifiedFee; @@ -613,6 +623,7 @@ namespace OpenSim.Services.LLLoginService map["sim_ip"] = OSD.FromString(SimAddress); map["agent_id"] = OSD.FromUUID(AgentID); + map["real_id"] = OSD.FromUUID(RealID); map["session_id"] = OSD.FromUUID(SessionID); map["secure_session_id"] = OSD.FromUUID(SecureSessionID); map["circuit_code"] = OSD.FromInteger(CircuitCode); @@ -924,6 +935,12 @@ namespace OpenSim.Services.LLLoginService set { secureSessionID = value; } } + public UUID RealID + { + get { return realID; } + set { realID = value; } + } + public Int32 CircuitCode { get { return circuitCode; } @@ -1052,7 +1069,7 @@ namespace OpenSim.Services.LLLoginService get { return activeGestures; } set { activeGestures = value; } } - + public string Home { get { return home; } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 0b38738..3ccdc9c 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -40,6 +40,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Console; using OpenSim.Server.Base; +using OpenSim.Services.Connectors.InstantMessage; using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; @@ -77,16 +78,19 @@ namespace OpenSim.Services.LLLoginService protected string m_GatekeeperURL; protected bool m_AllowRemoteSetLoginLevel; protected string m_MapTileURL; + protected string m_ProfileURL; + protected string m_OpenIDURL; protected string m_SearchURL; protected string m_Currency; protected string m_ClassifiedFee; - protected int m_MaxAgentGroups; + protected int m_MaxAgentGroups = 42; protected string m_DestinationGuide; protected string m_AvatarPicker; protected string m_AllowedClients; protected string m_DeniedClients; protected string m_MessageUrl; protected string m_DSTZone; + protected bool m_allowDuplicatePresences = false; IConfig m_LoginServerConfig; // IConfig m_ClientsConfig; @@ -117,6 +121,8 @@ namespace OpenSim.Services.LLLoginService m_GatekeeperURL = Util.GetConfigVarFromSections(config, "GatekeeperURI", new string[] { "Startup", "Hypergrid", "LoginService" }, String.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); + m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty); + m_OpenIDURL = m_LoginServerConfig.GetString("OpenIDServerURL", String.Empty); m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty); m_ClassifiedFee = m_LoginServerConfig.GetString("ClassifiedFee", string.Empty); @@ -127,7 +133,7 @@ namespace OpenSim.Services.LLLoginService m_AllowedClients = Util.GetConfigVarFromSections( config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); m_DeniedClients = Util.GetConfigVarFromSections( - config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); + config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); m_MessageUrl = m_LoginServerConfig.GetString("MessageUrl", string.Empty); m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time"); @@ -136,6 +142,11 @@ namespace OpenSim.Services.LLLoginService if (groupConfig != null) m_MaxAgentGroups = groupConfig.GetInt("MaxAgentGroups", 42); + IConfig presenceConfig = config.Configs["PresenceService"]; + if (presenceConfig != null) + { + m_allowDuplicatePresences = presenceConfig.GetBoolean("AllowDuplicatePresences", m_allowDuplicatePresences); + } // Clean up some of these vars if (m_MapTileURL != String.Empty) @@ -155,7 +166,8 @@ namespace OpenSim.Services.LLLoginService Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin(accountService, args); m_GridUserService = ServerUtils.LoadPlugin(gridUserService, args); - m_AuthenticationService = ServerUtils.LoadPlugin(authService, args); + Object[] authArgs = new Object[] { config, m_UserAccountService }; + m_AuthenticationService = ServerUtils.LoadPlugin(authService, authArgs); m_InventoryService = ServerUtils.LoadPlugin(invService, args); if (gridService != string.Empty) @@ -175,9 +187,14 @@ namespace OpenSim.Services.LLLoginService string hgInvServicePlugin = m_LoginServerConfig.GetString("HGInventoryServicePlugin", String.Empty); if (hgInvServicePlugin != string.Empty) { + // TODO: Remove HGInventoryServiceConstructorArg after 0.9 release string hgInvServiceArg = m_LoginServerConfig.GetString("HGInventoryServiceConstructorArg", String.Empty); - Object[] args2 = new Object[] { config, hgInvServiceArg }; - m_HGInventoryService = ServerUtils.LoadPlugin(hgInvServicePlugin, args2); + if (hgInvServiceArg != String.Empty) + { + m_log.Warn("[LLOGIN SERVICE]: You are using HGInventoryServiceConstructorArg, which is deprecated. See example file for correct syntax."); + hgInvServicePlugin = hgInvServiceArg + "@" + hgInvServicePlugin; + } + m_HGInventoryService = ServerUtils.LoadPlugin(hgInvServicePlugin, args); } // @@ -260,16 +277,20 @@ namespace OpenSim.Services.LLLoginService return response; } - public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, - string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP) + public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient) { bool success = false; UUID session = UUID.Random(); + string processedMessage; - m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", - firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); - + if (clientVersion.Contains("Radegast")) + LibOMVclient = false; + + m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}, Possible LibOMVGridProxy: {8} ", + firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0, LibOMVclient.ToString()); + try { // @@ -345,7 +366,8 @@ namespace OpenSim.Services.LLLoginService if (!passwd.StartsWith("$1$")) passwd = "$1$" + Util.Md5Hash(passwd); passwd = passwd.Remove(0, 3); //remove $1$ - string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30); + UUID realID; + string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30, out realID); UUID secureSession = UUID.Zero; if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) { @@ -355,6 +377,29 @@ namespace OpenSim.Services.LLLoginService return LLFailedLoginResponse.UserProblem; } + if(account.PrincipalID == new UUID("6571e388-6218-4574-87db-f9379718315e")) + { + // really? + return LLFailedLoginResponse.UserProblem; + } + + string PrincipalIDstr = account.PrincipalID.ToString(); + GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(PrincipalIDstr); + + if(!m_allowDuplicatePresences) + { + if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero) + { + if(SendAgentGodKillToRegion(scopeID, account.PrincipalID, guinfo)) + { + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: already logged in", + firstName, lastName); + return LLFailedLoginResponse.AlreadyLoggedInProblem; + } + } + } + // // Get the user's inventory // @@ -391,7 +436,7 @@ namespace OpenSim.Services.LLLoginService // if (m_PresenceService != null) { - success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession); + success = m_PresenceService.LoginAgent(PrincipalIDstr, session, secureSession); if (!success) { @@ -406,7 +451,6 @@ namespace OpenSim.Services.LLLoginService // Change Online status and get the home region // GridRegion home = null; - GridUserInfo guinfo = m_GridUserService.LoggedIn(account.PrincipalID.ToString()); // We are only going to complain about no home if the user actually tries to login there, to avoid // spamming the console. @@ -437,7 +481,7 @@ namespace OpenSim.Services.LLLoginService guinfo = new GridUserInfo(); guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); } - + // // Find the destination region/grid // @@ -479,7 +523,7 @@ namespace OpenSim.Services.LLLoginService // string reason = string.Empty; GridRegion dest; - AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, + AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, channel, mac, id0, clientIP, flags, out where, out reason, out dest); destination = dest; if (aCircuit == null) @@ -489,7 +533,11 @@ namespace OpenSim.Services.LLLoginService return new LLFailedLoginResponse("key", reason, "false"); } - // Get Friends list + + // only now we can assume a login + guinfo = m_GridUserService.LoggedIn(PrincipalIDstr); + + // Get Friends list FriendInfo[] friendsList = new FriendInfo[0]; if (m_FriendsService != null) { @@ -502,8 +550,8 @@ namespace OpenSim.Services.LLLoginService // if (m_MessageUrl != String.Empty) { - WebClient client = new WebClient(); - processedMessage = client.DownloadString(m_MessageUrl); + using(WebClient client = new WebClient()) + processedMessage = client.DownloadString(m_MessageUrl); } else { @@ -512,11 +560,11 @@ namespace OpenSim.Services.LLLoginService processedMessage = processedMessage.Replace("\\n", "\n").Replace("", firstName + " " + lastName); LLLoginResponse response - = new LLLoginResponse( - account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, - where, startLocation, position, lookAt, gestures, processedMessage, home, clientIP, - m_MapTileURL, m_SearchURL, m_Currency, m_DSTZone, - m_DestinationGuide, m_AvatarPicker, m_ClassifiedFee, m_MaxAgentGroups); + = new LLLoginResponse( + account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, + where, startLocation, position, lookAt, gestures, processedMessage, home, clientIP, + m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone, + m_DestinationGuide, m_AvatarPicker, realID, m_ClassifiedFee,m_MaxAgentGroups); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); @@ -572,12 +620,13 @@ namespace OpenSim.Services.LLLoginService lookAt = pinfo.HomeLookAt; flags |= TeleportFlags.ViaHome; } - + if (tryDefaults) { List defaults = m_GridService.GetDefaultRegions(scopeID); if (defaults != null && defaults.Count > 0) { + flags |= TeleportFlags.ViaRegionID; region = defaults[0]; where = "safe"; } @@ -587,7 +636,10 @@ namespace OpenSim.Services.LLLoginService account.FirstName, account.LastName); region = FindAlternativeRegion(scopeID); if (region != null) + { + flags |= TeleportFlags.ViaRegionID; where = "safe"; + } } } @@ -608,6 +660,7 @@ namespace OpenSim.Services.LLLoginService List defaults = m_GridService.GetDefaultRegions(scopeID); if (defaults != null && defaults.Count > 0) { + flags |= TeleportFlags.ViaRegionID; region = defaults[0]; where = "safe"; } @@ -616,7 +669,10 @@ namespace OpenSim.Services.LLLoginService m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region"); region = FindAlternativeRegion(scopeID); if (region != null) + { + flags |= TeleportFlags.ViaRegionID; where = "safe"; + } } } @@ -625,7 +681,7 @@ namespace OpenSim.Services.LLLoginService position = pinfo.LastPosition; lookAt = pinfo.LastLookAt; } - + return region; } else @@ -661,7 +717,7 @@ namespace OpenSim.Services.LLLoginService regions = m_GridService.GetDefaultRegions(scopeID); if (regions != null && regions.Count > 0) { - where = "safe"; + where = "safe"; return regions[0]; } else @@ -696,7 +752,7 @@ namespace OpenSim.Services.LLLoginService return null; } // Valid specification of a remote grid - + regionName = parts[0]; string domainLocator = parts[1]; parts = domainLocator.Split(new char[] {':'}); @@ -714,7 +770,7 @@ namespace OpenSim.Services.LLLoginService List defaults = m_GridService.GetDefaultRegions(scopeID); if (defaults != null && defaults.Count > 0) { - where = "safe"; + where = "safe"; return defaults[0]; } else @@ -767,12 +823,15 @@ namespace OpenSim.Services.LLLoginService ulong handle; string imageURL = string.Empty, reason = string.Empty; string message; - if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason)) + int sizeX = (int)Constants.RegionSize; + int sizeY = (int)Constants.RegionSize; + + if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason, out sizeX, out sizeY)) { string homeURI = null; if (account.ServiceURLs != null && account.ServiceURLs.ContainsKey("HomeURI")) homeURI = (string)account.ServiceURLs["HomeURI"]; - + GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID, account.PrincipalID, homeURI, out message); return destination; } @@ -806,6 +865,9 @@ namespace OpenSim.Services.LLLoginService reason = string.Empty; uint circuitCode = 0; AgentCircuitData aCircuit = null; + dest = null; + + bool success = false; if (m_UserAgentService == null) { @@ -816,28 +878,14 @@ namespace OpenSim.Services.LLLoginService simConnector = m_LocalSimulationService; else if (m_RemoteSimulationService != null) simConnector = m_RemoteSimulationService; - } - else // User Agent Service is on - { - if (gatekeeper == null) // login to local grid - { - if (hostName == string.Empty) - SetHostAndPort(m_GatekeeperURL); - - gatekeeper = new GridRegion(destination); - gatekeeper.ExternalHostName = hostName; - gatekeeper.HttpPort = (uint)port; - gatekeeper.ServerURI = m_GatekeeperURL; - } - m_log.Debug("[LLLOGIN SERVICE]: no gatekeeper detected..... using " + m_GatekeeperURL); - } - bool success = false; + if(simConnector == null) + return null; - if (m_UserAgentService == null && simConnector != null) - { circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, + clientIP.Address.ToString(), viewer, channel, mac, id0); + success = LaunchAgentDirectly(simConnector, destination, aCircuit, flags, out reason); if (!success && m_GridService != null) { @@ -859,10 +907,22 @@ namespace OpenSim.Services.LLLoginService } } - if (m_UserAgentService != null) + else { + if (gatekeeper == null) // login to local grid + { + if (hostName == string.Empty) + SetHostAndPort(m_GatekeeperURL); + + gatekeeper = new GridRegion(destination); + gatekeeper.ExternalHostName = hostName; + gatekeeper.HttpPort = (uint)port; + gatekeeper.ServerURI = m_GatekeeperURL; + } circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, + clientIP.Address.ToString(), viewer, channel, mac, id0); + aCircuit.teleportFlags |= (uint)flags; success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); if (!success && m_GridService != null) @@ -891,8 +951,8 @@ namespace OpenSim.Services.LLLoginService return null; } - private AgentCircuitData MakeAgent(GridRegion region, UserAccount account, - AvatarAppearance avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, + private AgentCircuitData MakeAgent(GridRegion region, UserAccount account, + AvatarAppearance avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, string ipaddress, string viewer, string channel, string mac, string id0) { AgentCircuitData aCircuit = new AgentCircuitData(); @@ -930,7 +990,7 @@ namespace OpenSim.Services.LLLoginService if (account.ServiceURLs == null) return; - // Old style: get the service keys from the DB + // Old style: get the service keys from the DB foreach (KeyValuePair kvp in account.ServiceURLs) { if (kvp.Value != null) @@ -989,7 +1049,7 @@ namespace OpenSim.Services.LLLoginService region, aCircuit.AgentID, null, true, aCircuit.startpos, new List(), ctx, out reason)) return false; - return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); + return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, ctx, out reason); } private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) @@ -1027,7 +1087,7 @@ namespace OpenSim.Services.LLLoginService switch (subcommand) { case "level": - // Set the minimum level to allow login + // Set the minimum level to allow login // Useful to allow grid update without worrying about users. // or fixing critical issues // @@ -1040,8 +1100,8 @@ namespace OpenSim.Services.LLLoginService } break; - case "reset": - m_MinLoginLevel = 0; + case "reset": + m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); MainConsole.Instance.OutputFormat("Reset min login level to {0}", m_MinLoginLevel); break; @@ -1054,6 +1114,41 @@ namespace OpenSim.Services.LLLoginService break; } } + + private bool SendAgentGodKillToRegion(UUID scopeID, UUID agentID , GridUserInfo guinfo) + { + UUID regionID = guinfo.LastRegionID; + GridRegion regInfo = m_GridService.GetRegionByUUID(scopeID, regionID); + if(regInfo == null) + return false; + + string regURL = regInfo.ServerURI; + if(String.IsNullOrEmpty(regURL)) + return false; + + UUID guuid = new UUID("6571e388-6218-4574-87db-f9379718315e"); + + GridInstantMessage msg = new GridInstantMessage(); + msg.imSessionID = UUID.Zero.Guid; + msg.fromAgentID = guuid.Guid; + msg.toAgentID = agentID.Guid; + msg.timestamp = (uint)Util.UnixTimeSinceEpoch(); + msg.fromAgentName = "GRID"; + msg.message = string.Format("New login detected"); + msg.dialog = 250; // God kick + msg.fromGroup = false; + msg.offline = (byte)0; + msg.ParentEstateID = 0; + msg.Position = Vector3.Zero; + msg.RegionID = scopeID.Guid; + msg.binaryBucket = new byte[1] {0}; + InstantMessageServiceConnector.SendInstantMessage(regURL,msg); + + m_GridUserService.LoggedOut(agentID.ToString(), + UUID.Zero, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); + + return true; + } } #endregion diff --git a/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs index 5c150e3..005ddd8 100644 --- a/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs +++ b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Services.LLLoginService")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,9 +25,9 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -[assembly: AssemblyVersion("0.8.3.*")] +[assembly: AssemblyVersion(OpenSim.VersionInfo.AssemblyVersionNumber)] -- cgit v1.1