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;
 }
        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);
        }
        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);
        }
Exemple #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);
        }
Exemple #6
0
        internal static String GetStoreLocation(ConfigId configId)
        {
            if (configId == ConfigId.None)
            {
                return(null);
            }

            return(_GetStoreLocation(configId));
        }
Exemple #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);
            }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (ConfigId != 0)
            {
                hash ^= ConfigId.GetHashCode();
            }
            if (Level != 0)
            {
                hash ^= Level.GetHashCode();
            }
            return(hash);
        }
Exemple #12
0
        public static ConfigId GetNextConfigId()
        {
            ConfigId id;

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

            return(id);
        }
Exemple #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));
            }
        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" }));
        }
        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);
        }
Exemple #17
0
 private static extern bool _SaveDataByte( ConfigId id, byte[] data, int offset, int length );
Exemple #18
0
 internal static bool SaveData( ConfigId id, byte[] data, int offset, int length )
 {
     return _SaveDataByte( id, data, offset, length );
 }
Exemple #19
0
 internal static bool SaveData( ConfigId id, String data )
 {
     return _SaveDataString( id, data );
 }
Exemple #20
0
 internal static extern void SaveCacheData( ConfigId id );
Exemple #21
0
 internal static ConfigRetval InitData( ConfigId id, String configFile, String cacheFile )
 {
     return _InitDataEx( id, configFile, cacheFile );
 }
Exemple #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;
 }
Exemple #23
0
        internal static String GetStoreLocation( ConfigId configId )
        {
            if (configId == ConfigId.None)
            {
                return null;
            }

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

            lock (_sharedStatics)
            {
                if (m_currentConfigId == 0)
                    m_currentConfigId = ConfigId.Reserved;
                id = m_currentConfigId++;
            }
            
            return id;
        }
Exemple #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;
 }
Exemple #30
0
 internal static extern QuickCacheEntryType GetQuickCacheEntry( ConfigId id );
Exemple #31
0
 internal static extern bool GetCacheEntry( ConfigId id, int numKey, char[] key, out char[] data );
Exemple #32
0
 internal static extern QuickCacheEntryType GetQuickCacheEntry(ConfigId id);
 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;
 }
Exemple #34
0
 internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType cache);
 internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags);
Exemple #36
0
 internal static extern bool GetCacheEntry(ConfigId id, int numKey, char[] key, out char[] data);
Exemple #37
0
 private static extern ConfigRetval _InitDataEx( ConfigId id, String configFile, String cacheFile );
Exemple #38
0
 internal static extern void AddCacheEntry(ConfigId id, int numKey, char[] key, char[] data);
Exemple #39
0
 internal static extern void ClearCacheData( ConfigId id );
Exemple #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);
 }
Exemple #41
0
 internal static bool SaveData( ConfigId id, byte[] data )
 {
     return _SaveDataByte( id, data, 0, data.Length );
 }
Exemple #42
0
 internal static extern bool RecoverData(ConfigId id);
Exemple #43
0
 private static extern bool _SaveDataString( ConfigId id, String data );
Exemple #44
0
 private static extern bool GetCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, ObjectHandleOnStack retData);
Exemple #45
0
 internal static extern byte[] GetData( ConfigId id );
Exemple #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;
 }
Exemple #47
0
 internal static extern void SetQuickCache( ConfigId id, QuickCacheEntryType cache );
 private static extern bool GetCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, ObjectHandleOnStack retData);
Exemple #49
0
 internal static extern void AddCacheEntry( ConfigId id, int numKey, char[] key, char[] data );
 internal static extern bool RecoverData(ConfigId id);
Exemple #51
0
 private static extern String _GetStoreLocation( ConfigId configId );
 internal static extern void ResetCacheData(ConfigId id);
Exemple #53
0
 private static extern void AddCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, byte[] data, int dataLength);
Exemple #54
0
 internal PolicyLevel( String label, ConfigId id, bool useDefaultCodeGroupOnReset )
     : this( label, id, useDefaultCodeGroupOnReset, false )
 {
 }
Exemple #55
0
 internal static extern void ResetCacheData(ConfigId id);
Exemple #56
0
 private static extern String _GetStoreLocation(ConfigId configId);
Exemple #57
0
 internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags);
 internal static void AddCacheEntry(ConfigId id, int numKey, byte[] key, byte[] data)
 {
     AddCacheEntry(id, numKey, key, key.Length, data, data.Length);
 }
Exemple #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;
        }
 private static extern void AddCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, byte[] data, int dataLength);