From b63405c1a796b44b58081857d01f726372467628 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 8 Jan 2010 10:43:34 -0800 Subject: Inching ahead... This compiles, but very likely does not run. --- .../Client/MXP/PacketHandler/MXPPacketServer.cs | 121 +++++---------------- 1 file changed, 28 insertions(+), 93 deletions(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs index 7d71f18..c4b3dda 100644 --- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs +++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs @@ -41,6 +41,7 @@ using OpenSim.Client.MXP.ClientStack; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; using OpenSim.Framework.Communications; +using OpenSim.Services.Interfaces; using System.Security.Cryptography; namespace OpenSim.Client.MXP.PacketHandler @@ -295,13 +296,11 @@ namespace OpenSim.Client.MXP.PacketHandler regionExists = false; } - UserProfileData user = null; UUID userId = UUID.Zero; - string firstName = null; - string lastName = null; + UserAccount account = null; bool authorized = regionExists ? AuthoriseUser(joinRequestMessage.ParticipantName, joinRequestMessage.ParticipantPassphrase, - new UUID(joinRequestMessage.BubbleId), out userId, out firstName, out lastName, out user) + new UUID(joinRequestMessage.BubbleId), out account) : false; if (authorized) @@ -316,10 +315,11 @@ namespace OpenSim.Client.MXP.PacketHandler session.RemoteEndPoint.Port + ")"); m_log.Debug("[MXP ClientStack]: Attaching UserAgent to UserProfile..."); - AttachUserAgentToUserProfile(session, mxpSessionID, sceneId, user); + UUID secureSession = UUID.Zero; + AttachUserAgentToUserProfile(account, session, mxpSessionID, sceneId, out secureSession); m_log.Debug("[MXP ClientStack]: Attached UserAgent to UserProfile."); m_log.Debug("[MXP ClientStack]: Preparing Scene to Connection..."); - if (!PrepareSceneForConnection(mxpSessionID, sceneId, user, out reason)) + if (!PrepareSceneForConnection(mxpSessionID, secureSession, sceneId, account, out reason)) { m_log.DebugFormat("[MXP ClientStack]: Scene refused connection: {0}", reason); DeclineConnection(session, joinRequestMessage); @@ -332,7 +332,7 @@ namespace OpenSim.Client.MXP.PacketHandler m_log.Info("[MXP ClientStack]: Accepted connection."); m_log.Debug("[MXP ClientStack]: Creating ClientView...."); - MXPClientView client = new MXPClientView(session, mxpSessionID, userId, scene, firstName, lastName); + MXPClientView client = new MXPClientView(session, mxpSessionID, userId, scene, account.FirstName, account.LastName); m_clients.Add(client); m_log.Debug("[MXP ClientStack]: Created ClientView."); @@ -489,12 +489,12 @@ namespace OpenSim.Client.MXP.PacketHandler session.SetStateDisconnected(); } - public bool AuthoriseUser(string participantName, string password, UUID sceneId, out UUID userId, out string firstName, out string lastName, out UserProfileData userProfile) + public bool AuthoriseUser(string participantName, string password, UUID sceneId, out UserAccount account) { - userId = UUID.Zero; - firstName = ""; - lastName = ""; - userProfile = null; + UUID userId = UUID.Zero; + string firstName = ""; + string lastName = ""; + account = null; string[] nameParts = participantName.Split(' '); if (nameParts.Length != 2) @@ -505,103 +505,38 @@ namespace OpenSim.Client.MXP.PacketHandler firstName = nameParts[0]; lastName = nameParts[1]; - userProfile = m_scenes[sceneId].CommsManager.UserService.GetUserProfile(firstName, lastName); + account = m_scenes[sceneId].UserAccountService.GetUserAccount(m_scenes[sceneId].RegionInfo.ScopeID, firstName, lastName); + if (account != null) + return (m_scenes[sceneId].AuthenticationService.Authenticate(account.PrincipalID, password, 1) != string.Empty); - if (userProfile == null && !m_accountsAuthenticate) - { - userId = ((UserManagerBase)m_scenes[sceneId].CommsManager.UserService).AddUser(firstName, lastName, "test", "", 1000, 1000); - } - else - { - if (userProfile == null) - { - m_log.Error("[MXP ClientStack]: Login failed as user was not found: " + participantName); - return false; - } - userId = userProfile.ID; - } - - if (m_accountsAuthenticate) - { - if (!password.StartsWith("$1$")) - { - password = "$1$" + Util.Md5Hash(password); - } - password = password.Remove(0, 3); //remove $1$ - string s = Util.Md5Hash(password + ":" + userProfile.PasswordSalt); - return (userProfile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) - || userProfile.PasswordHash.Equals(password, StringComparison.InvariantCulture)); - } - else - { - return true; - } + return false; } - private void AttachUserAgentToUserProfile(Session session, UUID sessionId, UUID sceneId, UserProfileData userProfile) + private void AttachUserAgentToUserProfile(UserAccount account, Session session, UUID sessionId, UUID sceneId, out UUID secureSessionId) { - //Scene scene = m_scenes[sceneId]; - CommunicationsManager commsManager = m_scenes[sceneId].CommsManager; - IUserService userService = (IUserService)commsManager.UserService; - - UserAgentData agent = new UserAgentData(); - - // User connection - agent.AgentOnline = true; - agent.AgentIP = session.RemoteEndPoint.Address.ToString(); - agent.AgentPort = (uint)session.RemoteEndPoint.Port; - - agent.SecureSessionID = UUID.Random(); - agent.SessionID = sessionId; - - // Profile UUID - agent.ProfileID = userProfile.ID; - - // Current location/position/alignment - if (userProfile.CurrentAgent != null) - { - agent.Region = userProfile.CurrentAgent.Region; - agent.Handle = userProfile.CurrentAgent.Handle; - agent.Position = userProfile.CurrentAgent.Position; - agent.LookAt = userProfile.CurrentAgent.LookAt; - } - else - { - agent.Region = userProfile.HomeRegionID; - agent.Handle = userProfile.HomeRegion; - agent.Position = userProfile.HomeLocation; - agent.LookAt = userProfile.HomeLookAt; - } - - // What time did the user login? - agent.LoginTime = Util.UnixTimeSinceEpoch(); - agent.LogoutTime = 0; - - userProfile.CurrentAgent = agent; - - - userService.UpdateUserProfile(userProfile); - //userService.CommitAgent(ref userProfile); + secureSessionId = UUID.Random(); + Scene scene = m_scenes[sceneId]; + scene.PresenceService.LoginAgent(account.PrincipalID.ToString(), sessionId, secureSessionId); } - private bool PrepareSceneForConnection(UUID sessionId, UUID sceneId, UserProfileData userProfile, out string reason) + private bool PrepareSceneForConnection(UUID sessionId, UUID secureSessionId, UUID sceneId, UserAccount account, out string reason) { Scene scene = m_scenes[sceneId]; - CommunicationsManager commsManager = m_scenes[sceneId].CommsManager; - UserManagerBase userService = (UserManagerBase)commsManager.UserService; AgentCircuitData agent = new AgentCircuitData(); - agent.AgentID = userProfile.ID; - agent.firstname = userProfile.FirstName; - agent.lastname = userProfile.SurName; + agent.AgentID = account.PrincipalID; + agent.firstname = account.FirstName; + agent.lastname = account.LastName; agent.SessionID = sessionId; - agent.SecureSessionID = userProfile.CurrentAgent.SecureSessionID; + agent.SecureSessionID = secureSessionId; agent.circuitcode = sessionId.CRC(); agent.BaseFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero; agent.startpos = new Vector3(0, 0, 0); // TODO Fill in region start position agent.CapsPath = "http://localhost/"; - agent.Appearance = userService.GetUserAppearance(userProfile.ID); + AvatarData avatar = scene.AvatarService.GetAvatar(account.PrincipalID); + if (avatar != null) + agent.Appearance = avatar.ToAvatarAppearance(); //userService.GetUserAppearance(userProfile.ID); if (agent.Appearance == null) { -- cgit v1.1 From 3c90d834eac382af5edf091e83aea1ffcce91792 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 10 Jan 2010 22:41:42 +0000 Subject: Remove all references to master avatar, replacing with estate owner where appropriate. This changes the behavior of the REST plugins and RemoteAdmin's region creation process. --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index dbb9611..948a17a 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -427,7 +427,7 @@ namespace OpenSim.Client.MXP.ClientStack pe.ObjectFragment.ObjectIndex = (uint)(m_scene.RegionInfo.RegionSettings.RegionUUID.GetHashCode() + ((long)int.MaxValue) / 2); pe.ObjectFragment.ParentObjectId = UUID.Zero.Guid; pe.ObjectFragment.ObjectName = "Terrain of " + m_scene.RegionInfo.RegionName; - pe.ObjectFragment.OwnerId = m_scene.RegionInfo.MasterAvatarAssignedUUID.Guid; + pe.ObjectFragment.OwnerId = m_scene.RegionInfo.EstateSettings.EstateOwner; pe.ObjectFragment.TypeId = Guid.Empty; pe.ObjectFragment.TypeName = "Terrain"; pe.ObjectFragment.Acceleration = new MsdVector3f(); -- cgit v1.1 From e31131b40fbadbba6e28d2386168ecaf2f9f743a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 15:41:49 -0800 Subject: Some typos fixed related to master avie removal --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 948a17a..a31e0c0 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -427,7 +427,7 @@ namespace OpenSim.Client.MXP.ClientStack pe.ObjectFragment.ObjectIndex = (uint)(m_scene.RegionInfo.RegionSettings.RegionUUID.GetHashCode() + ((long)int.MaxValue) / 2); pe.ObjectFragment.ParentObjectId = UUID.Zero.Guid; pe.ObjectFragment.ObjectName = "Terrain of " + m_scene.RegionInfo.RegionName; - pe.ObjectFragment.OwnerId = m_scene.RegionInfo.EstateSettings.EstateOwner; + pe.ObjectFragment.OwnerId = m_scene.RegionInfo.EstateSettings.EstateOwner.Guid; pe.ObjectFragment.TypeId = Guid.Empty; pe.ObjectFragment.TypeName = "Terrain"; pe.ObjectFragment.Acceleration = new MsdVector3f(); -- cgit v1.1 From 77e43f480154b0a950d9d5f54df5c225fc64e77a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 17:30:05 -0800 Subject: Fixed a couple of bugs with Appearance. Appearance is all good now. --- OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs index c4b3dda..821aea2 100644 --- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs +++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs @@ -536,7 +536,7 @@ namespace OpenSim.Client.MXP.PacketHandler agent.CapsPath = "http://localhost/"; AvatarData avatar = scene.AvatarService.GetAvatar(account.PrincipalID); if (avatar != null) - agent.Appearance = avatar.ToAvatarAppearance(); //userService.GetUserAppearance(userProfile.ID); + agent.Appearance = avatar.ToAvatarAppearance(account.PrincipalID); //userService.GetUserAppearance(userProfile.ID); if (agent.Appearance == null) { -- cgit v1.1 From 5001f61c08fea2ebfcb2590be69073d04d129d70 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 29 Jan 2010 18:59:41 -0800 Subject: * HGGridConnector is no longer necessary. * Handle logout properly. This needed an addition to IClientAPI, because of how the logout packet is currently being handled -- the agent is being removed from the scene before the different event handlers are executed, which is broken. --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 2d80d83..3143b6d 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -160,6 +160,12 @@ namespace OpenSim.Client.MXP.ClientStack } } + public bool IsLoggingOut + { + get { return false ; } + set { } + } + #endregion #region Constructors @@ -1688,15 +1694,15 @@ namespace OpenSim.Client.MXP.ClientStack } public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } -- cgit v1.1 From 9821c4f566e11c75c8d87721777480c5b2e2bd4e Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 14 Feb 2010 15:41:57 -0600 Subject: Revolution is on the roll again! :) Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 94a81f0..d414f08 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -692,6 +692,8 @@ namespace OpenSim.Client.MXP.ClientStack public event UUIDNameRequest OnTeleportHomeRequest; public event ScriptAnswer OnScriptAnswer; public event AgentSit OnUndo; + public event AgentSit OnRedo; + public event LandUndo OnLandUndo; public event ForceReleaseControls OnForceReleaseControls; public event GodLandStatRequest OnLandStatRequest; public event DetailedEstateDataRequest OnDetailedEstateDataRequest; -- cgit v1.1 From 5c5966545d14de43500b95109e8ce81058ebe2c3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 28 Feb 2010 12:07:38 -0800 Subject: Initial Online friends notification seems to be working reliably now. All this needs more testing, but everything is there. --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index fcd16b8..167a40c 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -597,7 +597,7 @@ namespace OpenSim.Client.MXP.ClientStack public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; public event GenericCall2 OnRequestWearables; - public event GenericCall2 OnCompleteMovementToRegion; + public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; @@ -906,7 +906,7 @@ namespace OpenSim.Client.MXP.ClientStack if (OnCompleteMovementToRegion != null) { - OnCompleteMovementToRegion(); + OnCompleteMovementToRegion(this); } // Need to translate to MXP somehow -- cgit v1.1 From 44e7224b86dbcd369ce2569328e3b00fc3b209ab Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 28 Feb 2010 22:47:31 +0000 Subject: Add missing ChangeUserRights packet sender --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 167a40c..b40a09b 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -1706,5 +1706,9 @@ namespace OpenSim.Client.MXP.ClientStack public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) { } + + public void SendChangeUserRights(UUID friendID, int rights) + { + } } } -- cgit v1.1 From 86c621fdc77fadb898cf53578e83746cd8f8711b Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 28 Feb 2010 22:56:31 +0000 Subject: Change the signature of SendChangeUserRights, because we have to send this to both parties --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index b40a09b..cf87a30 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -1707,7 +1707,7 @@ namespace OpenSim.Client.MXP.ClientStack { } - public void SendChangeUserRights(UUID friendID, int rights) + public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) { } } -- cgit v1.1