Пример #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ConfigId != 0)
            {
                hash ^= ConfigId.GetHashCode();
            }
            hash ^= skills_.GetHashCode();
            if (FinalAttack != 0)
            {
                hash ^= FinalAttack.GetHashCode();
            }
            if (FinalDefence != 0)
            {
                hash ^= FinalDefence.GetHashCode();
            }
            if (FinalHealth != 0)
            {
                hash ^= FinalHealth.GetHashCode();
            }
            if (FinalActionSpeed != 0)
            {
                hash ^= FinalActionSpeed.GetHashCode();
            }
            return(hash);
        }
 internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data)
 {
     byte[] o = null;
     bool flag = GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack<byte[]>(ref o));
     data = o;
     return flag;
 }
Пример #3
0
        internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data)
        {
            byte[] o    = null;
            bool   flag = GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack <byte[]>(ref o));

            data = o;
            return(flag);
        }
Пример #4
0
        internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data)
        {
            byte[] array      = null;
            bool   cacheEntry = Config.GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack <byte[]>(ref array));

            data = array;
            return(cacheEntry);
        }
Пример #5
0
        [System.Security.SecurityCritical]  // auto-generated
        internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data)
        {
            byte[] retData = null;
            bool   ret     = GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack(ref retData));

            data = retData;
            return(ret);
        }
Пример #6
0
        internal static String GetStoreLocation(ConfigId configId)
        {
            if (configId == ConfigId.None)
            {
                return(null);
            }

            return(_GetStoreLocation(configId));
        }
Пример #7
0
            public override int GetHashCode()
            {
                const int prime  = 31;
                int       result = 17;

                result = prime * result + Type.GetHashCode();
                result = prime * result + ConfigId.GetHashCode();
                result = prime * result + InstanceId.GetHashCode();
                return(result);
            }
Пример #8
0
        /// <summary>
        /// GetHashCode
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            var hashCode = -1268746195;

            hashCode = hashCode * -1521134295 + InputId.GetHashCodeWithNullCheck();
            hashCode = hashCode * -1521134295 + ConfigId.GetHashCodeWithNullCheck();
            hashCode = hashCode * -1521134295 + Error.GetHashCodeWithNullCheck();
            hashCode = hashCode * -1521134295 + Coverage.GetHashCodeWithNullCheck();
            return(hashCode);
        }
Пример #9
0
        internal static void AddCacheEntry(ConfigId id, int numKey, byte[] key, byte[] data)
        {
            int num     = (int)id;
            int numKey1 = numKey;

            byte[] key1    = key;
            int    length1 = key1.Length;

            byte[] data1   = data;
            int    length2 = data1.Length;

            Config.AddCacheEntry((ConfigId)num, numKey1, key1, length1, data1, length2);
        }
Пример #10
0
        internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data)
        {
            byte[] o       = (byte[])null;
            int    num1    = (int)id;
            int    numKey1 = numKey;

            byte[] key1   = key;
            int    length = key1.Length;
            ObjectHandleOnStack objectHandleOnStack = JitHelpers.GetObjectHandleOnStack <byte[]>(ref o);
            int num2 = Config.GetCacheEntry((ConfigId)num1, numKey1, key1, length, objectHandleOnStack) ? 1 : 0;

            data = o;
            return(num2 != 0);
        }
Пример #11
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ConfigId != 0)
            {
                hash ^= ConfigId.GetHashCode();
            }
            if (Level != 0)
            {
                hash ^= Level.GetHashCode();
            }
            return(hash);
        }
Пример #12
0
        public static ConfigId GetNextConfigId()
        {
            ConfigId id;

            lock (_sharedStatics)
            {
                if (m_currentConfigId == 0)
                {
                    m_currentConfigId = ConfigId.Reserved;
                }
                id = m_currentConfigId++;
            }

            return(id);
        }
Пример #13
0
            public override int Compare(ObjectId x, ObjectId y)
            {
                int c = Type.CompareTo(x.Type);

                if (c != 0)
                {
                    return(c);
                }
                c = ConfigId.CompareTo(x.ConfigId);
                if (c != 0)
                {
                    return(c);
                }
                return(InstanceId.CompareTo(x.InstanceId));
            }
Пример #14
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ConfigId.Length != 0)
            {
                hash ^= ConfigId.GetHashCode();
            }
            if (tapConfig_ != null)
            {
                hash ^= TapConfig.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public ActionResult Logout()
        {
            ConfigId.ClearStoreItem();
            //var cookieConfig = Request.Cookies["id_config"];
            //if (cookieConfig != null) cookieConfig.Expires = DateTime.Now;

            var cookieJob = Request.Cookies["id_job"];

            if (cookieJob != null)
            {
                cookieJob.Expires = DateTime.Now;
            }

            authenticationService.LogOff();
            SessionContainer.Remove();
            //var cookieFranchise = Request.Cookies["franchise_id"];
            //if (cookieFranchise != null) cookieFranchise.Expires = DateTime.Now.AddDays(7);

            return(Json(new { result = "success" }));
        }
Пример #16
0
        static public PolicyLevel LoadPolicyLevelFromFile(String path, PolicyLevelType type)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            ConfigId id = SharedStatics.GetNextConfigId();

            ConfigRetval retval = Config.InitData(id, path);

            if ((retval & ConfigRetval.ConfigFile) == 0)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_PolicyFileDoesNotExist"));
            }

            String name = Enum.GetName(typeof(PolicyLevelType), type);

            if (name == null)
            {
                return(null);
            }

            String fullPath = Path.GetFullPath(path);

            FileIOPermission perm = new FileIOPermission(PermissionState.None);

            perm.AddPathList(FileIOPermissionAccess.Read, fullPath);
            perm.AddPathList(FileIOPermissionAccess.Write, fullPath);
            perm.Demand();

            PolicyLevel level = new PolicyLevel(name, id, type == PolicyLevelType.Machine);

            level.ThrowOnLoadError = true;
            level.CheckLoaded(false);
            return(level);
        }
Пример #17
0
 private static extern bool _SaveDataByte( ConfigId id, byte[] data, int offset, int length );
Пример #18
0
 internal static bool SaveData( ConfigId id, byte[] data, int offset, int length )
 {
     return _SaveDataByte( id, data, offset, length );
 }
Пример #19
0
 internal static bool SaveData( ConfigId id, String data )
 {
     return _SaveDataString( id, data );
 }
Пример #20
0
 internal static extern void SaveCacheData( ConfigId id );
Пример #21
0
 internal static ConfigRetval InitData( ConfigId id, String configFile, String cacheFile )
 {
     return _InitDataEx( id, configFile, cacheFile );
 }
Пример #22
0
 internal PolicyLevel( String label, ConfigId id, bool useDefaultCodeGroupOnReset, bool generateQuickCacheOnLoad )
 {
     m_configId = id;
     m_label = label;
     m_rootCodeGroup = null;
     m_loaded = false;
     m_caching = (id != ConfigId.None);
     m_useDefaultCodeGroupsOnReset = useDefaultCodeGroupOnReset;
     m_generateQuickCacheOnLoad = generateQuickCacheOnLoad;
 }
Пример #23
0
        internal static String GetStoreLocation( ConfigId configId )
        {
            if (configId == ConfigId.None)
            {
                return null;
            }

            return _GetStoreLocation( configId );
        }
Пример #24
0
 internal static extern byte[] GetData(ConfigId id);
Пример #25
0
 private static extern bool _SaveDataByte(ConfigId id, byte[] data, int offset, int length);
Пример #26
0
 private static extern bool _SaveDataString(ConfigId id, String data);
Пример #27
0
 internal static bool SaveData(ConfigId id, byte[] data, int offset, int length)
 {
     return(_SaveDataByte(id, data, offset, length));
 }
Пример #28
0
        public static ConfigId GetNextConfigId()
        {
            ConfigId id;

            lock (_sharedStatics)
            {
                if (m_currentConfigId == 0)
                    m_currentConfigId = ConfigId.Reserved;
                id = m_currentConfigId++;
            }
            
            return id;
        }
Пример #29
0
 internal PolicyLevel( PolicyLevel level )
 {
     m_configId = level.m_configId;
     m_label = level.m_label;
     m_rootCodeGroup = level.RootCodeGroup;
     m_loaded = true;
     m_caching = level.m_caching;
     m_useDefaultCodeGroupsOnReset = level.m_useDefaultCodeGroupsOnReset;
     m_namedPermissionSets = (ArrayList)level.NamedPermissionSets;
     m_fullTrustAssemblies = (ArrayList)level.FullTrustAssemblies;
     m_encoding = level.m_encoding;
     m_generateQuickCacheOnLoad = false;
 }
Пример #30
0
 internal static extern QuickCacheEntryType GetQuickCacheEntry( ConfigId id );
Пример #31
0
 internal static extern bool GetCacheEntry( ConfigId id, int numKey, char[] key, out char[] data );
Пример #32
0
 internal static extern QuickCacheEntryType GetQuickCacheEntry(ConfigId id);
Пример #33
0
 internal PolicyLevel (PolicyLevelType type, string path, ConfigId configId) {
     m_type = type;
     m_path = path;
     m_loaded = (path == null);
     if (m_path == null) {
         m_rootCodeGroup = CreateDefaultAllGroup();
         SetFactoryPermissionSets();
         SetDefaultFullTrustAssemblies();
     }
     m_configId = configId;
 }
Пример #34
0
 internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType cache);
Пример #35
0
 internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags);
Пример #36
0
 internal static extern bool GetCacheEntry(ConfigId id, int numKey, char[] key, out char[] data);
Пример #37
0
 private static extern ConfigRetval _InitDataEx( ConfigId id, String configFile, String cacheFile );
Пример #38
0
 internal static extern void AddCacheEntry(ConfigId id, int numKey, char[] key, char[] data);
Пример #39
0
 internal static extern void ClearCacheData( ConfigId id );
Пример #40
0
 [System.Security.SecurityCritical]  // auto-generated
 internal static void AddCacheEntry(ConfigId id, int numKey, byte[] key, byte[] data)
 {
     AddCacheEntry(id, numKey, key, key.Length, data, data.Length);
 }
Пример #41
0
 internal static bool SaveData( ConfigId id, byte[] data )
 {
     return _SaveDataByte( id, data, 0, data.Length );
 }
Пример #42
0
 internal static extern bool RecoverData(ConfigId id);
Пример #43
0
 private static extern bool _SaveDataString( ConfigId id, String data );
Пример #44
0
 private static extern bool GetCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, ObjectHandleOnStack retData);
Пример #45
0
 internal static extern byte[] GetData( ConfigId id );
Пример #46
0
 internal PolicyLevel( String label )
 {
     m_configId = ConfigId.None;
     SetFactoryPermissionSets();
     SetDefaultFullTrustAssemblies();
     m_loaded = true;
     m_rootCodeGroup = CreateDefaultAllGroup();
     m_label = label;
     m_caching = false;
     m_useDefaultCodeGroupsOnReset = false;
     m_generateQuickCacheOnLoad = false;
 }
Пример #47
0
 internal static extern void SetQuickCache( ConfigId id, QuickCacheEntryType cache );
Пример #48
0
 private static extern bool GetCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, ObjectHandleOnStack retData);
Пример #49
0
 internal static extern void AddCacheEntry( ConfigId id, int numKey, char[] key, char[] data );
Пример #50
0
 internal static extern bool RecoverData(ConfigId id);
Пример #51
0
 private static extern String _GetStoreLocation( ConfigId configId );
Пример #52
0
 internal static extern void ResetCacheData(ConfigId id);
Пример #53
0
 private static extern void AddCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, byte[] data, int dataLength);
Пример #54
0
 internal PolicyLevel( String label, ConfigId id, bool useDefaultCodeGroupOnReset )
     : this( label, id, useDefaultCodeGroupOnReset, false )
 {
 }
Пример #55
0
 internal static extern void ResetCacheData(ConfigId id);
Пример #56
0
 private static extern String _GetStoreLocation(ConfigId configId);
Пример #57
0
 internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags);
Пример #58
0
 internal static void AddCacheEntry(ConfigId id, int numKey, byte[] key, byte[] data)
 {
     AddCacheEntry(id, numKey, key, key.Length, data, data.Length);
 }
Пример #59
0
        [System.Security.SecurityCritical]  // auto-generated
        internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data)
        {
            byte[] retData = null;
            bool ret = GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack(ref retData));

            data = retData;
            return ret;
        }
Пример #60
0
 private static extern void AddCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, byte[] data, int dataLength);