예제 #1
0
        public static clong Encode(long value)
        {
            long v = value;

            v ^= AntiCheat.Factor;
            v += AntiCheat.Factor;
            v  = ~v;
            return(new clong {
                value = v,
                check = AntiCheat.CalcCheck(value),
                inited = true
            });
        }
예제 #2
0
        public static cint Encode(int value)
        {
            int v = value;

            v ^= AntiCheat.Factor;
            v += AntiCheat.Factor;
            v  = ~v;
            return(new cint {
                value = v,
                check = AntiCheat.CalcCheck(value),
                inited = true
            });
        }
예제 #3
0
 public static long Decode(clong value)
 {
     if (value.inited)
     {
         long v = value.value;
         v  = ~v;
         v -= AntiCheat.Factor;
         v ^= AntiCheat.Factor;
         if (value.check == AntiCheat.CalcCheck(v))
         {
             return(v);
         }
         else
         {
             AntiCheat.InvokeOnCheat();
         }
     }
     return(0);
 }