Пример #1
0
        private int?GetGeneration(Common.Cryptography.ISAAC state, ClientPacket packet)
        {
            int gen = 0;

            if (GetFutureGeneration(state.Copy(), packet, ref gen, 10))
            {
                return(gen);
            }
            if (GetPastGeneration(state.Copy(), packet, ref gen, 10))
            {
                return(gen);
            }
            return(null);
        }
Пример #2
0
        private bool GetFutureGeneration(Common.Cryptography.ISAAC state, ClientPacket packet, ref int Generation, int limit)
        {
            limit--;
            if (limit < 1)
            {
                return(false);
            }
            Generation++;
            uint x = state.GetOffset();

            if (packet.VerifyChecksum(x))
            {
                return(true);
            }
            else
            {
                return(GetFutureGeneration(state, packet, ref Generation, limit));
            }
        }
Пример #3
0
 private Common.Cryptography.ISAAC GetGeneration(Common.Cryptography.ISAAC current, int cursor)
 {
     if (cursor > 0)
     {
         for (int i = 0; i < cursor; i++)
         {
             current.GetOffset();
         }
         return(current);
     }
     else if (cursor < 0)
     {
         for (int i = 0; i > cursor; i--)
         {
             current = current.Parent;
         }
         return(current);
     }
     else if (cursor == 0)
     {
         return(current);
     }
     return(null);
 }