ALFA.Database.ACR_GetPersistentInt C# (CSharp) Метод

ACR_GetPersistentInt() публичный Метод

Retrieve an int from the persistent store.
public ACR_GetPersistentInt ( UInt32 Object, string VarName ) : int
Object System.UInt32 Supplies the object whose persistent store is /// to be accessed.
VarName string Supplies the variable keyword to query.
Результат int
        public int ACR_GetPersistentInt(UInt32 Object, string VarName)
        {
            string Data = ACR_GetPersistentString(Object, VarName);

            try
            {
                if (Data == "")
                    return 0;
                else
                    return Convert.ToInt32(Data);
            }
            catch
            {
                return 0;
            }
        }

Usage Example

        /// <summary>
        /// Convert legacy database settings to their new format.
        /// </summary>
        private void UpgradeLegacySettings()
        {
            ALFA.Database Database = Communicator.GetDatabase();

            //
            // If the user has the old ACR_DISABLE_CROSS_SERVER_NOTIFICATIONS
            // value set from the pre-1.85 release, clear that variable and set
            // the flags bitmap as appropriate.
            //

            if (Database.ACR_GetPersistentInt(ObjectId, "ACR_DISABLE_CROSS_SERVER_NOTIFICATIONS") != CLRScriptBase.FALSE)
            {
                StateFlags |= PlayerStateFlags.DisableCrossServerNotifications;
                Database.ACR_DeletePersistentVariable(ObjectId, "ACR_DISABLE_CROSS_SERVER_NOTIFICATIONS");
            }
        }
All Usage Examples Of ALFA.Database::ACR_GetPersistentInt