Example #1
0
        private static void SaveArchiveSecurityDescriptor(ADUser mailbox, IConfigDataProvider writableAdSession, RawSecurityDescriptor rawSd, Task.TaskVerboseLoggingDelegate logVerbose, Task.ErrorLoggerDelegate logError)
        {
            ADObjectId adobjectId = mailbox.ArchiveDatabase ?? mailbox.Database;
            MailboxId  mailboxId  = new MailboxId(MapiTaskHelper.ConvertDatabaseADObjectIdToDatabaseId(adobjectId), mailbox.ArchiveGuid);

            try
            {
                ActiveManager        activeManagerInstance = ActiveManager.GetActiveManagerInstance();
                DatabaseLocationInfo serverForDatabase     = activeManagerInstance.GetServerForDatabase(adobjectId.ObjectGuid);
                using (MapiMessageStoreSession mapiMessageStoreSession = new MapiMessageStoreSession(serverForDatabase.ServerLegacyDN, PermissionTaskHelper.CalcuteSystemAttendantMailboxLegacyDistingushName(serverForDatabase.ServerLegacyDN), Fqdn.Parse(serverForDatabase.ServerFqdn)))
                {
                    logVerbose(Strings.VerboseSaveStoreMailboxSecurityDescriptor(mailboxId.ToString(), mapiMessageStoreSession.ServerName));
                    mapiMessageStoreSession.ForceStoreToRefreshMailbox(mailboxId);
                }
            }
            catch (FormatException)
            {
                logError(new TaskInvalidOperationException(Strings.ErrorInvalidServerLegacyDistinguishName(mailbox.DistinguishedName.ToString())), ExchangeErrorCategory.ServerOperation, null);
            }
            catch (Microsoft.Exchange.Data.Mapi.Common.MailboxNotFoundException)
            {
                logVerbose(Strings.VerboseArchiveNotExistInStore(mailbox.Name));
                PermissionTaskHelper.SaveAdSecurityDescriptor(mailbox, writableAdSession, rawSd, logVerbose, logError);
            }
            catch (LocalizedException exception)
            {
                logError(new SetArchivePermissionException(mailbox.Name, exception), ExchangeErrorCategory.ServerOperation, null);
            }
        }
Example #2
0
        public DatabaseSettingsContext(Guid mdbGuid, SettingsContextBase nextContext = null) : base(mdbGuid, nextContext)
        {
            DatabaseLocationInfo databaseLocationInfo = null;

            try
            {
                databaseLocationInfo = ActiveManager.GetCachingActiveManagerInstance().GetServerForDatabase(mdbGuid, GetServerForDatabaseFlags.IgnoreAdSiteBoundary | GetServerForDatabaseFlags.BasicQuery);
            }
            catch (ObjectNotFoundException)
            {
            }
            if (databaseLocationInfo != null)
            {
                this.databaseName    = databaseLocationInfo.DatabaseName;
                this.databaseVersion = databaseLocationInfo.AdminDisplayVersion;
                this.serverName      = databaseLocationInfo.ServerFqdn;
                this.serverVersion   = new ServerVersion(databaseLocationInfo.ServerVersion);
                this.serverGuid      = new Guid?(databaseLocationInfo.ServerGuid);
                return;
            }
            this.databaseName    = string.Empty;
            this.databaseVersion = new ServerVersion(0);
            this.serverName      = string.Empty;
            this.serverVersion   = new ServerVersion(0);
            this.serverGuid      = new Guid?(Guid.Empty);
        }
Example #3
0
        public static void TaskConstructAllDatabaseConfigurations(IADDatabaseAvailabilityGroup dag, IADServer server, out List <ReplayConfiguration> activeConfigurations, out List <ReplayConfiguration> passiveConfigurations)
        {
            activeConfigurations  = new List <ReplayConfiguration>(20);
            passiveConfigurations = new List <ReplayConfiguration>(48);
            ActiveManager noncachingActiveManagerInstance = ActiveManager.GetNoncachingActiveManagerInstance();
            IADToplogyConfigurationSession iadtoplogyConfigurationSession = ADSessionFactory.CreateIgnoreInvalidRootOrgSession(true);
            IEnumerable <IADDatabase>      allDatabases = iadtoplogyConfigurationSession.GetAllDatabases(server);

            if (allDatabases != null)
            {
                foreach (IADDatabase mdb in allDatabases)
                {
                    bool                flag;
                    Exception           ex;
                    ReplayConfiguration replayConfiguration = ReplayConfiguration.GetReplayConfiguration(dag, mdb, server, noncachingActiveManagerInstance, out flag, out ex);
                    if (replayConfiguration != null)
                    {
                        if (flag)
                        {
                            activeConfigurations.Add(replayConfiguration);
                        }
                        else
                        {
                            passiveConfigurations.Add(replayConfiguration);
                        }
                    }
                }
            }
        }
Example #4
0
        private void CallMailboxAssociationReplicationAssistant(ADUser groupMailbox)
        {
            Exception ex = null;

            try
            {
                ActiveManager        activeManagerInstance = ActiveManager.GetActiveManagerInstance();
                DatabaseLocationInfo serverForDatabase     = activeManagerInstance.GetServerForDatabase(groupMailbox.Database.ObjectGuid);
                base.WriteVerbose("Group mailbox database is on server {0}", new object[]
                {
                    serverForDatabase.ServerFqdn
                });
                using (AssistantsRpcClient assistantsRpcClient = new AssistantsRpcClient(serverForDatabase.ServerFqdn))
                {
                    assistantsRpcClient.StartWithParams("MailboxAssociationReplicationAssistant", groupMailbox.ExchangeGuid, groupMailbox.Database.ObjectGuid, string.Empty);
                }
                base.WriteVerbose("Started update of the user mailboxes for the new ExternalDirectoryObjectId", new object[0]);
            }
            catch (RpcException ex2)
            {
                ex = ex2;
            }
            catch (LocalizedException ex3)
            {
                ex = ex3;
            }
            if (ex != null)
            {
                base.WriteVerbose("Failed to call RPC to MailboxAssociationReplicationAssistant due the following exception: {0}", new object[]
                {
                    ex
                });
                this.WriteWarning(Strings.WarningUnableToUpdateUserMailboxes);
            }
        }
        private void InternalValidateStoreMailboxIdentity()
        {
            TaskLogger.LogEnter();
            MailboxDatabase mailboxDatabase = (MailboxDatabase)base.GetDataObject <MailboxDatabase>(this.Database, base.GlobalConfigSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(this.Database.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(this.Database.ToString())), ExchangeErrorCategory.Client);

            if (mailboxDatabase.Recovery)
            {
                base.WriteError(new TaskArgumentException(Strings.ErrorInvalidOperationOnRecoveryMailboxDatabase(this.Database.ToString())), ExchangeErrorCategory.Client, this.StoreMailboxIdentity);
            }
            DatabaseLocationInfo databaseLocationInfo = null;

            try
            {
                databaseLocationInfo = ActiveManager.GetActiveManagerInstance().GetServerForDatabase(mailboxDatabase.Id.ObjectGuid);
            }
            catch (ObjectNotFoundException exception)
            {
                base.WriteError(exception, ExchangeErrorCategory.ServerOperation, null);
            }
            try
            {
                base.WriteVerbose(Strings.VerboseConnectionAdminRpcInterface(databaseLocationInfo.ServerFqdn));
                this.mapiSession = new MapiAdministrationSession(databaseLocationInfo.ServerLegacyDN, Fqdn.Parse(databaseLocationInfo.ServerFqdn));
            }
            catch (MapiPermanentException exception2)
            {
                base.WriteError(exception2, ExchangeErrorCategory.ServerOperation, null);
            }
            catch (MapiRetryableException exception3)
            {
                base.WriteError(exception3, ExchangeErrorCategory.ServerTransient, null);
            }
            this.database = mailboxDatabase;
            TaskLogger.LogExit();
        }
        public ActionResult ActivateManager(string managerid, int buildingid)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("ManagementBuilding", new { BuildingID = buildingid }));
            }


            var deleteanyentry = db.ActiveManager.Where(c => c.BuildingID == buildingid).ToList();


            ActiveManager ObjActiveManager = new ActiveManager()
            {
                BuildingID = buildingid,
                ManagerID  = managerid
            };

            if (db.ActiveManager.RemoveRange(deleteanyentry) != null)
            {
                db.ActiveManager.RemoveRange(deleteanyentry);
            }
            db.ActiveManager.Add(ObjActiveManager);
            db.SaveChanges();


            return(RedirectToAction("ManagementBuilding", new { BuildingID = buildingid }));
        }
Example #7
0
        private DatabaseLocationInfo GetServerForDatabase(ActiveManager activeManager, Guid dbGuid)
        {
            DatabaseLocationInfo result = null;

            try
            {
                result = activeManager.GetServerForDatabase(dbGuid);
            }
            catch (DatabaseNotFoundException)
            {
                base.WriteWarning(string.Format("Caught DatabaseNotFoundException when trying to get the server for database {0} from activemanager; will use the server info from AD.", dbGuid));
            }
            catch (ObjectNotFoundException)
            {
                base.WriteWarning(string.Format("Caught ObjectNotFoundException when trying to get the server for database {0} from activemanager; will use the server info from AD.", dbGuid));
            }
            catch (StoragePermanentException)
            {
                base.WriteWarning(string.Format("Caught StoragePermanentException when trying to get the server for database {0} from activemanager; will use the server info from AD.", dbGuid));
            }
            catch (StorageTransientException)
            {
                base.WriteWarning(string.Format("Caught StorageTransientException when trying to get the server for database {0} from activemanager; will use the server info from AD.", dbGuid));
            }
            return(result);
        }
Example #8
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter();
     if (this.unlockMoveTarget)
     {
         ActiveManager        activeManagerInstance = ActiveManager.GetActiveManagerInstance();
         DatabaseLocationInfo serverForDatabase     = activeManagerInstance.GetServerForDatabase(this.databaseObject.Guid);
         string serverFqdn = serverForDatabase.ServerFqdn;
         if (!this.DetectOnly)
         {
             UnlockMoveTargetUtil.UnlockMoveTarget(serverFqdn, this.databaseObject.Guid, this.mailboxGuid, this.organizationId);
             this.WriteResult(this.DataObject);
         }
     }
     else
     {
         StoreIntegrityCheckRequestFlags requestFlags           = this.GetRequestFlags();
         StoreIntegrityCheckJob          storeIntegrityCheckJob = StoreIntegrityCheckAdminRpc.CreateStoreIntegrityCheckJob(this.databaseObject, this.mailboxGuid, requestFlags, this.CorruptionType, new Task.TaskErrorLoggingDelegate(base.WriteError), new Task.TaskWarningLoggingDelegate(this.WriteWarning), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
         if (storeIntegrityCheckJob != null)
         {
             this.WriteResult(storeIntegrityCheckJob);
         }
     }
     TaskLogger.LogExit();
 }
Example #9
0
 private void Start()
 {
     PM  = GameObject.Find("PanelManager").GetComponent <PanelManager>();
     PLM = GameObject.Find("PlaceManager").GetComponent <PlaceManager>();
     GSM = GameObject.Find("SoundManager").GetComponent <GwentSoundManager>();
     AM  = GameObject.Find("ActiveManager").GetComponent <ActiveManager>();
 }
Example #10
0
        internal static bool CheckFullAccessPermissions(ADUser executingAdUser, ADUser accessRequestedForADUser, IRecipientSession session)
        {
            ExTraceGlobals.TaskTracer.TraceDebug <string, string>(0L, "Checking if {0} has full access for mailbox {1}", executingAdUser.Alias, accessRequestedForADUser.Alias);
            ActiveManager         activeManagerInstance = ActiveManager.GetActiveManagerInstance();
            DatabaseLocationInfo  serverForDatabase     = activeManagerInstance.GetServerForDatabase(accessRequestedForADUser.Database.ObjectGuid);
            RawSecurityDescriptor rawSecurityDescriptor = null;

            using (MapiMessageStoreSession mapiMessageStoreSession = new MapiMessageStoreSession(serverForDatabase.ServerLegacyDN, Server.GetSystemAttendantLegacyDN(serverForDatabase.ServerLegacyDN), Fqdn.Parse(serverForDatabase.ServerFqdn)))
            {
                MailboxId mailboxId = new MailboxId(new DatabaseId(accessRequestedForADUser.Database.ObjectGuid), accessRequestedForADUser.ExchangeGuid);
                try
                {
                    rawSecurityDescriptor = mapiMessageStoreSession.GetMailboxSecurityDescriptor(mailboxId);
                }
                catch (MailboxNotFoundException)
                {
                    ExTraceGlobals.TaskTracer.TraceDebug <MailboxId>(0L, "Could not find mailbox {0} when attempting to read its security descriptor.", mailboxId);
                    return(false);
                }
            }
            byte[] array = new byte[rawSecurityDescriptor.BinaryLength];
            rawSecurityDescriptor.GetBinaryForm(array, 0);
            ActiveDirectorySecurity activeDirectorySecurity = new ActiveDirectorySecurity();

            activeDirectorySecurity.SetSecurityDescriptorBinaryForm(array);
            int num = AuthzAuthorization.CheckGenericPermission(executingAdUser.Sid, rawSecurityDescriptor, AccessMask.CreateChild);

            return((num & 1) == 1);
        }
        private AmServerName GetCurrentActiveServer(Guid dbGuid)
        {
            ActiveManager        noncachingActiveManagerInstance = ActiveManager.GetNoncachingActiveManagerInstance();
            DatabaseLocationInfo serverForDatabase = noncachingActiveManagerInstance.GetServerForDatabase(dbGuid);

            return(new AmServerName(serverForDatabase.ServerFqdn));
        }
Example #12
0
        private ExRpcAdmin GetExRpcAdminForDatabase(DirectoryDatabase database)
        {
            ActiveManager        activeManager     = LoadBalanceADSettings.Instance.Value.UseCachingActiveManager ? ActiveManager.GetCachingActiveManagerInstance() : ActiveManager.GetNoncachingActiveManagerInstance();
            DatabaseLocationInfo serverForDatabase = activeManager.GetServerForDatabase(database.Guid, true);

            return(ExRpcAdmin.Create("Client=MSExchangeMailboxLoadBalance", serverForDatabase.ServerFqdn, null, null, null));
        }
Example #13
0
        internal static ADUser SplitArchiveFromPrimary(ADUser primaryUser, IRecipientSession recipientSession = null)
        {
            ADUser aduser = null;

            if (!primaryUser.ArchiveGuid.Equals(Guid.Empty))
            {
                aduser = new ADUser();
                aduser.StampPersistableDefaultValues();
                aduser.StampDefaultValues(RecipientType.UserMailbox);
                aduser.ResetChangeTracking();
                AuxMailboxTaskHelper.AuxMailboxStampDefaultValues(aduser);
                aduser.AddressListMembership = primaryUser.AddressListMembership;
                aduser.DisplayName           = string.Format("{0} {1}", Strings.ArchiveNamePrefix, primaryUser.DisplayName);
                aduser.OrganizationId        = primaryUser.OrganizationId;
                aduser.ExchangeGuid          = primaryUser.ArchiveGuid;
                aduser.Database = primaryUser.ArchiveDatabase;
                aduser.Alias    = RecipientTaskHelper.GenerateAlias(string.Format("{0}{1}", Strings.ArchiveNamePrefix, aduser.ExchangeGuid));
                aduser.Name     = string.Format("{0}{1}", Strings.ArchiveNamePrefix, primaryUser.ExchangeGuid);
                if (recipientSession == null)
                {
                    recipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(false, ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(primaryUser.OrganizationId), 74, "SplitArchiveFromPrimary", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Common\\recipient\\AuxMailboxTaskHelper.cs");
                }
                IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(false, ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(primaryUser.OrganizationId), 80, "SplitArchiveFromPrimary", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Common\\recipient\\AuxMailboxTaskHelper.cs");
                aduser.UserPrincipalName = RecipientTaskHelper.GenerateUniqueUserPrincipalName(recipientSession, aduser.Alias, tenantOrTopologyConfigurationSession.GetDefaultAcceptedDomain().DomainName.Domain, null);
                aduser.EmailAddresses.Add(new SmtpProxyAddress(aduser.UserPrincipalName, false));
                DatabaseLocationInfo serverForDatabase = ActiveManager.GetActiveManagerInstance().GetServerForDatabase(primaryUser.ArchiveDatabase.ObjectGuid);
                aduser.ServerLegacyDN = serverForDatabase.ServerLegacyDN;
                aduser.SetId(primaryUser.Id.Parent.GetChildId(aduser.Name));
            }
            return(aduser);
        }
Example #14
0
        internal static List <Database> PopulateDatabasesFromServer(ActiveManager activeManager, Server server, bool includePassive)
        {
            if (activeManager == null)
            {
                throw new ArgumentNullException("activeManager");
            }
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }
            List <Database>        list      = new List <Database>();
            IEnumerable <Database> databases = server.GetDatabases();

            if (databases != null)
            {
                foreach (Database database in databases)
                {
                    if (includePassive)
                    {
                        list.Add(database);
                    }
                    else
                    {
                        DatabaseLocationInfo serverForDatabase = activeManager.GetServerForDatabase(database.Guid);
                        if ((serverForDatabase != null && serverForDatabase.ServerGuid == server.Guid) || (serverForDatabase == null && database.Server.ObjectGuid == server.Guid))
                        {
                            list.Add(database);
                        }
                    }
                }
            }
            return(list);
        }
Example #15
0
        public static ReplayConfiguration GetLocalReplayConfiguration(Guid dbGuid, IADConfig adConfig, ActiveManager activeManager, out Exception ex)
        {
            ex = null;
            if (activeManager == null)
            {
                activeManager = ActiveManager.GetNoncachingActiveManagerInstance();
            }
            IADServer localServer = adConfig.GetLocalServer();

            if (localServer == null)
            {
                ex = new FailedToFindServerException("localmachine");
                ExTraceGlobals.ReplayManagerTracer.TraceError <Guid, Exception>(0L, "GetReplayConfiguration ({0}): didn't find any server object for the local machine: {1}", dbGuid, ex);
                return(null);
            }
            IADDatabase database = adConfig.GetDatabase(dbGuid);

            if (database == null)
            {
                ex = new FailedToFindDatabaseException(dbGuid.ToString());
                ExTraceGlobals.ReplayManagerTracer.TraceError <Guid>(0L, "GetReplayConfiguration ({0}): Didn't find any mailbox database object from AD.", dbGuid);
                return(null);
            }
            bool flag;
            ReplayConfiguration replayConfiguration = ReplayConfiguration.GetReplayConfiguration(adConfig.GetLocalDag(), database, localServer, activeManager, out flag, out ex);

            if (ex != null)
            {
                ExTraceGlobals.ReplayManagerTracer.TraceError <Guid, Exception>(0L, "GetReplayConfiguration ({0}): Error occurred constructing the ReplayConfiguration. Error: {1}", dbGuid, ex);
                return(null);
            }
            return(replayConfiguration);
        }
        // Token: 0x06000C41 RID: 3137 RVA: 0x00036478 File Offset: 0x00034678
        public static bool IsServerRcrSource(IADDatabase db, IADServer server, out DatabaseLocationInfo activeLocation)
        {
            ActiveManager noncachingActiveManagerInstance = ActiveManager.GetNoncachingActiveManagerInstance();

            activeLocation = noncachingActiveManagerInstance.GetServerForDatabase(db.Guid, GetServerForDatabaseFlags.BasicQuery);
            return(Cluster.StringIEquals(activeLocation.ServerFqdn, server.Fqdn));
        }
Example #17
0
        // Token: 0x06001208 RID: 4616 RVA: 0x00037FB4 File Offset: 0x000361B4
        internal static MailboxDatabaseWithLocationInfo FindDatabaseAndLocationForEnterpriseSiteMailbox(string domainController, LogMessageDelegate logger, ScopeSet scopeSet)
        {
            PhysicalResourceLoadBalancing.LogVerbose(Strings.VerboseLbEnterSiteMailboxEnterprise, logger);
            ITopologyConfigurationSession configSession = PhysicalResourceLoadBalancing.CreateGlobalConfigSession(domainController);
            List <MailboxDatabase>        databasesForProvisioningCached = PhysicalResourceLoadBalancing.GetDatabasesForProvisioningCached(configSession, false, logger);

            if (databasesForProvisioningCached.Count == 0)
            {
                PhysicalResourceLoadBalancing.LogVerbose(Strings.VerboseLbNoAvailableDatabase, logger);
                return(null);
            }
            List <MailboxDatabase> list = new List <MailboxDatabase>();

            foreach (MailboxDatabase mailboxDatabase in databasesForProvisioningCached)
            {
                if (mailboxDatabase.AdminDisplayVersion == null)
                {
                    mailboxDatabase.AdminDisplayVersion = Server.GetServerVersion(mailboxDatabase.ServerName);
                }
                if (mailboxDatabase.AdminDisplayVersion.Major >= PhysicalResourceLoadBalancing.MajorVersionE15)
                {
                    list.Add(mailboxDatabase);
                }
            }
            if (list.Count == 0)
            {
                PhysicalResourceLoadBalancing.LogVerbose(Strings.VerboseLbNoAvailableE15Database(databasesForProvisioningCached.Count), logger);
                return(null);
            }
            ActiveManager cachingActiveManagerInstance = ActiveManager.GetCachingActiveManagerInstance();
            Random        random = new Random();

            while (list.Count != 0)
            {
                int             index            = random.Next(list.Count);
                MailboxDatabase mailboxDatabase2 = list[index];
                list.RemoveAt(index);
                PhysicalResourceLoadBalancing.LogVerbose(Strings.VerboseLbGetServerForActiveDatabaseCopy(mailboxDatabase2.Name), logger);
                DatabaseLocationInfo serverForActiveDatabaseCopy = PhysicalResourceLoadBalancing.GetServerForActiveDatabaseCopy(mailboxDatabase2, cachingActiveManagerInstance, logger);
                if (serverForActiveDatabaseCopy != null)
                {
                    MailboxDatabaseWithLocationInfo mailboxDatabaseWithLocationInfo = new MailboxDatabaseWithLocationInfo(mailboxDatabase2, serverForActiveDatabaseCopy);
                    if (mailboxDatabase2.MasterType == MasterType.DatabaseAvailabilityGroup)
                    {
                        PhysicalResourceLoadBalancing.LogVerbose(Strings.VerboseLbRemoteSiteDatabaseReturned(mailboxDatabaseWithLocationInfo.MailboxDatabase.Name, mailboxDatabaseWithLocationInfo.DatabaseLocationInfo.ServerFqdn), logger);
                        return(mailboxDatabaseWithLocationInfo);
                    }
                    mailboxDatabaseWithLocationInfo = PhysicalResourceLoadBalancing.VerifyStatusAndSelectDB(new List <MailboxDatabaseWithLocationInfo>
                    {
                        mailboxDatabaseWithLocationInfo
                    }, domainController, logger, scopeSet);
                    if (mailboxDatabaseWithLocationInfo != null)
                    {
                        return(mailboxDatabaseWithLocationInfo);
                    }
                }
            }
            return(null);
        }
        public ActionResult DeactivateManager(string ManagerID, int BuildingID)
        {
            ActiveManager Obj = db.ActiveManager.Where(c => c.ManagerID == ManagerID).FirstOrDefault();

            db.ActiveManager.Remove(Obj);
            db.SaveChanges();
            return(RedirectToAction("ManagementBuilding", new { BuildingID = BuildingID }));
        }
Example #19
0
        // Token: 0x06000453 RID: 1107 RVA: 0x0000F6CC File Offset: 0x0000D8CC
        private static void GetServerForDatabase(Guid publicFolderDatabaseGuid, out string serverLegacyDn, out Fqdn serverFqdn)
        {
            ActiveManager        activeManagerInstance = ActiveManager.GetActiveManagerInstance();
            DatabaseLocationInfo serverForDatabase     = activeManagerInstance.GetServerForDatabase(publicFolderDatabaseGuid, GetServerForDatabaseFlags.ThrowServerForDatabaseNotFoundException);

            serverFqdn     = Fqdn.Parse(serverForDatabase.ServerFqdn);
            serverLegacyDn = serverForDatabase.ServerLegacyDN;
        }
Example #20
0
 public override void Register(ActiveManager manager)
 {
     base.Register(manager);
     if (LoadingScene.Instance != null)
     {
         LoadingScene.Instance.OnLoading += _OnLoading;
     }
 }
Example #21
0
    private void Start()
    {
        GSM = GameObject.Find("SoundManager").GetComponent <GwentSoundManager>();
        AM  = GameObject.Find("ActiveManager").GetComponent <ActiveManager>();
        CM  = GameObject.Find("CardManager").GetComponent <CardManager>();

        m_gr  = m_canvas.GetComponent <GraphicRaycaster>();
        m_ped = new PointerEventData(null);
    }
Example #22
0
 public override void Register(ActiveManager manager)
 {
     base.Register(manager);
     if (Machine == null)
     {
         Machine = StateMachines.Get <StateType>();
     }
     Machine.OnChange += Changed;
 }
        private bool IsFirstActiveMdbLocallyMounted()
        {
            IList <Database> list;

            if (!base.SourceMailboxServer.IsMailboxServer || !CrossPremiseTestMailFlowHelper.TryLoadAdObjects <Database>(base.Task.ConfigurationSession, this.adAdminGroups, out list))
            {
                return(false);
            }
            ActiveManager             cachingActiveManagerInstance = ActiveManager.GetCachingActiveManagerInstance();
            SortedList <Guid, string> sortedList = new SortedList <Guid, string>();

            try
            {
                foreach (Database database in list)
                {
                    DatabaseLocationInfo serverForDatabase = cachingActiveManagerInstance.GetServerForDatabase(database.Guid, GetServerForDatabaseFlags.None);
                    if (serverForDatabase != null && serverForDatabase.ServerSite != null && serverForDatabase.ServerSite.Equals(this.localSite) && !string.IsNullOrEmpty(serverForDatabase.ServerFqdn))
                    {
                        sortedList.Add(database.Guid, serverForDatabase.ServerFqdn);
                    }
                }
                using (IEnumerator <KeyValuePair <Guid, string> > enumerator2 = sortedList.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        KeyValuePair <Guid, string> kvp = enumerator2.Current;
                        Database database2 = list.ToList <Database>().Find(delegate(Database db)
                        {
                            Guid guid = db.Guid;
                            KeyValuePair <Guid, string> kvp3 = kvp;
                            return(guid == kvp3.Key);
                        });
                        Database mdb = database2;
                        KeyValuePair <Guid, string> kvp4 = kvp;
                        if (base.IsMdbMounted(mdb, kvp4.Value))
                        {
                            KeyValuePair <Guid, string> kvp2 = kvp;
                            return(kvp2.Value.Equals(base.SourceMailboxServer.Fqdn, StringComparison.OrdinalIgnoreCase));
                        }
                    }
                }
                return(false);
            }
            catch (ObjectNotFoundException ex)
            {
                base.Task.WriteWarning(Strings.CrossPremiseMapMdbToServerFailure(ex.ToString()));
            }
            catch (StoragePermanentException ex2)
            {
                base.Task.WriteWarning(Strings.CrossPremiseMapMdbToServerFailure(ex2.ToString()));
            }
            catch (StorageTransientException ex3)
            {
                base.Task.WriteWarning(Strings.CrossPremiseMapMdbToServerFailure(ex3.ToString()));
            }
            return(false);
        }
Example #24
0
    // ロード時に実行
    void Start()
    {
        g_Leo        = GameObject.Find("Leo");
        g_ActManager = GameObject.Find("ActiveManager");
        g_Script     = g_ActManager.GetComponent <ActiveManager>();

        f_Damage = 0.0f;
        b_Flag   = false;
    }
Example #25
0
 public override void Register(ActiveManager manager)
 {
     base.Register(manager);
     if (Currency != null)
     {
         Currency.OnSpendableChanged += OnChange;
     }
     Debug.Log($"Register New Stuff {this}");
 }
Example #26
0
        private static string GetServerFqdn(Guid databaseGuid)
        {
            DatabaseLocationInfo serverForDatabase = ActiveManager.GetCachingActiveManagerInstance().GetServerForDatabase(databaseGuid);

            if (serverForDatabase == null)
            {
                throw new MigrationMailboxDatabaseInfoNotAvailableException(databaseGuid.ToString());
            }
            return(serverForDatabase.ServerFqdn);
        }
        // Token: 0x06000C42 RID: 3138 RVA: 0x000364AC File Offset: 0x000346AC
        public static bool IsServerRcrSource(IADDatabase db, string serverName, ITopologyConfigurationSession adSession, out DatabaseLocationInfo activeLocation)
        {
            bool result;

            using (ActiveManager activeManager = ActiveManager.CreateCustomActiveManager(false, null, null, null, null, null, null, adSession, true))
            {
                activeLocation = activeManager.GetServerForDatabase(db.Guid, GetServerForDatabaseFlags.BasicQuery);
                result         = Cluster.StringIEquals(new AmServerName(activeLocation.ServerFqdn).NetbiosName, serverName);
            }
            return(result);
        }
        private static void ExecuteAdminRpc(Guid databaseGuid, Action <ExRpcAdmin, string> action, Task.TaskErrorLoggingDelegate writeError, Task.TaskWarningLoggingDelegate writeWarning, Task.TaskVerboseLoggingDelegate writeVerbose)
        {
            ActiveManager        activeManagerInstance = ActiveManager.GetActiveManagerInstance();
            DatabaseLocationInfo serverForDatabase     = activeManagerInstance.GetServerForDatabase(databaseGuid);
            string serverFqdn = serverForDatabase.ServerFqdn;

            using (ExRpcAdmin exRpcAdmin = ExRpcAdmin.Create("Client=Management", serverFqdn, null, null, null))
            {
                action(exRpcAdmin, serverFqdn);
            }
        }
Example #29
0
 private void Changed(object sender, StateChange <StateType> e)
 {
     if (RevertOnExit && e.Old != null && !States.Contains(e.Old.Value))
     {
         RevertState = e.Old.Value;
     }
     if (ActiveManager != null)
     {
         ActiveManager.Check();
     }
 }
Example #30
0
        private static Setting Load()
        {
            Setting setting = ActiveManager.GetSetting(Assembly.GetExecutingAssembly());

            if (setting == null)
            {
                setting = GetDefault();
            }

            return(setting);
        }