From ffd30b8ac31bc408316079ba86076bf9e984a8be Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 14:46:05 -0700 Subject: Moved RegionName from RegionInfo to SimpleRegionInfo. --- OpenSim/Framework/RegionInfo.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index afd50a9..0dc35a5 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -64,6 +64,13 @@ namespace OpenSim.Framework } protected string m_serverURI; + public string RegionName + { + get { return m_regionName; } + set { m_regionName = value; } + } + protected string m_regionName = String.Empty; + protected bool Allow_Alternate_Ports; public bool m_allow_alternate_ports; protected string m_externalHostName; @@ -284,7 +291,6 @@ namespace OpenSim.Framework public UUID originRegionID = UUID.Zero; public string proxyUrl = ""; public int ProxyOffset = 0; - public string RegionName = String.Empty; public string regionSecret = UUID.Random().ToString(); public string osSecret; -- cgit v1.1 From 882d2c9cc399c4c7d1809702104ce94c9c2c7b17 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 20:25:00 -0700 Subject: Added hg console commands to the module. Added the IN connector module for link-region and corresponding handler to be used in the regions only. No service as such is needed. This will replace the current link-region machinery. Compiles but not tested. --- OpenSim/Framework/RegionInfo.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 0dc35a5..cee1d4b 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -108,6 +108,7 @@ namespace OpenSim.Framework public SimpleRegionInfo(RegionInfo ConvertFrom) { + m_regionName = ConvertFrom.RegionName; m_regionLocX = ConvertFrom.RegionLocX; m_regionLocY = ConvertFrom.RegionLocY; m_internalEndPoint = ConvertFrom.InternalEndPoint; -- cgit v1.1 From 71a4b02c7e9a2587759fd40092d1bdcfef648eff Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 24 Sep 2009 20:56:01 +1000 Subject: * Minor commit, added two new math utility functions. --- OpenSim/Framework/Util.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 58344f3..45b5a10 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -70,6 +70,39 @@ namespace OpenSim.Framework public static readonly Regex UUIDPattern = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); + /// + /// Linear interpolates B<->C using percent A + /// + /// + /// + /// + /// + public static double lerp(double a, double b, double c) + { + return (b*a) + (c*(1 - a)); + } + + /// + /// Bilinear Interpolate, see Lerp but for 2D using 'percents' X & Y. + /// Layout: + /// A B + /// C D + /// A<->C = Y + /// C<->D = X + /// + /// + /// + /// + /// + /// + /// + /// + public static double lerp2D(double x, double y, double a, double b, double c, double d) + { + return lerp(y, lerp(x, a, b), lerp(x, c, d)); + } + + /// /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) /// -- cgit v1.1 From 7870152d23db4cb6f5834d4921fac17feb717220 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Sep 2009 14:54:12 +0100 Subject: Allow load/save iar password checks to be done in grid mode This should allow load/save iar to work for grid mode as long as the grid user service is later than this revision Grid services of earlier revisions will always erroneously report incorrect password. This will be addressed shortly. --- OpenSim/Framework/Communications/IUserService.cs | 16 +++++++++-- .../Communications/Tests/Cache/AssetCacheTests.cs | 5 ++++ .../Framework/Communications/UserManagerBase.cs | 32 +++++++++++++++++++--- 3 files changed, 47 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 725225d..15c5a96 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs @@ -98,7 +98,7 @@ namespace OpenSim.Framework.Communications /// The agent that who's friends list is being updated /// The agent that is getting or loosing permissions /// A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects - void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms); + void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms); /// /// Logs off a user on the user server @@ -137,9 +137,21 @@ namespace OpenSim.Framework.Communications // But since Scenes only have IUserService references, I'm placing it here for now. bool VerifySession(UUID userID, UUID sessionID); + /// + /// Authenticate a user by their password. + /// + /// + /// This is used by callers outside the login process that want to + /// verify a user who has given their password. + /// + /// This should probably also be in IAuthentication but is here for the same reasons as VerifySession() is + /// + /// + /// + /// + bool AuthenticateUserByPassword(UUID userID, string password); // Temporary Hack until we move everything to the new service model void SetInventoryService(IInventoryService invService); - } } diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs index ac0dc6d..a757282 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs @@ -149,6 +149,11 @@ namespace OpenSim.Framework.Communications.Tests { throw new NotImplementedException(); } + + public virtual bool AuthenticateUserByPassword(UUID userID, string password) + { + throw new NotImplementedException(); + } } } } diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 58174a0..1abd733 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -44,7 +44,8 @@ namespace OpenSim.Framework.Communications /// /// Base class for user management (create, read, etc) /// - public abstract class UserManagerBase : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication + public abstract class UserManagerBase + : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -93,9 +94,9 @@ namespace OpenSim.Framework.Communications public void AddPlugin(string provider, string connect) { m_plugins.AddRange(DataPluginFactory.LoadDataPlugins(provider, connect)); - } + } - #region UserProfile + #region UserProfile public virtual void AddTemporaryUserProfile(UserProfileData userProfile) { @@ -891,7 +892,10 @@ namespace OpenSim.Framework.Communications if (userProfile != null && userProfile.CurrentAgent != null) { - m_log.DebugFormat("[USER AUTH]: Verifying session {0} for {1}; current session {2}", sessionID, userID, userProfile.CurrentAgent.SessionID); + m_log.DebugFormat( + "[USER AUTH]: Verifying session {0} for {1}; current session {2}", + sessionID, userID, userProfile.CurrentAgent.SessionID); + if (userProfile.CurrentAgent.SessionID == sessionID) { return true; @@ -901,6 +905,26 @@ namespace OpenSim.Framework.Communications return false; } + public virtual bool AuthenticateUserByPassword(UUID userID, string password) + { +// m_log.DebugFormat("[USER AUTH]: Authenticating user {0} given password {1}", userID, password); + + UserProfileData userProfile = GetUserProfile(userID); + + if (null == userProfile) + return false; + + string md5PasswordHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + userProfile.PasswordSalt); + +// m_log.DebugFormat( +// "[USER AUTH]: Submitted hash {0}, stored hash {1}", md5PasswordHash, userProfile.PasswordHash); + + if (md5PasswordHash == userProfile.PasswordHash) + return true; + else + return false; + } + #endregion } } -- cgit v1.1 From e67341f24c3706be09d2c0c5d2d4ddeba1ddd089 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Sep 2009 15:02:55 +0100 Subject: minor: replace xmlprc 'no method found' magic number with constant from xmlrpc library --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index db87958..01990fa 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -736,8 +736,11 @@ namespace OpenSim.Framework.Servers.HttpServer else { xmlRpcResponse = new XmlRpcResponse(); + // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php - xmlRpcResponse.SetFault(-32601, String.Format("Requested method [{0}] not found", methodName)); + xmlRpcResponse.SetFault( + XmlRpcErrorCodes.SERVER_ERROR_METHOD, + String.Format("Requested method [{0}] not found", methodName)); } responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); @@ -757,6 +760,7 @@ namespace OpenSim.Framework.Servers.HttpServer response.SendChunked = false; response.ContentLength64 = buf.Length; response.ContentEncoding = Encoding.UTF8; + try { response.OutputStream.Write(buf, 0, buf.Length); -- cgit v1.1 From dd3d52ae1faefbca85e2fe8d8cea67f7db4005ac Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 24 Sep 2009 13:33:58 -0700 Subject: Added test GridClient, which allowed me to remove a few bugs out of the new code. --- OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index 0f0c790..ebb2691 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs @@ -56,14 +56,14 @@ namespace OpenSim.Framework.Servers.HttpServer request.ContentType = "text/www-form-urlencoded"; MemoryStream buffer = new MemoryStream(); - + int length = 0; using (StreamWriter writer = new StreamWriter(buffer)) { writer.WriteLine(obj); writer.Flush(); + length = (int)buffer.Length; } - int length = (int) buffer.Length; request.ContentLength = length; Stream requestStream = request.GetRequestStream(); -- cgit v1.1