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 }); }
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 }); }
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); }