Browse Source

move servicesGodAgentID to Constants.cs

UbitUmarov 3 years ago
parent
commit
a0d0bbacb2

+ 5 - 1
OpenSim/Framework/Constants.cs

@@ -54,9 +54,13 @@ namespace OpenSim.Framework
 
         public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f";
 
-        public static readonly UUID m_MrOpenSimID = new UUID("11111111-1111-0000-0000-000100bba000");
+        public static readonly string m_MrOpenSimIDString = "11111111-1111-0000-0000-000100bba000";
+        public static readonly UUID m_MrOpenSimID = new UUID(m_MrOpenSimIDString);
         public static readonly DateTime m_MrOpenSimBorn = new DateTime(2007, 1, 1, 0, 0, 0, DateTimeKind.Utc);
 
+        public static readonly string servicesAgentIDString = "6571e388-6218-4574-87db-f9379718315e";
+        public static readonly UUID servicesGodAgentID = new UUID(servicesAgentIDString);
+
         public enum EstateAccessCodex : uint
         {
             AllowedAccess = 1,

+ 2 - 3
OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs

@@ -51,7 +51,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
 
         /// <summary>Special UUID for actions that apply to all agents</summary>
         private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb");
-        private static readonly UUID UUID_GRID_GOD = new UUID("6571e388-6218-4574-87db-f9379718315e");
 
         protected Scene m_scene;
         protected IDialogModule m_dialogModule;
@@ -302,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
                 {
                     m_log.DebugFormat("[GODS]: Sending nonlocal kill for agent {0}", agentID);
                     transferModule.SendInstantMessage(new GridInstantMessage(
-                            m_scene, UUID_GRID_GOD, "GRID", agentID, (byte)250, false,
+                            m_scene, Constants.servicesGodAgentID, "GRID", agentID, (byte)250, false,
                             reason, UUID.Zero, true,
                             new Vector3(), new byte[] {0}, true),
                             delegate(bool success) {} );
@@ -342,7 +341,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
                 UUID godID = new UUID(msg.fromAgentID);
                 uint kickMode = (uint)msg.binaryBucket[0];
 
-                if(godID == UUID_GRID_GOD)
+                if(godID == Constants.servicesGodAgentID)
                     GridKickUser(agentID, reason);
                 else
                     KickUser(godID, agentID, kickMode, reason);

+ 1 - 1
OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs

@@ -635,7 +635,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
                 return;
             }
 
-            string        avatarName = avatar.Name;
+            string avatarName = avatar.Name;
 
             // - check whether we have a region channel in our cache
             // - if not:

+ 2 - 4
OpenSim/Services/HypergridService/GatekeeperService.cs

@@ -652,14 +652,12 @@ namespace OpenSim.Services.HypergridService
                 return false;
 
             string regURL = regInfo.ServerURI;
-            if(String.IsNullOrEmpty(regURL))
+            if(string.IsNullOrEmpty(regURL))
                 return false;
-            
-            UUID guuid = new UUID("6571e388-6218-4574-87db-f9379718315e");
 
             GridInstantMessage msg = new GridInstantMessage();
             msg.imSessionID = UUID.Zero.Guid;
-            msg.fromAgentID = guuid.Guid;
+            msg.fromAgentID = Constants.servicesGodAgentID.Guid;
             msg.toAgentID = agentID.Guid;
             msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
             msg.fromAgentName = "GRID";

+ 1 - 1
OpenSim/Services/LLLoginService/LLLoginResponse.cs

@@ -855,7 +855,7 @@ namespace OpenSim.Services.LLLoginService
         {
             //for now create random inventory library owner
             Hashtable TempHash = new Hashtable();
-            TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000"; // libFolder.Owner
+            TempHash["agent_id"] = Constants.m_MrOpenSimID.ToString(); // libFolder.Owner
             ArrayList inventoryLibOwner = new ArrayList();
             inventoryLibOwner.Add(TempHash);
             return inventoryLibOwner;

+ 10 - 9
OpenSim/Services/LLLoginService/LLLoginService.cs

@@ -365,6 +365,12 @@ namespace OpenSim.Services.LLLoginService
                     return LLFailedLoginResponse.LoginBlockedProblem;
                 }
 
+                if (account.PrincipalID == Constants.servicesGodAgentID)
+                {
+                    // really?
+                    return LLFailedLoginResponse.UserProblem;
+                }
+
                 // If a scope id is requested, check that the account is in
                 // that scope, or unscoped.
                 //
@@ -399,11 +405,7 @@ namespace OpenSim.Services.LLLoginService
                     return LLFailedLoginResponse.UserProblem;
                 }
 
-                if(account.PrincipalID == new UUID("6571e388-6218-4574-87db-f9379718315e"))
-                {
-                    // really?
-                    return LLFailedLoginResponse.UserProblem;
-                }
+
 
                 string PrincipalIDstr = account.PrincipalID.ToString();
                 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(PrincipalIDstr);
@@ -1143,14 +1145,13 @@ namespace OpenSim.Services.LLLoginService
                 return false;
 
             string regURL = regInfo.ServerURI;
-            if(String.IsNullOrEmpty(regURL))
+            if(string.IsNullOrEmpty(regURL))
                 return false;
-            
-            UUID guuid = new UUID("6571e388-6218-4574-87db-f9379718315e");
+
 
             GridInstantMessage msg = new GridInstantMessage();
             msg.imSessionID = UUID.Zero.Guid;
-            msg.fromAgentID = guuid.Guid;
+            msg.fromAgentID = Constants.servicesGodAgentID.Guid;
             msg.toAgentID = agentID.Guid;
             msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
             msg.fromAgentName = "GRID";

+ 2 - 3
OpenSim/Services/UserAccountService/UserAccountService.cs

@@ -44,7 +44,6 @@ namespace OpenSim.Services.UserAccountService
     public class UserAccountService : UserAccountServiceBase, IUserAccountService
     {
         private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-        private static readonly UUID UUID_GRID_GOD = new UUID("6571e388-6218-4574-87db-f9379718315e");
         private static UserAccountService m_RootInstance;
 
         /// <summary>
@@ -92,13 +91,13 @@ namespace OpenSim.Services.UserAccountService
                 m_RootInstance = this;
 
                 //  create a system grid god account
-                UserAccount ggod = GetUserAccount(UUID.Zero, UUID_GRID_GOD);
+                UserAccount ggod = GetUserAccount(UUID.Zero, Constants.servicesGodAgentID);
                 if(ggod == null)
                 {
                     UserAccountData d = new UserAccountData();
                     d.FirstName = "GRID";
                     d.LastName = "SERVICES";
-                    d.PrincipalID = UUID_GRID_GOD;
+                    d.PrincipalID = Constants.servicesGodAgentID;
                     d.ScopeID = UUID.Zero;
                     d.Data = new Dictionary<string, string>();
                     d.Data["Email"] = string.Empty;