From a72d33d3a5da5bb48e9c95fd355458be335fee3e Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 2 Jan 2008 20:25:47 +0000 Subject: * Added the ability for Region Owners to add and remove estate managers using the estate tools. * Estate managers get abilities like the region owner for now. * Estate managers, you'll need to request server admin status to be able to activate the estate tools dialog (haven't figured out why this is the case yet) * Switching from grid mode to standalone or switching grids will make the stored Estate Manager UUIDs not match up with a valid account so you'll see (waiting) listed there instead of a user until you reset them or go back to the grid you added them from. --- OpenSim/Framework/EstateSettings.cs | 61 +++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index 1078c10..9e4b9a4 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs @@ -646,8 +646,8 @@ namespace OpenSim.Framework for (int i = 0; i < numEstateManagers; i++) { pos = GetNextEstateManager(pos); - - rEstateManagers[i] = GetEstateManagerAtPos(pos); + + rEstateManagers[i] = GetEstateManagerAtPos(pos); pos++; } return rEstateManagers; @@ -683,8 +683,63 @@ namespace OpenSim.Framework return numEstateManagers; } + public void AddEstateManager(LLUUID avatarID) + { + LLUUID[] testateManagers = GetEstateManagers(); + LLUUID[] nestateManagers = new LLUUID[testateManagers.Length + 1]; + + int i = 0; + for (i = 0; i < testateManagers.Length; i++) + { + nestateManagers[i] = testateManagers[i]; + } + + nestateManagers[i] = avatarID; + + //Saves it to the estate settings file + estateManagers = nestateManagers; + + } + public void RemoveEstateManager(LLUUID avatarID) + { + int notfoundparam = 11; // starting high so the condense routine (max ten) doesn't run if we don't find it. + LLUUID[] testateManagers = GetEstateManagers(); // temporary estate managers list + + + int i = 0; + int foundpos = notfoundparam; + + // search for estate manager. + for (i = 0; i < testateManagers.Length; i++) + { + if (testateManagers[i] == avatarID) + { + foundpos = i; + break; + } + } + if (foundpos < notfoundparam) + { + LLUUID[] restateManagers = new LLUUID[testateManagers.Length - 1]; + + // fill new estate managers array up to the found spot + for (int j = 0; j < foundpos; j++) + restateManagers[j] = testateManagers[j]; + + // skip over the estate manager we're removing and compress + for (int j = foundpos + 1; j < testateManagers.Length; j++) + restateManagers[j - 1] = testateManagers[j]; + + estateManagers = restateManagers; + } + else + { + OpenSim.Framework.Console.MainLog.Instance.Error("ESTATESETTINGS", "Unable to locate estate manager : " + avatarID.ToString() + " for removal"); + } + } + #endregion - + private ConfigurationMember configMember; public EstateSettings() -- cgit v1.1