Exemplo n.º 1
0
        public virtual void initialServerSalt(long salt)
        {
            int validSince = (int)(((ulong)TimeOverlord.getInstance().getServerTime()) / 0x3e8L);

            KnownSalt[] ksarr = new KnownSalt[] { new KnownSalt(validSince, validSince + 0x708, salt) };
            this.writeKnownSalts(ksarr);
        }
Exemplo n.º 2
0
        public virtual void addCurrentSalt(long salt)
        {
            int validSince = (int)(((ulong)TimeOverlord.getInstance().getServerTime()) / 0x3e8L);

            KnownSalt[] salts = new KnownSalt[] { new KnownSalt(validSince, validSince + 0x708, salt) };
            this.mergeKnownSalts(validSince, salts);
        }
Exemplo n.º 3
0
        public virtual long findActualSalt(int time)
        {
            KnownSalt[] saltArray2 = this.readKnownSalts();
            int         length     = saltArray2.Length;

            for (int i = 0; i < length; i++)
            {
                KnownSalt salt = saltArray2[i];
                if ((salt.getValidSince() <= time) && (time <= salt.getValidUntil()))
                {
                    return(salt.getSalt());
                }
            }
            return(0L);
        }
Exemplo n.º 4
0
        public virtual int maximumCachedSalts(int time)
        {
            int num = 0;

            KnownSalt[] saltArray = this.readKnownSalts();
            int         length    = saltArray.Length;

            for (int i = 0; i < length; i++)
            {
                KnownSalt salt = saltArray[i];
                if (salt.getValidSince() > time)
                {
                    num++;
                }
            }
            return(num);
        }