From 4dd9cf1ce4fe208d3e4474778e3c9a6102755d8c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 12 Jun 2010 02:44:01 +0100 Subject: Change flavor to 0.7-RC1 --- OpenSim/Framework/Servers/VersionInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 90b5f57..c27bc9a 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -30,7 +30,7 @@ namespace OpenSim public class VersionInfo { private const string VERSION_NUMBER = "0.7"; - private const Flavour VERSION_FLAVOUR = Flavour.Dev; + private const Flavour VERSION_FLAVOUR = Flavour.RC1; public enum Flavour { @@ -71,4 +71,4 @@ namespace OpenSim /// public readonly static int MajorInterfaceVersion = 6; } -} \ No newline at end of file +} -- cgit v1.1 From 66619b599654397fb09da0f40d3d7e69dafcfb41 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 12 Jun 2010 12:08:45 -0700 Subject: Added checks for failed UpdateAgent calls. --- .../EntityTransfer/EntityTransferModule.cs | 46 ++++++++++++++-------- OpenSim/Region/Framework/Scenes/Scene.cs | 2 + 2 files changed, 31 insertions(+), 17 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index a33f5c5..5d50a83 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -396,7 +396,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.Position = position; SetCallbackURL(agent, sp.Scene.RegionInfo); - UpdateAgent(reg, finalDestination, agent); + if (!UpdateAgent(reg, finalDestination, agent)) + { + // Region doesn't take it + Fail(sp, finalDestination); + return; + } m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); @@ -421,21 +426,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // that the client contacted the destination before we send the attachments and close things here. if (!WaitForCallback(sp.UUID)) { - // Client never contacted destination. Let's restore everything back - sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); - - // Fail. Reset it back - sp.IsChildAgent = false; - - ResetFromTransit(sp.UUID); - - // Yikes! We should just have a ref to scene here. - //sp.Scene.InformClientOfNeighbours(sp); - EnableChildAgents(sp); - - // Finally, kill the agent we just created at the destination. - m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID); - + Fail(sp, finalDestination); return; } @@ -475,6 +466,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } } + private void Fail(ScenePresence sp, GridRegion finalDestination) + { + // Client never contacted destination. Let's restore everything back + sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); + + // Fail. Reset it back + sp.IsChildAgent = false; + + ResetFromTransit(sp.UUID); + + EnableChildAgents(sp); + + // Finally, kill the agent we just created at the destination. + m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID); + + } protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) { @@ -813,7 +820,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; - m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent); + if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) + { + // region doesn't take it + ResetFromTransit(agent.UUID); + return agent; + } // Next, let's close the child agent connections that are too far away. agent.CloseChildAgents(neighbourx, neighboury); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2b2c04a..bcfb4c9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3903,6 +3903,8 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat( "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); + // XPTO: if this agent is not allowed here as root, always return false + // We have to wait until the viewer contacts this region after receiving EAC. // That calls AddNewClient, which finally creates the ScenePresence ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); -- cgit v1.1 From 14c587bea1e0acfca0ba1842c5a1fa10bdf45548 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 13 Jun 2010 21:45:39 +0100 Subject: Thank you, Snoopy2, for a patch to fix RemoteAdmin. Committed with the following changes: - Start location is NOT optional. The signature was defined with it being mandataory and there is no reason to change it - Adjusted comments to remove misleading or no longer true comments. Default is neuter, according to the code, not male, as the comment stated. --- .../RemoteController/RemoteAdminPlugin.cs | 949 +++++++++++++-------- .../SimianUserAccountServiceConnector.cs | 2 +- .../UserAccountService/UserAccountService.cs | 24 +- 3 files changed, 624 insertions(+), 351 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 7ebb5de..b248d11 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -998,35 +998,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController string firstname = (string) requestData["user_firstname"]; string lastname = (string) requestData["user_lastname"]; string passwd = (string) requestData["user_password"]; - uint regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); - uint regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); + + regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); + regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); string email = ""; // empty string for email if (requestData.Contains("user_email")) email = (string)requestData["user_email"]; - UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; - - UserAccount account = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, firstname, lastname); - - if (null != account) - throw new Exception(String.Format("Account {0} {1} already exists", firstname, lastname)); + Scene scene = m_app.SceneManager.CurrentOrFirstScene; + UUID scopeID = scene.RegionInfo.ScopeID; - account = new UserAccount(scopeID, firstname, lastname, email); + UserAccount account = CreateUser(scopeID, firstname, lastname, passwd, email); - bool success = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.StoreUserAccount(account); - - if (!success) + if (null == account) throw new Exception(String.Format("failed to create new user {0} {1}", firstname, lastname)); - // Store the password - m_app.SceneManager.CurrentOrFirstScene.AuthenticationService.SetPassword(account.PrincipalID, passwd); + // Set home position - GridRegion home = m_app.SceneManager.CurrentOrFirstScene.GridService.GetRegionByPosition(scopeID, + GridRegion home = scene.GridService.GetRegionByPosition(scopeID, (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); - if (home == null) + if (null == home) { m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstname, lastname); + } else { + scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); + m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstname, lastname); + } // Establish the avatar's initial appearance @@ -1169,9 +1167,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// start_region_y /// avatar's start region coordinates, Y /// value (changeable) - /// about_real_world + /// about_real_world (not implemented yet) /// "about" text of avatar owner (changeable) - /// about_virtual_world + /// about_virtual_world (not implemented yet) /// "about" text of avatar (changeable) /// /// @@ -1182,6 +1180,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// true or false /// error /// error message if success is false + /// avatar_uuid + /// UUID of the updated avatar + /// account; UUID.Zero if failed. + /// /// /// @@ -1189,31 +1191,34 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: UpdateUserAccount: new request"); m_log.Warn("[RADMIN]: This method needs update for 0.7"); + + FailIfRemoteAdminDisabled("UpdateUserAccount"); + XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - //lock (rslock) - //{ - // try - // { - // Hashtable requestData = (Hashtable) request.Params[0]; + lock (rslock) + { + try + { + Hashtable requestData = (Hashtable) request.Params[0]; - // // check completeness - // checkStringParameters(request, new string[] { - // "password", "user_firstname", - // "user_lastname"}); + // check completeness + checkStringParameters(request, new string[] { + "password", "user_firstname", + "user_lastname"}); - // // check password - // if (!String.IsNullOrEmpty(m_requiredPassword) && - // (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); + // check password + if (!String.IsNullOrEmpty(m_requiredPassword) && + (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); - // // do the job - // string firstname = (string) requestData["user_firstname"]; - // string lastname = (string) requestData["user_lastname"]; + // do the job + string firstname = (string) requestData["user_firstname"]; + string lastname = (string) requestData["user_lastname"]; - // string passwd = String.Empty; - // uint? regX = null; - // uint? regY = null; + string passwd = String.Empty; + uint? regX = null; + uint? regY = null; // uint? ulaX = null; // uint? ulaY = null; // uint? ulaZ = null; @@ -1223,11 +1228,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController // string aboutFirstLive = String.Empty; // string aboutAvatar = String.Empty; - // if (requestData.ContainsKey("user_password")) passwd = (string) requestData["user_password"]; - // if (requestData.ContainsKey("start_region_x")) - // regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); - // if (requestData.ContainsKey("start_region_y")) - // regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); + if (requestData.ContainsKey("user_password")) passwd = (string) requestData["user_password"]; + if (requestData.ContainsKey("start_region_x")) + regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); + if (requestData.ContainsKey("start_region_y")) + regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); // if (requestData.ContainsKey("start_lookat_x")) // ulaX = Convert.ToUInt32((Int32) requestData["start_lookat_x"]); @@ -1247,21 +1252,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController // if (requestData.ContainsKey("about_virtual_world")) // aboutAvatar = (string)requestData["about_virtual_world"]; - // UserProfileData userProfile - // = m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname); - - // if (null == userProfile) - // throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname)); + Scene scene = m_app.SceneManager.CurrentOrFirstScene; + UUID scopeID = scene.RegionInfo.ScopeID; + UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, firstname, lastname); - // if (!String.IsNullOrEmpty(passwd)) - // { - // m_log.DebugFormat("[RADMIN]: UpdateUserAccount: updating password for avatar {0} {1}", firstname, lastname); - // string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(passwd) + ":" + String.Empty); - // userProfile.PasswordHash = md5PasswdHash; - // } + if (null == account) + throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname)); - // if (null != regX) userProfile.HomeRegionX = (uint) regX; - // if (null != regY) userProfile.HomeRegionY = (uint) regY; + if (!String.IsNullOrEmpty(passwd)) + { + m_log.DebugFormat("[RADMIN]: UpdateUserAccount: updating password for avatar {0} {1}", firstname, lastname); + ChangeUserPassword(firstname, lastname, passwd); + } // if (null != usaX) userProfile.HomeLocationX = (uint) usaX; // if (null != usaY) userProfile.HomeLocationY = (uint) usaY; @@ -1274,35 +1276,48 @@ namespace OpenSim.ApplicationPlugins.RemoteController // if (String.Empty != aboutFirstLive) userProfile.FirstLifeAboutText = aboutFirstLive; // if (String.Empty != aboutAvatar) userProfile.AboutText = aboutAvatar; - // // User has been created. Now establish gender and appearance. + // Set home position - // updateUserAppearance(responseData, requestData, userProfile.ID); + if ((null != regX) && (null != regY)) + { + GridRegion home = scene.GridService.GetRegionByPosition(scopeID, + (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); + if (null == home) { + m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstname, lastname); + } else { + scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); + m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstname, lastname); + } + } - // if (!m_app.CommunicationsManager.UserService.UpdateUserProfile(userProfile)) - // throw new Exception("did not manage to update user profile"); + // User has been created. Now establish gender and appearance. - // responseData["success"] = true; + updateUserAppearance(responseData, requestData, account.PrincipalID); - // response.Value = responseData; + responseData["success"] = true; + responseData["avatar_uuid"] = account.PrincipalID.ToString(); - // m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", - // firstname, lastname, - // userProfile.ID); - // } - // catch (Exception e) - // { - // m_log.ErrorFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.Message); - // m_log.DebugFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.ToString()); + response.Value = responseData; - // responseData["success"] = false; - // responseData["error"] = e.Message; + m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", + firstname, lastname, + account.PrincipalID); + } + catch (Exception e) + { - // response.Value = responseData; - // } - //} + m_log.ErrorFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.Message); + m_log.DebugFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.ToString()); - m_log.Info("[RADMIN]: UpdateUserAccount: request complete"); - return response; + responseData["success"] = false; + responseData["avatar_uuid"] = UUID.Zero.ToString(); + responseData["error"] = e.Message; + + response.Value = responseData; + } + m_log.Info("[RADMIN]: UpdateUserAccount: request complete"); + return response; + } } /// @@ -1316,73 +1331,74 @@ namespace OpenSim.ApplicationPlugins.RemoteController private void updateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) { m_log.DebugFormat("[RADMIN] updateUserAppearance"); - m_log.Warn("[RADMIN]: This method needs update for 0.7"); - //string dmale = m_config.GetString("default_male", "Default Male"); - //string dfemale = m_config.GetString("default_female", "Default Female"); - //string dneut = m_config.GetString("default_female", "Default Default"); + string dmale = m_config.GetString("default_male", "Default Male"); + string dfemale = m_config.GetString("default_female", "Default Female"); + string dneut = m_config.GetString("default_female", "Default Default"); string model = String.Empty; - //// Has a gender preference been supplied? - - //if (requestData.Contains("gender")) - //{ - // switch ((string)requestData["gender"]) - // { - // case "m" : - // model = dmale; - // break; - // case "f" : - // model = dfemale; - // break; - // case "n" : - // default : - // model = dneut; - // break; - // } - //} - - //// Has an explicit model been specified? - - //if (requestData.Contains("model")) - //{ - // model = (string)requestData["model"]; - //} - - //// No appearance attributes were set - - //if (model == String.Empty) - //{ - // m_log.DebugFormat("[RADMIN] Appearance update not requested"); - // return; - //} - - //m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model {1}", userid, model); - - //string[] nomens = model.Split(); - //if (nomens.Length != 2) - //{ - // m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Invalid model name : <{1}>", userid, model); - // // nomens = dmodel.Split(); - // return; - //} - - //UserProfileData mprof = m_app.CommunicationsManager.UserService.GetUserProfile(nomens[0], nomens[1]); - - //// Is this the first time one of the default models has been used? Create it if that is the case - //// otherwise default to male. - - //if (mprof == null) - //{ - // m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); - // return; - //} - - //// Set current user's appearance. This bit is easy. The appearance structure is populated with - //// actual asset ids, however to complete the magic we need to populate the inventory with the - //// assets in question. - - //establishAppearance(userid, mprof.ID); + // Has a gender preference been supplied? + + if (requestData.Contains("gender")) + { + switch ((string)requestData["gender"]) + { + case "m" : + case "male" : + model = dmale; + break; + case "f" : + case "female" : + model = dfemale; + break; + case "n" : + case "neutral" : + default : + model = dneut; + break; + } + } + + // Has an explicit model been specified? + + if (requestData.Contains("model") && (String.IsNullOrEmpty((string)requestData["gender"]))) + { + model = (string)requestData["model"]; + } + + // No appearance attributes were set + + if (String.IsNullOrEmpty(model)) + { + m_log.DebugFormat("[RADMIN] Appearance update not requested"); + return; + } + + m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model <{1}>", userid, model); + + string[] nomens = model.Split(); + if (nomens.Length != 2) + { + m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Invalid model name : <{1}>", userid, model); + // nomens = dmodel.Split(); + return; + } + + Scene scene = m_app.SceneManager.CurrentOrFirstScene; + UUID scopeID = scene.RegionInfo.ScopeID; + UserAccount mprof = scene.UserAccountService.GetUserAccount(scopeID, nomens[0], nomens[1]); + + if (mprof == null) + { + m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); + return; + } + + // Set current user's appearance. This bit is easy. The appearance structure is populated with + // actual asset ids, however to complete the magic we need to populate the inventory with the + // assets in question. + + establishAppearance(userid, mprof.PrincipalID); m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", userid, model); @@ -1397,116 +1413,312 @@ namespace OpenSim.ApplicationPlugins.RemoteController private void establishAppearance(UUID dest, UUID srca) { m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca); + Scene scene = m_app.SceneManager.CurrentOrFirstScene; AvatarAppearance ava = null; - AvatarData avatar = m_app.SceneManager.CurrentOrFirstScene.AvatarService.GetAvatar(srca); + AvatarData avatar = scene.AvatarService.GetAvatar(srca); if (avatar != null) ava = avatar.ToAvatarAppearance(srca); // If the model has no associated appearance we're done. - - // if (ava == null) - // { - // return new AvatarAppearance(); - // } - if (ava == null) return; - UICallback sic = new UICallback(); - UICallback dic = new UICallback(); - IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; + // Simple appearance copy or copy Clothing and Bodyparts folders? + bool copyFolders = m_config.GetBoolean("copy_folders", false); + + if (!copyFolders) + { + // Simple copy of wearables and appearance update + try + { + copyWearablesAndAttachments(dest, srca, ava); + AvatarData adata = new AvatarData(ava); + scene.AvatarService.SetAvatar(dest, adata); + } + catch (Exception e) + { + m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", + dest, e.Message); + } + + return; + } + + // Copy Clothing and Bodypart folders and appearance update try { Dictionary imap = new Dictionary(); + copyInventoryFolders(dest, srca, AssetType.Clothing, imap, ava); + copyInventoryFolders(dest, srca, AssetType.Bodypart, imap, ava); - iserv.GetUserInventory(dest, dic.callback); - iserv.GetUserInventory(srca, sic.callback); - - dic.GetInventory(); - sic.GetInventory(); + AvatarWearable[] wearables = ava.Wearables; - if (sic.OK && dic.OK) + for (int i=0; i + /// This method is called by establishAppearance to do a copy all inventory items + /// worn or attached to the Clothing inventory folder of the receiving avatar. + /// In parallel the avatar wearables and attachments are updated. + /// + + private void copyWearablesAndAttachments(UUID dest, UUID srca, AvatarAppearance ava) + { + IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; - foreach (InventoryFolderImpl folder in sic.folders) + // Get Clothing folder of receiver + InventoryFolderBase dstf = iserv.GetFolderForType(dest, AssetType.Clothing); + + if (dstf == null) + throw new Exception("Cannot locate folder(s)"); + + // Missing destination folder? This should *never* be the case + if (dstf.Type != (short)AssetType.Clothing) + { + dstf = new InventoryFolderBase(); + dstf.ID = UUID.Random(); + dstf.Name = "Clothing"; + dstf.Owner = dest; + dstf.Type = (short)AssetType.Clothing; + dstf.ParentID = iserv.GetRootFolder(dest).ID; + dstf.Version = 1; + iserv.AddFolder(dstf); // store base record + m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", srca); + } + + // Wearables + AvatarWearable[] wearables = ava.Wearables; + AvatarWearable wearable; + + for (int i=0; i attachments = ava.GetAttachmentDictionary(); + + foreach (KeyValuePair kvp in attachments) + { + int attachpoint = kvp.Key; + UUID itemID = kvp.Value[0]; + + if (itemID != UUID.Zero) { - throw new Exception("Unable to load both inventories"); + // Get inventory item and copy it + InventoryItemBase item = new InventoryItemBase(itemID, srca); + item = iserv.GetItem(item); + + if (item != null) + { + InventoryItemBase dsti = new InventoryItemBase(UUID.Random(), dest); + dsti.Name = item.Name; + dsti.Description = item.Description; + dsti.InvType = item.InvType; + dsti.CreatorId = item.CreatorId; + dsti.CreatorIdAsUuid = item.CreatorIdAsUuid; + dsti.NextPermissions = item.NextPermissions; + dsti.CurrentPermissions = item.CurrentPermissions; + dsti.BasePermissions = item.BasePermissions; + dsti.EveryOnePermissions = item.EveryOnePermissions; + dsti.GroupPermissions = item.GroupPermissions; + dsti.AssetType = item.AssetType; + dsti.AssetID = item.AssetID; + dsti.GroupID = item.GroupID; + dsti.GroupOwned = item.GroupOwned; + dsti.SalePrice = item.SalePrice; + dsti.SaleType = item.SaleType; + dsti.Flags = item.Flags; + dsti.CreationDate = item.CreationDate; + dsti.Folder = dstf.ID; + + iserv.AddItem(dsti); + m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", dsti.ID, dstf.ID); + + // Attach item + ava.SetAttachment(attachpoint, dsti.ID, dsti.AssetID); + m_log.DebugFormat("[RADMIN] Attached {0}", dsti.ID); + } + else + { + m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", itemID, dstf.ID); + } } + } - AvatarData adata = new AvatarData(ava); - m_app.SceneManager.CurrentOrFirstScene.AvatarService.SetAvatar(dest, adata); + + } + + /// + /// This method is called by establishAppearance to copy inventory folders to make + /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments + /// + + private void copyInventoryFolders(UUID dest, UUID srca, AssetType assettype, Dictionary imap, + AvatarAppearance ava) + { + IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; + + InventoryFolderBase srcf = iserv.GetFolderForType(srca, assettype); + InventoryFolderBase dstf = iserv.GetFolderForType(dest, assettype); + + if (srcf == null || dstf == null) + throw new Exception("Cannot locate folder(s)"); + + // Missing source folder? This should *never* be the case + if (srcf.Type != (short)assettype) + { + srcf = new InventoryFolderBase(); + srcf.ID = UUID.Random(); + if (assettype == AssetType.Clothing) { + srcf.Name = "Clothing"; + } else { + srcf.Name = "Body Parts"; + } + srcf.Owner = srca; + srcf.Type = (short)assettype; + srcf.ParentID = iserv.GetRootFolder(srca).ID; + srcf.Version = 1; + iserv.AddFolder(srcf); // store base record + m_log.ErrorFormat("[RADMIN] Created folder for source {0}", srca); } - catch (Exception e) + + // Missing destination folder? This should *never* be the case + if (dstf.Type != (short)assettype) { - m_log.WarnFormat("[RADMIN] Error transferring inventory for {0} : {1}", - dest, e.Message); - return; + dstf = new InventoryFolderBase(); + dstf.ID = UUID.Random(); + dstf.Name = assettype.ToString(); + dstf.Owner = dest; + dstf.Type = (short)assettype; + dstf.ParentID = iserv.GetRootFolder(dest).ID; + dstf.Version = 1; + iserv.AddFolder(dstf); // store base record + m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", srca); } - return; + InventoryFolderBase efolder; + List folders = iserv.GetFolderContent(srca, srcf.ID).Folders; + + foreach (InventoryFolderBase folder in folders) + { + + efolder = new InventoryFolderBase(); + efolder.ID = UUID.Random(); + efolder.Name = folder.Name; + efolder.Owner = dest; + efolder.Type = folder.Type; + efolder.Version = folder.Version; + efolder.ParentID = dstf.ID; + iserv.AddFolder(efolder); + + m_log.DebugFormat("[RADMIN] Added folder {0} to folder {1}", efolder.ID, srcf.ID); + + List items = iserv.GetFolderContent(srca, folder.ID).Items; + + foreach (InventoryItemBase item in items) + { + InventoryItemBase dsti = new InventoryItemBase(UUID.Random(), dest); + dsti.Name = item.Name; + dsti.Description = item.Description; + dsti.InvType = item.InvType; + dsti.CreatorId = item.CreatorId; + dsti.CreatorIdAsUuid = item.CreatorIdAsUuid; + dsti.NextPermissions = item.NextPermissions; + dsti.CurrentPermissions = item.CurrentPermissions; + dsti.BasePermissions = item.BasePermissions; + dsti.EveryOnePermissions = item.EveryOnePermissions; + dsti.GroupPermissions = item.GroupPermissions; + dsti.AssetType = item.AssetType; + dsti.AssetID = item.AssetID; + dsti.GroupID = item.GroupID; + dsti.GroupOwned = item.GroupOwned; + dsti.SalePrice = item.SalePrice; + dsti.SaleType = item.SaleType; + dsti.Flags = item.Flags; + dsti.CreationDate = item.CreationDate; + dsti.Folder = efolder.ID; + + iserv.AddItem(dsti); + imap.Add(item.ID, dsti.ID); + m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", dsti.ID, efolder.ID); + + // Attach item, if original is attached + int attachpoint = ava.GetAttachpoint(item.ID); + if (attachpoint != 0) + { + ava.SetAttachment(attachpoint, dsti.ID, dsti.AssetID); + m_log.DebugFormat("[RADMIN] Attached {0}", dsti.ID); + } + } + } } - /// + /// /// This method is called if a given model avatar name can not be found. If the external /// file has already been loaded once, then control returns immediately. If not, then it /// looks for a default appearance file. This file contains XML definitions of zero or more named @@ -1557,9 +1769,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController bool include = false; bool select = false; - UICallback uic; - IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; - IAssetService aserv = m_app.SceneManager.CurrentOrFirstScene.AssetService; + Scene scene = m_app.SceneManager.CurrentOrFirstScene; + IInventoryService iserv = scene.InventoryService; + IAssetService aserv = scene.AssetService; doc.LoadXml(File.ReadAllText(dafn)); @@ -1596,29 +1808,31 @@ namespace OpenSim.ApplicationPlugins.RemoteController passwd = GetStringAttribute(avatar,"password",passwd); string[] nomens = name.Split(); - UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; - UserAccount account = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, nomens[0], nomens[1]); + UUID scopeID = scene.RegionInfo.ScopeID; + UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, nomens[0], nomens[1]); if (null == account) { - account = new UserAccount(scopeID, nomens[0], nomens[1], email); - bool success = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.StoreUserAccount(account); - if (!success) + account = CreateUser(scopeID, nomens[0], nomens[1], passwd, email); + if (null == account) { m_log.ErrorFormat("[RADMIN] Avatar {0} {1} was not created", nomens[0], nomens[1]); return false; } - // !!! REFACTORING PROBLEM: need to set the password - - GridRegion home = m_app.SceneManager.CurrentOrFirstScene.GridService.GetRegionByPosition(scopeID, - (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); - if (home != null) - m_app.SceneManager.CurrentOrFirstScene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); } - else - { - ID = account.PrincipalID; + + // Set home position + + GridRegion home = scene.GridService.GetRegionByPosition(scopeID, + (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); + if (null == home) { + m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", nomens[0], nomens[1]); + } else { + scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); + m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, nomens[0], nomens[1]); } + ID = account.PrincipalID; + m_log.DebugFormat("[RADMIN] User {0}[{1}] created or retrieved", name, ID); include = true; } @@ -1635,46 +1849,36 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (include) { - uic = new UICallback(); - // Request the inventory - iserv.GetUserInventory(ID, uic.callback); - - // While the inventory is being fetched, setup for appearance processing - AvatarData adata = m_app.SceneManager.CurrentOrFirstScene.AvatarService.GetAvatar(ID); + // Setup for appearance processing + AvatarData adata = scene.AvatarService.GetAvatar(ID); if (adata != null) mava = adata.ToAvatarAppearance(ID); else mava = new AvatarAppearance(); + AvatarWearable[] wearables = mava.Wearables; + for (int i=0; i folders = iserv.GetFolderContent(ID, cfolder.ID).Folders; + efolder = null; + + foreach (InventoryFolderBase folder in folders) { - if (folder.Name == oname && folder.ParentID == cfolder.ID) + if (folder.Name == oname) { efolder = folder; break; @@ -1711,14 +1918,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (efolder == null) { m_log.DebugFormat("[RADMIN] Creating outfit folder {0} for {1}", oname, name); - efolder = new InventoryFolderImpl(); + efolder = new InventoryFolderBase(); efolder.ID = UUID.Random(); efolder.Name = oname; - efolder.Type = 5; - efolder.Version = 1; efolder.Owner = ID; - cfolder.AddChildFolder(efolder); // make connection - iserv.AddFolder(efolder); // store base record + efolder.Type = (short)AssetType.Clothing; + efolder.Version = 1; + efolder.ParentID = cfolder.ID; + iserv.AddFolder(efolder); m_log.DebugFormat("[RADMIN] Adding outfile folder {0} to folder {1}", efolder.ID, cfolder.ID); } @@ -1745,26 +1952,55 @@ namespace OpenSim.ApplicationPlugins.RemoteController InventoryItemBase iitem = null; - if ((iitem = efolder.FindAsset(assetid)) == null) + // Check if asset is in inventory already + iitem = null; + List iitems = iserv.GetFolderContent(ID, efolder.ID).Items; + + foreach (InventoryItemBase litem in iitems) + { + if (litem.AssetID == assetid) + { + iitem = litem; + break; + } + } + + // Create inventory item + if (iitem == null) { - iitem = new InventoryItemBase(); - iitem.ID = UUID.Random(); + iitem = new InventoryItemBase(UUID.Random(), ID); iitem.Name = GetStringAttribute(item,"name",""); iitem.Description = GetStringAttribute(item,"desc",""); iitem.InvType = GetIntegerAttribute(item,"invtype",-1); - iitem.AssetType = GetIntegerAttribute(item,"assettype",-1); - iitem.Flags = GetUnsignedAttribute(item,"flags",0); - iitem.AssetID = assetid; // associated asset - iitem.Folder = efolder.ID; // Parent folder - iitem.Owner = ID; // Agent ID - iitem.BasePermissions = GetUnsignedAttribute(perms,"base",0x7fffffff); + iitem.CreatorId = GetStringAttribute(item,"creatorid",""); + iitem.CreatorIdAsUuid = (UUID)GetStringAttribute(item,"creatoruuid",""); iitem.NextPermissions = GetUnsignedAttribute(perms,"next",0x7fffffff); iitem.CurrentPermissions = GetUnsignedAttribute(perms,"current",0x7fffffff); - iitem.GroupPermissions = GetUnsignedAttribute(perms,"group",0x7fffffff); + iitem.BasePermissions = GetUnsignedAttribute(perms,"base",0x7fffffff); iitem.EveryOnePermissions = GetUnsignedAttribute(perms,"everyone",0x7fffffff); - m_log.DebugFormat("[RADMIN] Adding item {0} to folder {1}", iitem.ID, efolder.ID); + iitem.GroupPermissions = GetUnsignedAttribute(perms,"group",0x7fffffff); + iitem.AssetType = GetIntegerAttribute(item,"assettype",-1); + iitem.AssetID = assetid; // associated asset + iitem.GroupID = (UUID)GetStringAttribute(item,"groupid",""); + iitem.GroupOwned = (GetStringAttribute(item,"groupowned","false") == "true"); + iitem.SalePrice = GetIntegerAttribute(item,"saleprice",0); + iitem.SaleType = (byte)GetIntegerAttribute(item,"saletype",0); + iitem.Flags = GetUnsignedAttribute(item,"flags",0); + iitem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch()); + iitem.Folder = efolder.ID; // Parent folder + iserv.AddItem(iitem); + m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", iitem.ID, efolder.ID); + } + + // Attach item, if attachpoint is specified + int attachpoint = GetIntegerAttribute(item,"attachpoint",0); + if (attachpoint != 0) + { + mava.SetAttachment(attachpoint, iitem.ID, iitem.AssetID); + m_log.DebugFormat("[RADMIN] Attached {0}", iitem.ID); } + // Record whether or not the item is to be initially worn try { @@ -1774,25 +2010,22 @@ namespace OpenSim.ApplicationPlugins.RemoteController mava.Wearables[iitem.Flags].AssetID = iitem.AssetID; } } - catch {} + catch (Exception e) + { + m_log.WarnFormat("[RADMIN] Error wearing item {0} : {1}", iitem.ID, e.Message); + } } // foreach item in outfit m_log.DebugFormat("[RADMIN] Outfit {0} load completed", oname); } // foreach outfit m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); AvatarData adata2 = new AvatarData(mava); - m_app.SceneManager.CurrentOrFirstScene.AvatarService.SetAvatar(ID, adata2); + scene.AvatarService.SetAvatar(ID, adata2); } catch (Exception e) { m_log.WarnFormat("[RADMIN] Inventory processing incomplete for user {0} : {1}", name, e.Message); } - else - { - m_log.WarnFormat("[RADMIN] Unable to retrieve inventory for {0}[{1}]", - name, ID); - // continue to next avatar - } } // End of include } m_log.DebugFormat("[RADMIN] Default avatar loading complete"); @@ -2660,81 +2893,115 @@ namespace OpenSim.ApplicationPlugins.RemoteController public void Dispose() { } - } - - class UICallback - { - private Object uilock = new Object(); - internal InventoryFolderImpl root = null; - internal List folders; - internal List items; - internal bool OK = false; - - public void callback(ICollection p_folders, ICollection p_items) - { - lock (uilock) - { - folders = (List) p_folders; - items = (List) p_items; - OK = true; - System.Threading.Monitor.Pulse(uilock); - } - } - public void GetInventory() + /// + /// Create a user + /// + /// + /// + /// + /// + /// + private UserAccount CreateUser(UUID scopeID, string firstName, string lastName, string password, string email) { - Dictionary fmap = new Dictionary(); - - if (OK == false) + Scene scene = m_app.SceneManager.CurrentOrFirstScene; + IUserAccountService m_UserAccountService = scene.UserAccountService; + IGridService m_GridService = scene.GridService; + IAuthenticationService m_AuthenticationService = scene.AuthenticationService; + IGridUserService m_GridUserService = scene.GridUserService; + IInventoryService m_InventoryService = scene.InventoryService; + + UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName); + if (null == account) { - lock (uilock) + account = new UserAccount(scopeID, firstName, lastName, email); + if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) { - if (OK == false) - System.Threading.Monitor.Wait(uilock); + account.ServiceURLs = new Dictionary(); + account.ServiceURLs["HomeURI"] = string.Empty; + account.ServiceURLs["GatekeeperURI"] = string.Empty; + account.ServiceURLs["InventoryServerURI"] = string.Empty; + account.ServiceURLs["AssetServerURI"] = string.Empty; } - } - - // Got the inventory OK. So now merge the content of the default appearance - // file with whatever we already have in-world. For convenience we initialize - // the inventory hierarchy. - // Find root and build an index - - foreach (InventoryFolderImpl folder in folders) - { - if (folder.ParentID == UUID.Zero) + if (m_UserAccountService.StoreUserAccount(account)) { - if (root == null) + bool success; + if (m_AuthenticationService != null) { - root = folder; + success = m_AuthenticationService.SetPassword(account.PrincipalID, password); + if (!success) + m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", + firstName, lastName); + } + + GridRegion home = null; + if (m_GridService != null) + { + List defaultRegions = m_GridService.GetDefaultRegions(UUID.Zero); + if (defaultRegions != null && defaultRegions.Count >= 1) + home = defaultRegions[0]; + + if (m_GridUserService != null && home != null) + m_GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); + else + m_log.WarnFormat("[RADMIN]: Unable to set home for account {0} {1}.", + firstName, lastName); } else + m_log.WarnFormat("[RADMIN]: Unable to retrieve home region for account {0} {1}.", + firstName, lastName); + + if (m_InventoryService != null) { - throw new Exception("Multiple root folders found"); + success = m_InventoryService.CreateUserInventory(account.PrincipalID); + if (!success) + m_log.WarnFormat("[RADMIN]: Unable to create inventory for account {0} {1}.", + firstName, lastName); } + + m_log.InfoFormat("[RADMIN]: Account {0} {1} created successfully", firstName, lastName); + return account; + } else { + m_log.ErrorFormat("[RADMIN]: Account creation failed for account {0} {1}", firstName, lastName); } - fmap.Add(folder.ID, folder); } - - // Hard to continue if the root folder is not there - if (root == null) + else { - throw new Exception("Root folder not found"); + m_log.ErrorFormat("[RADMIN]: A user with the name {0} {1} already exists!", firstName, lastName); } + return null; + } - // Construct the folder hierarchy - foreach (InventoryFolderImpl folder in folders) + /// + /// Change password + /// + /// + /// + /// + private bool ChangeUserPassword(string firstName, string lastName, string password) + { + Scene scene = m_app.SceneManager.CurrentOrFirstScene; + IUserAccountService m_UserAccountService = scene.UserAccountService; + IAuthenticationService m_AuthenticationService = scene.AuthenticationService; + + UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, firstName, lastName); + if (null != account) { - if (folder.ID != root.ID) - { - fmap[folder.ParentID].AddChildFolder(folder); + bool success = false; + if (m_AuthenticationService != null) + success = m_AuthenticationService.SetPassword(account.PrincipalID, password); + if (!success) { + m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", + firstName, lastName); + return false; } + return true; } - - // Find a home for every pre-existing item - foreach (InventoryItemBase item in items) + else { - fmap[item.Folder].Items.Add(item.ID, item); + m_log.ErrorFormat("[RADMIN]: No such user"); + return false; } } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 874f1a2..56c73ec 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 063251a..326e502 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -357,7 +357,7 @@ namespace OpenSim.Services.UserAccountService /// /// /// - public void CreateUser(string firstName, string lastName, string password, string email) + private void CreateUser(string firstName, string lastName, string password, string email) { UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); if (null == account) @@ -374,12 +374,14 @@ namespace OpenSim.Services.UserAccountService if (StoreUserAccount(account)) { - bool success = false; + bool success; if (m_AuthenticationService != null) + { success = m_AuthenticationService.SetPassword(account.PrincipalID, password); - if (!success) - m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.", - firstName, lastName); + if (!success) + m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.", + firstName, lastName); + } GridRegion home = null; if (m_GridService != null) @@ -399,18 +401,22 @@ namespace OpenSim.Services.UserAccountService firstName, lastName); if (m_InventoryService != null) + { success = m_InventoryService.CreateUserInventory(account.PrincipalID); - if (!success) - m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", - firstName, lastName); + if (!success) + m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", + firstName, lastName); + } m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName); + } else { + m_log.ErrorFormat("[USER ACCOUNT SERVICE]: Account creation failed for account {0} {1}", firstName, lastName); } } else { m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); } - } + } } } -- cgit v1.1 From 9069114d0fb86371839338f16e9d306686ea60ac Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 13 Jun 2010 21:57:56 +0100 Subject: Fox my changes to radmin --- OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index b248d11..e57aaa0 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -999,8 +999,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController string lastname = (string) requestData["user_lastname"]; string passwd = (string) requestData["user_password"]; - regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); - regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); + uint regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); + uint regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); string email = ""; // empty string for email if (requestData.Contains("user_email")) -- cgit v1.1 From 19558f380a1e9cbaff849eb15262266ea79b60d2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 13 Jun 2010 19:06:22 -0700 Subject: Fixes the long-standing RegionUp bug! Plus lots of other cleanups related to neighbours. --- .../Avatar/Attachments/AttachmentsModule.cs | 2 +- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 2 +- .../EntityTransfer/EntityTransferModule.cs | 28 +++++++++++++++++++++ .../Neighbour/NeighbourServiceInConnectorModule.cs | 5 +--- .../Grid/LocalGridServiceConnector.cs | 17 +------------ .../Grid/RemoteGridServiceConnector.cs | 5 +--- .../Neighbour/LocalNeighbourServiceConnector.cs | 8 +++--- .../Simulation/RemoteSimulationConnector.cs | 1 - OpenSim/Region/Framework/Scenes/Scene.cs | 29 +++------------------- .../Framework/Scenes/SceneCommunicationService.cs | 21 ++++++---------- .../Connectors/Grid/GridServiceConnector.cs | 9 +++---- .../Simulation/SimulationServiceConnector.cs | 2 +- OpenSim/Services/GridService/GridService.cs | 5 ++-- 13 files changed, 55 insertions(+), 79 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 6d16c52..a7b4c66 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -352,7 +352,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // Save avatar attachment information if (m_scene.AvatarFactory != null) { - m_log.Debug("[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", ItemID: " + itemID); + m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); } } diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 22c8937..7e5a8ec 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory public void UpdateDatabase(UUID user, AvatarAppearance appearance) { - //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); + m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); AvatarData adata = new AvatarData(appearance); m_scene.AvatarService.SetAvatar(user, adata); } diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 5d50a83..ab1cfc3 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -922,12 +922,40 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer /// public void EnableChildAgent(ScenePresence sp, GridRegion region) { + m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighour {0}", region.RegionName); + + AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); agent.BaseFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero; agent.startpos = new Vector3(128, 128, 70); agent.child = true; agent.Appearance = sp.Appearance; + agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); + + agent.ChildrenCapSeeds = new Dictionary(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); + m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count); + + if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle)) + agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath); + m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count); + + sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath); + foreach (ulong h in agent.ChildrenCapSeeds.Keys) + m_log.DebugFormat("[XXX] --> {0}", h); + m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle); + agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath); + + if (sp.Scene.CapsModule != null) + { + sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, agent.ChildrenCapSeeds); + } + + if (currentAgentCircuit != null) + { + agent.ServiceURLs = currentAgentCircuit.ServiceURLs; + agent.Viewer = currentAgentCircuit.Viewer; + } InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true, diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs index 8a90370..35518d5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs @@ -123,17 +123,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) { - m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", - thisRegion.RegionName, regionHandle, m_Scenes.Count); foreach (Scene s in m_Scenes) { if (s.RegionInfo.RegionHandle == regionHandle) { - m_log.Debug("[NEIGHBOUR IN CONNECTOR]: Found region to SendHelloNeighbour"); + //m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0} to {1}", thisRegion.RegionName, s.RegionInfo.RegionName); return s.IncomingHelloNeighbour(thisRegion); } } - m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle); return null; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 1b00c8a..b2e3f4f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs @@ -181,22 +181,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public List GetNeighbours(UUID scopeID, UUID regionID) { - if (m_LocalCache.ContainsKey(regionID)) - { - List neighbours = m_LocalCache[regionID].GetNeighbours(); - if (neighbours.Count == 0) - // try the DB - neighbours = m_GridService.GetNeighbours(scopeID, regionID); - return neighbours; - } - else - { - m_log.WarnFormat("[LOCAL GRID CONNECTOR]: GetNeighbours: Requested region {0} is not on this sim", regionID); - return new List(); - } - - // Don't go to the DB - //return m_GridService.GetNeighbours(scopeID, regionID); + return m_GridService.GetNeighbours(scopeID, regionID); } public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 46741a5..16e25e6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs @@ -153,12 +153,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid return false; } - // Let's override GetNeighbours completely -- never go to the grid server - // Neighbours are/should be cached locally - // For retrieval from the DB, caller should call GetRegionByPosition public override List GetNeighbours(UUID scopeID, UUID regionID) { - return m_LocalGridService.GetNeighbours(scopeID, regionID); + return base.GetNeighbours(scopeID, regionID); } public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs index daba0b3..f71bf46 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs @@ -121,17 +121,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) { - m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", - thisRegion.RegionName, regionHandle, m_Scenes.Count); + m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}.", + thisRegion.RegionName, regionHandle); foreach (Scene s in m_Scenes) { if (s.RegionInfo.RegionHandle == regionHandle) { - m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour"); + //m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour"); return s.IncomingHelloNeighbour(thisRegion); } } - m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle); + //m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle); return null; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 9e8454f..3f577f2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs @@ -181,7 +181,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation // else do the remote thing if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) { - //m_regionClient.SendUserInformation(regInfo, aCircuit); return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason); } return false; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 55060c3..2ff611e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -948,12 +948,6 @@ namespace OpenSim.Region.Framework.Scenes // Let the grid service module know, so this can be cached m_eventManager.TriggerOnRegionUp(otherRegion); - RegionInfo regInfo = new RegionInfo(xcell, ycell, otherRegion.InternalEndPoint, otherRegion.ExternalHostName); - regInfo.RegionID = otherRegion.RegionID; - regInfo.RegionName = otherRegion.RegionName; - regInfo.ScopeID = otherRegion.ScopeID; - regInfo.ExternalHostName = otherRegion.ExternalHostName; - GridRegion r = new GridRegion(regInfo); try { ForEachScenePresence(delegate(ScenePresence agent) @@ -968,7 +962,7 @@ namespace OpenSim.Region.Framework.Scenes old.Add(otherRegion.RegionHandle); agent.DropOldNeighbours(old); if (m_teleportModule != null) - m_teleportModule.EnableChildAgent(agent, r); + m_teleportModule.EnableChildAgent(agent, otherRegion); } } ); @@ -1518,6 +1512,7 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); LoginsDisabled = false; + m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface(), RegionInfo); } } } @@ -1802,6 +1797,8 @@ namespace OpenSim.Region.Framework.Scenes { RegisterCommsEvents(); + m_sceneGridService.SetScene(this); + // These two 'commands' *must be* next to each other or sim rebooting fails. //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); @@ -1812,24 +1809,6 @@ namespace OpenSim.Region.Framework.Scenes throw new Exception(error); } - m_sceneGridService.SetScene(this); - m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface(), RegionInfo); - - //Dictionary dGridSettings = m_sceneGridService.GetGridSettings(); - - //if (dGridSettings.ContainsKey("allow_forceful_banlines")) - //{ - // if (dGridSettings["allow_forceful_banlines"] != "TRUE") - // { - // m_log.Info("[GRID]: Grid is disabling forceful parcel banlists"); - // EventManager.TriggerSetAllowForcefulBan(false); - // } - // else - // { - // m_log.Info("[GRID]: Grid is allowing forceful parcel banlists"); - // EventManager.TriggerSetAllowForcefulBan(true); - // } - //} } /// diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index bd8ccce..c675322 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -182,24 +182,17 @@ namespace OpenSim.Region.Framework.Scenes { //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); - for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++) + List neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); + m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); + foreach (GridRegion n in neighbours) { - for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++) - { - if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region - { - ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize); - InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; - - d.BeginInvoke(neighbourService, region, handle, - InformNeighborsThatRegionisUpCompleted, - d); - } - } + InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; + d.BeginInvoke(neighbourService, region, n.RegionHandle, + InformNeighborsThatRegionisUpCompleted, + d); } } - public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); /// diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 0ec8912..1831533 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs @@ -210,9 +210,6 @@ namespace OpenSim.Services.Connectors GridRegion rinfo = new GridRegion((Dictionary)r); rinfos.Add(rinfo); } - else - m_log.DebugFormat("[GRID CONNECTOR]: GetNeighbours {0}, {1} received invalid response type {2}", - scopeID, regionID, r.GetType()); } } else @@ -299,9 +296,9 @@ namespace OpenSim.Services.Connectors { if (replyData["result"] is Dictionary) rinfo = new GridRegion((Dictionary)replyData["result"]); - else - m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received no region", - scopeID, x, y); + //else + // m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received no region", + // scopeID, x, y); } else m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition {0}, {1}-{2} received null response", diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index ff0dd7e..32f02fb 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -479,7 +479,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete {0}", ex.Message); + m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message); return false; } finally diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 7c98642..225530f 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -273,14 +273,15 @@ namespace OpenSim.Services.GridService if (region != null) { // Not really? Maybe? - List rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize, region.posY - (int)Constants.RegionSize, - region.posX + (int)Constants.RegionSize, region.posY + (int)Constants.RegionSize, scopeID); + List rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize - 1, region.posY - (int)Constants.RegionSize - 1, + region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID); foreach (RegionData rdata in rdatas) if (rdata.RegionID != regionID) rinfos.Add(RegionData2RegionInfo(rdata)); } + m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); return rinfos; } -- cgit v1.1 From bd346ab8c7bc8358d467b39dd21070d935a9131b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 13 Jun 2010 19:18:17 -0700 Subject: Fixes attachments coming back upon being detached in neighbouring regions and crossing. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c1e835e..6c119c2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3128,6 +3128,7 @@ namespace OpenSim.Region.Framework.Scenes { if (cAgent.Attachments != null) { + m_appearance.ClearAttachments(); foreach (AttachmentData att in cAgent.Attachments) { m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID); -- cgit v1.1 From 704da8c8238835c63e8ca560fc7778603e9f6795 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Mon, 14 Jun 2010 04:03:54 -0700 Subject: osGetAvatarList: Use AbsolutePosition instead of the position of the physics actor, or the avatar disappears when they sit down. --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 0e86c86..db43902 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2222,12 +2222,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (avatar.IsChildAgent == false) { - if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null) - { - result.Add(avatar.UUID); - result.Add(avatar.PhysicsActor.Position); - result.Add(avatar.Name); - } + result.Add(avatar.UUID); + result.Add(avatar.AbsolutePosition); + result.Add(avatar.Name); } } }); -- cgit v1.1 From 53c32d877319290244d18b2f5cd7f7b37cec4243 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Mon, 14 Jun 2010 04:03:54 -0700 Subject: osGetAvatarList: Use AbsolutePosition instead of the position of the physics actor, or the avatar disappears when they sit down. --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index cd6d3a3..01b64eb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2218,12 +2218,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (avatar.IsChildAgent == false) { - if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null) - { - result.Add(avatar.UUID); - result.Add(avatar.PhysicsActor.Position); - result.Add(avatar.Name); - } + result.Add(avatar.UUID); + result.Add(avatar.AbsolutePosition); + result.Add(avatar.Name); } } }); -- cgit v1.1 From ef1496ca2d22ad3d24bc9b53830a49f5a9c550d8 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Mon, 14 Jun 2010 04:28:38 -0700 Subject: Add "alert dialog" for sending dialogs to users from the console --- OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index b5c3176..4e36c5d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -55,6 +55,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog m_scene.AddCommand( this, "alert general", "alert general ", "Send an alert to everyone", HandleAlertConsoleCommand); + + m_scene.AddCommand( + this, "alert dialog", "alert dialog ", "Send a dialog alert to everyone", HandleAlertConsoleCommand); + + } public void PostInitialise() {} @@ -181,6 +186,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog "[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); SendGeneralAlert(message); } + else if (cmdparams[1] == "dialog") + { + string message = CombineParams(cmdparams, 2); + + m_log.InfoFormat( + "[DIALOG]: Sending dialog alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); + SendNotificationToUsersInRegion(UUID.Zero, "System", message); + } else { string firstName = cmdparams[1]; -- cgit v1.1 From 9c9ce9e8dd19c887ba91ff9b70f1b0e4f6a3f8df Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Jun 2010 11:50:42 -0700 Subject: * Deleted duplicated migration that was failing anyway. * Added an error message in initial estate owner creation that makes it clear what needs to happen. --- OpenSim/Data/MySQL/Resources/RegionStore.migrations | 2 -- OpenSim/Region/Framework/Scenes/Scene.cs | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index bdb3558..3f644f9 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -787,8 +787,6 @@ CREATE TABLE `regionwindlight` ( PRIMARY KEY (`region_id`) ); -ALTER TABLE estate_settings AUTO_INCREMENT = 100; -COMMIT; :VERSION 33 #--------------------- diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2ff611e..e2ab643 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1334,6 +1334,8 @@ namespace OpenSim.Region.Framework.Scenes m_regInfo.EstateSettings.EstateOwner = account.PrincipalID; m_regInfo.EstateSettings.Save(); } + else + m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid,\n you must create the estate owner account first."); } else { -- cgit v1.1 From 0031d4a6186dbcab38a9f7fd2113ff6a5de2923a Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 15 Jun 2010 01:52:37 +0100 Subject: Readjust master version and flavor --- OpenSim/Framework/Servers/VersionInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index c27bc9a..100bf1f 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -29,8 +29,8 @@ namespace OpenSim { public class VersionInfo { - private const string VERSION_NUMBER = "0.7"; - private const Flavour VERSION_FLAVOUR = Flavour.RC1; + private const string VERSION_NUMBER = "0.7.1"; + private const Flavour VERSION_FLAVOUR = Flavour.Dev; public enum Flavour { -- cgit v1.1 From 38f098588cb2227602b8e5a5059d0513195da52f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 15 Jun 2010 16:36:22 -0700 Subject: Fixes creation date issue on user accounts. --- OpenSim/Services/Interfaces/IUserAccountService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 09d1d87..c580078 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -29,6 +29,8 @@ using System; using System.Collections.Generic; using OpenMetaverse; +using OpenSim.Framework; + namespace OpenSim.Services.Interfaces { public class UserAccount @@ -50,7 +52,7 @@ namespace OpenSim.Services.Interfaces LastName = lastName; Email = email; ServiceURLs = new Dictionary(); - // Created = ??? + Created = Util.UnixTimeSinceEpoch(); } public string FirstName; -- cgit v1.1 From 6c0a372346305f9de07d664aa58019a6cdfd6c63 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 15 Jun 2010 17:46:36 -0700 Subject: * Support salted and unsalted password hashes in SimianAuthenticationServiceConnector --- .../SimianAuthenticationServiceConnector.cs | 53 +++++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index de3ee4e..3c784f2 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -114,10 +114,9 @@ namespace OpenSim.Services.Connectors.SimianGrid { if (identity["Type"].AsString() == "md5hash") { - string credential = identity["Credential"].AsString(); - - if (password == credential || "$1$" + password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential) - return Authorize(principalID); + string authorizeResult; + if (CheckPassword(principalID, password, identity["Credential"].AsString(), out authorizeResult)) + return authorizeResult; md5hashFound = true; break; @@ -125,9 +124,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } } - if (md5hashFound) - m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + " using md5hash $1$" + Utils.MD5String(password)); - else + if (!md5hashFound) m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found"); } else @@ -228,6 +225,48 @@ namespace OpenSim.Services.Connectors.SimianGrid return false; } + private bool CheckPassword(UUID userID, string password, string simianGridCredential, out string authorizeResult) + { + if (simianGridCredential.Contains(":")) + { + // Salted version + int idx = simianGridCredential.IndexOf(':'); + string finalhash = simianGridCredential.Substring(0, idx); + string salt = simianGridCredential.Substring(idx + 1); + + if (finalhash == Utils.MD5String(password + ":" + salt)) + { + authorizeResult = Authorize(userID); + return true; + } + else + { + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID + + " using md5hash " + Utils.MD5String(password) + ":" + salt); + } + } + else + { + // Unsalted version + if (password == simianGridCredential || + "$1$" + password == simianGridCredential || + "$1$" + Utils.MD5String(password) == simianGridCredential || + Utils.MD5String(password) == simianGridCredential) + { + authorizeResult = Authorize(userID); + return true; + } + else + { + m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID + + " using md5hash $1$" + Utils.MD5String(password)); + } + } + + authorizeResult = null; + return false; + } + private string Authorize(UUID userID) { NameValueCollection requestArgs = new NameValueCollection -- cgit v1.1 From 117fd629d68ef8ab373b70fd5e9e6a643e8eaa65 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Wed, 16 Jun 2010 08:32:47 -0700 Subject: Allow llMapDestination to be used in any event if the host is an attachment. This fixes Mantis 0000098. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9f3e354..c332fd8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9470,8 +9470,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, 0); - if (detectedParams == null) return; // only works on the first detected avatar - + if (detectedParams == null) + { + if (m_host.IsAttachment == true) + { + detectedParams = new DetectParams(); + detectedParams.Key = m_host.OwnerID; + } + else + { + return; + } + } + ScenePresence avatar = World.GetScenePresence(detectedParams.Key); if (avatar != null) { @@ -9479,6 +9490,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z)); } + ScriptSleep(1000); } -- cgit v1.1 From b9c40320f108a84d7841cdc9e98009cf650f930e Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Wed, 16 Jun 2010 09:20:20 -0700 Subject: Fix llAttachToAvatar. This addresses mantis 128 . --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c332fd8..877c3cb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3065,9 +3065,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) - return; - TaskInventoryItem item; m_host.TaskInventory.LockItemsForRead(true); @@ -3093,11 +3090,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence presence = World.GetScenePresence(m_host.OwnerID); + /* IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; if (attachmentsModule != null) + { attachmentsModule.AttachObject( - presence.ControllingClient, grp.LocalId, + presence.ControllingClient, grp.LocalId, (uint)attachment, Quaternion.Identity, Vector3.Zero, false); + } + */ + grp.AttachToAgent(m_host.OwnerID, (uint)attachment, Vector3.Zero, false); } } -- cgit v1.1 From 544627c79cceb59f4172ddbcef0fcfd992e62003 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 17 Jun 2010 03:03:55 +0100 Subject: Force newly connecting remote consoles to display a prompt --- OpenSim/Framework/Console/RemoteConsole.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index a46a6cb..c038aac 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -44,6 +44,7 @@ namespace OpenSim.Framework.Console { public int last; public long lastLineSeen; + public bool newConnection = true; } // A console that uses REST interfaces @@ -424,6 +425,12 @@ namespace OpenSim.Framework.Console XmlElement rootElement = xmldoc.CreateElement("", "ConsoleSession", ""); + if (c.newConnection) + { + c.newConnection = false; + Output("+++" + DefaultPrompt); + } + lock (m_Scrollback) { long startLine = m_LineNumber - m_Scrollback.Count; -- cgit v1.1 From d1c8b083b8d44417d67fb401646eaa7215ff0851 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 17 Jun 2010 04:15:07 -0700 Subject: Fix llRot2Euler with a mathematically sound implementation. The only difference between this an SL is that SL resolves a figure of negative PI into PI, and does the equivalent in the reverse (llEuler2Rot, -1.0 becomes 1.0); --- .../Shared/Api/Implementation/LSL_Api.cs | 46 +++++++++++++--------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 877c3cb..fe8c70e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -502,25 +502,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return remainder; } - // Old implementation of llRot2Euler, now normalized - - public LSL_Vector llRot2Euler(LSL_Rotation r) - { - m_host.AddScriptLPS(1); - //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke - LSL_Rotation t = new LSL_Rotation(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s); - double m = (t.x + t.y + t.z + t.s); - if (m == 0) return new LSL_Vector(); - double n = 2 * (r.y * r.s + r.x * r.z); - double p = m * m - n * n; - if (p > 0) - return new LSL_Vector(NormalizeAngle(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s))), - NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), - NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)))); - else if (n > 0) - return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); - else - return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); + public LSL_Vector llRot2Euler(LSL_Rotation q1) + { + m_host.AddScriptLPS(1); + LSL_Vector eul = new LSL_Vector(); + + double sqw = q1.s*q1.s; + double sqx = q1.x*q1.x; + double sqy = q1.z*q1.z; + double sqz = q1.y*q1.y; + double unit = sqx + sqy + sqz + sqw; // if normalised is one, otherwise is correction factor + double test = q1.x*q1.z + q1.y*q1.s; + if (test > 0.4999*unit) { // singularity at north pole + eul.z = 2 * Math.Atan2(q1.x,q1.s); + eul.y = Math.PI/2; + eul.x = 0; + return eul; + } + if (test < -0.4999*unit) { // singularity at south pole + eul.z = -2 * Math.Atan2(q1.x,q1.s); + eul.y = -Math.PI/2; + eul.x = 0; + return eul; + } + eul.z = Math.Atan2(2*q1.z*q1.s-2*q1.x*q1.y , sqx - sqy - sqz + sqw); + eul.y = Math.Asin(2*test/unit); + eul.x = Math.Atan2(2*q1.x*q1.s-2*q1.z*q1.y , -sqx + sqy - sqz + sqw); + return eul; } /* From wiki: -- cgit v1.1