public void Salas(User user, Readers ler) { byte Tipo = ler.Byte(); int Numero = 0; PacketManager Write = new PacketManager(); foreach (Sala Sala in ListaDeSalas) { if (Tipo == 1) { } Numero++; } Write.OP(17); Write.Int(Numero); foreach (Sala Sala in ListaDeSalas) { Write.Byte(0); Write.Short(Sala.SalaID); Write.UStr(Sala.SalaNome); if (Sala.SalaSenha.Length > 0) { Write.Byte(0); } else { Write.Byte(1); } Write.Byte(0); Write.UStr(Sala.SalaSenha); Write.Short((short)(Sala.PlayersEmSala() + Sala.slotsAbertos())); Write.Short((short)Sala.PlayersEmSala()); Write.Boolean(Sala.jogando); Write.Hex("2E 02 1B 25 01 00 00 00 00 01 6B F9 38 77 00 00 00 0C 00 00 00 00 00 00 00 01"); Write.UStr(Sala.ObterSessao().pInfo.nickname); Write.Hex("0B 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 01"); } user.Send(Write.ack); }
public void Salas(User user, Readers ler) { byte Tipo = ler.Byte(); int Numero = 0; PacketManager Write = new PacketManager(); foreach (Sala Sala in Ultilize.ListaDeSalas) { if (Tipo == 1) { if (Sala.jogando == true || Sala.slotsAbertos() == 0) { continue; } } Numero++; } Write.OP(17); Write.Int(Numero); foreach (Sala Sala in Ultilize.ListaDeSalas) { Write.Short(Sala.SalaID); Write.UStr(Sala.SalaNome); if (Sala.SalaSenha.Length > 0) { Write.Byte(0); } else { Write.Byte(1); } Write.Byte(0); Write.UStr(Sala.SalaSenha); Write.Short((short)(Sala.PlayersEmSala() + Sala.slotsAbertos())); Write.Short((short)Sala.PlayersEmSala()); if (Sala.jogando == true) { Write.Byte(1); } else { Write.Byte(0); } Write.Hex("FC 7B 96 8B 0B 02 00 00 00 07 22 FC 68 7F 00 00 00 03 00 00 00 00 00 00 00 01"); Write.UStr(Sala.ObterSessao().pInfo.nickname); Write.Hex("0B 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 04 5A 00 5A 00 00 00 00 00 00 00 00 00 00 00 00 07 FF"); } int buffersize = Write.ack.Length - 7; byte[] getComprimir = new byte[0]; Array.Resize(ref getComprimir, Write.ack.Length - 7); Array.Copy(Write.ack, 7, getComprimir, 0, Write.ack.Length - 7); byte[] temp1 = GCNet.CoreLib.ZLib.CompressData(getComprimir); PacketManager Write2 = new PacketManager(); Write2.OP(17); Write2.Hex("00 00 00 00 00 00 00 00 00 00 00 01"); Write2.Int(temp1.Length + 4); Write2.Byte(1); Write2.Bytes(BitConverter.GetBytes(buffersize)); Write2.Hex(BitConverter.ToString(temp1).Replace("-", " ")); user.Send(Write2.ack); }