public static byte[] getCode132(byte[] data, DateTime time, int round, int slot) { using (SendPacket s = new SendPacket()) { byte[] actions = getBaseData132(data); s.writeC(132); //opcode s.writeC((byte)slot); //slot s.writeT(AllUtils.GetDuration(time)); s.writeC((byte)round); s.writeH((ushort)(13 + actions.Length)); //lengthActionData s.writeD(0); s.writeB(AllUtils.encrypt(actions, (13 + actions.Length) % 6 + 1)); return(s.mstream.ToArray()); } }
public static byte[] getCode132(byte[] data, DateTime time, int round, int slot) { using (SendPacket sendPacket = new SendPacket()) { byte[] baseData132 = Packet132Creator.getBaseData132(data); sendPacket.writeC((byte)132); sendPacket.writeC((byte)slot); sendPacket.writeT(AllUtils.GetDifferenceBetweenDate(time)); sendPacket.writeC((byte)round); sendPacket.writeH((ushort)(13 + baseData132.Length)); sendPacket.writeD(0); sendPacket.writeB(AllUtils.encrypt(baseData132, (13 + baseData132.Length) % 6 + 1)); return(sendPacket.mstream.ToArray()); } }
/// <summary> /// Gera um código do protocolo 4 com os dados desencriptados. /// </summary> /// <param name="actions">Ações (Não-Encriptadas)</param> /// <param name="date">Data da sala</param> /// <param name="round">Rodada da partida</param> /// <param name="slot">Slot do jogador; 255 (Todos)</param> /// <returns></returns> public static byte[] getCode4(byte[] actions, DateTime date, int round, int slot) { byte[] encrypted = AllUtils.encrypt(actions, (13 + actions.Length) % 6 + 1); return(BaseGetCode4(encrypted, date, round, slot)); }
public static byte[] getCode4(byte[] actions, DateTime date, int round, int slot) { return(Packet4Creator.BaseGetCode4(AllUtils.encrypt(actions, (13 + actions.Length) % 6 + 1), date, round, slot)); }