public void userlist(User user) { PacketManager Write = new PacketManager(); Write.OP(19); Write.Int(Ultilize.LobbyListaDePlayers.Count); for (int a = 0; a < Ultilize.LobbyListaDePlayers.Count; a++) { User temp = Ultilize.LobbyListaDePlayers[a]; Write.Int(temp.pInfo.userid); Write.UStr(temp.pInfo.usuario); Write.Byte(11); Write.Byte(0); } 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(19); 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); }
public void EquipItem(User user, CharsInfo charsInfo, string usuario, int userid) { PacketManager Write = new PacketManager(); Write.OP(64); Write.UStr(user.pInfo.usuario); Write.Byte(0); Write.Int(charsInfo.personagems.Length); for (int a = 0; a < charsInfo.personagems.Length; a++) { Write.Byte((byte)charsInfo.personagems[a].personagemid); Write.Int(charsInfo.personagems[a].equipamentos.Length); for (int b = 0; b < charsInfo.personagems[a].equipamentos.Length; b++) { Write.Int(charsInfo.personagems[a].equipamentos[b].itemid); Write.Int(1); Write.Int(charsInfo.personagems[a].equipamentos[b].itemuid); Write.Int(65536); Write.Int(0); Write.Int(0); Write.Int(256); Write.Byte(0); Write.Byte(0); Write.Byte(0); } Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 76 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); } Write.Int(user.pInfo.userid); Write.Short(0); user.Send(Write.ack); }
public void rungame(User user) { PacketManager Write = new PacketManager(); Write.OP(38); Write.Int(0); Write.Int(1379592610); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); Write.Int(playersInSala); Write.Int(user.pInfo.userid); Write.Int(149246); Write.Int(playersInSala); Write.Int(user.pInfo.userid); Write.Hex("00 00 01 04 00 00 00 6A"); Write.Int(0); Write.Int(user.pInfo.userid); Write.Hex("00 00 00 00 00 00 00"); Write.Byte(Match); Write.Int(Game); Write.Boolean(false); Write.Int(Map); Write.Hex("00 00 00 00 FF FF FF FF 00 00 00 01 00 00 00"); Write.Short((short)playersInSala); Write.Short((short)FreeSlot); Write.Boolean(false); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 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 00 00 00 00"); Write.Short((short)playersInSala); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); user.Send(Write.ack); }
public void GetInventory(User user, int userid) { GetInventoryFromDB(userid); PacketManager Write = new PacketManager(); Write.OP(224); Write.Int(1); Write.Int(1); Write.Int(getLength()); for (Int32 a = 0; a < getLength(); a++) { Write.Int(lenInvetario[a].itemid); Write.Int(1); Write.Int(lenInvetario[a].itemuid); Write.Int(lenInvetario[a].quantidade); Write.Int(-1); Write.Int(0); Write.Short(0); Write.Int(-1); Write.Int(0); Write.Int(1450577322); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Byte(0); } user.Send(Write.ack); }
public void JoinRoomInfo(User user, Sala sala) { PacketManager Write = new PacketManager(); Write.OP(1554); Write.Byte(0); Write.Short(sala.SalaID); Write.UStr(sala.SalaNome); Write.Byte(0); if (sala.SalaSenha.Length > 0) { Write.Byte(1); } else { Write.Byte(0); } Write.UStr(sala.SalaSenha); Write.Short((short)sala.PlayersEmSala()); Write.Short((short)sala.slotsAbertos()); Write.Hex("00 0B"); Write.Byte((byte)sala.MatchMode); Write.Int(sala.GameMode); Write.Int(sala.ITMode); Write.Boolean(sala.RndMap); Write.Int(sala.Map); Write.Int(12); for (int a = 0; a < sala.MaxJogadores; a++) { Write.Boolean(sala.slotslen[a].aberto); } Write.Hex("FF FF FF FF 00 00 00 00 00 00 00 00 01"); Write.Hex(Ultilize.IpHex); Write.Short((short)9600); Write.Hex(Ultilize.IpHex); Write.Short((short)9700); Write.Hex("01 00 01 00 00 01 2C 00 00 00 14 00 02 4B 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 01 00 00 00 00"); user.Send(Write.ack); RoomInfoDivide(user); Ultilize.LobbyListaDePlayers.Remove(user); return; }
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 logar(User user, Readers Ler) { db.DBConnect data = new db.DBConnect(); DataSet Banco = new DataSet(); string usuario = Ler.String(); string senha = Ler.String(); pInfo.usuario = usuario; pInfo.senha = senha; PacketManager Write = new PacketManager(); Write.OP(3); Write.Header(); data.Exec(Banco, "SELECT `userid`, `online`, `ban`, `moderador` FROM `contas` WHERE `usuario` = '" + usuario + "' AND `senha` = '" + senha + "'"); if (Banco.Tables[0].Rows.Count > 0) { ENU_SERVER_LIST_NOT.serverlistload(user); //Send ServerList ENU_CHANNEL_NEWS_NOT.Noticias(user); //Send Channel News ENU_NEW_CLIENT_CONTENTS_OPEN_NOT.ClientContents(user); //Send Client Contents ENU_SOCKET_TABLE_INFO_NOT.SocketTable(user); //Send SocketTable ENU_CASHBACK_RATIO_INFO_NOT.CashBack(user); //Send CashBack pInfo.userid = Convert.ToInt32(Banco.Tables[0].Rows[0][0].ToString()); pInfo.online = Convert.ToInt32(Banco.Tables[0].Rows[0][1].ToString()); pInfo.ban = Convert.ToInt32(Banco.Tables[0].Rows[0][2].ToString()); pInfo.moderador = Convert.ToInt32(Banco.Tables[0].Rows[0][3].ToString()); Write.Int(0); Write.UStr(usuario); Write.Str(senha); Write.Byte(0); Write.Hex("00 00 00 14 00 8E A7 C5 01 00 00 00 00 00 00 02 4B 52 00 05 A3 BD 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00"); Write.UStr(MarksURL); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00 00 64 01 00 00 00 00 00 00 00 64 02 00 00 00 00 00 00 00 64 01 BF 80 00 00 FC 04 97 FF 00 00 00 00 00 00 00 00 00 00 00 00 00"); user.Send(Write.ack); } else { Write.Int(20); Write.UStr(usuario); Write.Int(0); user.Send(Write.ack); } }
private void EnviarLobby(User user, string texto) { PacketManager Write = new PacketManager(); Write.OP(7); Write.Byte(1); Write.Int(user.pInfo.userid); Write.UStr(user.pInfo.nickname); Write.Int(0); Write.Int(0); Write.Int(-1); Write.UStr(texto); Write.Int(0); Write.Int(0); for (int gg = 0; gg < Ultilize.LobbyListaDePlayers.Count; gg++) { Ultilize.LobbyListaDePlayers[gg].Send(Write.ack); } }
private void EnviarSala(User user, string texto) { PacketManager Write = new PacketManager(); Write.OP(7); Write.Byte(1); Write.Int(user.pInfo.userid); Write.UStr(user.pInfo.nickname); Write.Int(0); Write.Int(0); Write.Int(-1); Write.UStr(texto); Write.Int(0); Write.Int(0); for (int gg = 0; gg < user.AtualSala.MaxJogadores; gg++) { if (user.AtualSala.slotslen[gg].ativo == true) { user.AtualSala.slotslen[gg].user.Send(Write.ack); } } }
public void PC_Info(User user, Readers ler) { ler.Int(); string WindowsVersion = ler.UString(); string PlacaDeRede = ler.UString(); int unk = ler.Int(); int[] unk2 = { 0 }; for (int i = 0; i < unk; i++) { Array.Resize(ref unk2, unk); unk2[i] = ler.Int(); } string PlacaDeVideo = ler.UString(); ler.Int(); ler.Byte(); string DirectxVersion = ler.UString(); PacketManager Write = new PacketManager(); Write.OP(226); Write.Int(0); Write.UStr(WindowsVersion); Write.UStr(PlacaDeRede); Write.Int(unk); for (int y = 0; y < unk; y++) { Write.Int(unk2[y]); } Write.UStr(PlacaDeVideo); Write.Int(0); Write.Byte(0); Write.UStr(DirectxVersion); Write.Hex("00 00 00"); user.Send(Write.ack); }
public void CriarSala(User user, PlayerInfo pInfo, Readers ler, CharsInfo charsInfo) { short blank = ler.Short(); string Nome = ler.UString(); int id = ler.Byte(); byte Guild = ler.Byte(); string senha = ler.UString(); short playersemSala = ler.Short(); short MaxPlayers = ler.Short(); byte jogando = ler.Byte(); byte unk2 = ler.Byte(); byte matchmode = ler.Byte(); int gamemode = ler.Int(); int readMatch = ler.Int(); int RandomMap = ler.Byte(); int Map = ler.Int(); ler.Int(); ler.Bytes(97); string iLogin = ler.String(); int iUserid = ler.Int(); string iNick = ler.String(); int indexcharacter = ler.Int(); byte iPersonagemID = ler.Byte(); Sala sala = new Sala(); sala.SalaID = (short)id; sala.ITMode = 2; sala.SalaNome = Nome; sala.SalaSenha = senha; sala.MatchMode = (int)matchmode; sala.GameMode = (int)gamemode; sala.RndMap = false; sala.Map = (int)Map; sala.expulsar = 3; sala.jogando = false; user.PersonagemAtual = iPersonagemID; for (int m = 0; m < MaxPlayers; m++) { if (m == 0) { sala.slotslen[0].ativo = true; sala.slotslen[0].user = user; sala.slotslen[0].Lider = true; sala.slotslen[0].aberto = false; } else { sala.slotslen[m].ativo = false; sala.slotslen[m].aberto = true; sala.slotslen[m].user = null; sala.slotslen[m].Status = 0; sala.slotslen[m].AFK = false; sala.slotslen[m].Lider = false; } } user.AtualSala = sala; PacketManager Write = new PacketManager(); Write.OP(25); Write.Int(0); Write.UStr(user.pInfo.usuario); Write.Int(user.pInfo.userid); Write.UStr(user.pInfo.nickname); Write.Int(indexcharacter); Write.Byte((byte)iPersonagemID); Write.Hex("00 FF 00 FF 00 FF 00 00 00 00 00 01 00 00 00 64 00 00"); Write.Int(user.pInfo.gamePoint); Write.Byte(0); Write.Byte(0); Write.Hex("00 00 00 4E 00 00 00 07 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 08 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 09 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0A 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0B 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0C 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0D 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0E 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0F 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 10 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 11 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 12 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 28 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 29 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5A 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5F 00 00 00 00 00 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00"); charsInfo.GetCharactersFromDB(pInfo.userid);; Write.Int(charsInfo.getLength()); for (int countchar = 0; countchar < charsInfo.getLength(); countchar++) { Write.Byte((byte)charsInfo.personagems[countchar].personagemid); Write.Int(0); Write.Byte((byte)charsInfo.personagems[countchar].classe); Write.Int(0); Write.Byte(0); Write.Int(charsInfo.personagems[countchar].experiencia); Write.Int(charsInfo.personagems[countchar].nivel); Write.Int(charsInfo.personagems[countchar].vitoria); Write.Int(charsInfo.personagems[countchar].derrota); Write.Int(charsInfo.personagems[countchar].equipamentos.Length); for (int equipscount = 0; equipscount < charsInfo.personagems[countchar].equipamentos.Length; equipscount++) { Write.Int(charsInfo.personagems[countchar].equipamentos[equipscount].itemid); Write.Int(1); Write.Int(charsInfo.personagems[countchar].equipamentos[equipscount].itemuid); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.UShort(0); } Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 01 00"); Write.Int(0); Write.Int(255); Write.Int(160); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 FF 00 00 00 00 00 00"); Write.Int(0); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"); } Write.Hex("00 00 00 03 01 58 A8 C0 01 8E A8 C0 01 00 00 7F 00 00 00 01 7E FE 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 E5 6A 00 00 00 01 31 7F 24 36 00 00 00 00 01 00 00 E5 88 00 00 00 01 31 7F 24 37 00 00 00 00 00 00 00 00 00 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 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); Write.Int(user.AtualSala.SalaID); Write.UStr(user.AtualSala.SalaNome); Write.Hex("01 00"); Write.UStr(user.AtualSala.SalaSenha); Write.Short((short)sala.PlayersEmSala()); Write.Short((short)(sala.PlayersEmSala() + sala.slotsAbertos())); Write.Short(6); Write.Byte((byte)sala.MatchMode); Write.Int(sala.GameMode); Write.Int(sala.ITMode); Write.Boolean(sala.RndMap); Write.Int(sala.Map); Write.Int(12); Write.Hex("00 01 01 01 00 00 FF FF FF FF 00 00 00 00 00 00 00 00 01 AA DC 63 C0 25 80 AA DC 63 C0 25 E4 01 00 01 00 00 01 2C 00 00 00 14 00 00 1A 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 01 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); }
public void logar(User user, PlayerInfo pInfo, CharsInfo charsInfo, Readers Ler) { db.DBConnect data = new db.DBConnect(); DataSet Banco = new DataSet(); string usuario = Ler.String(); string senha = Ler.String(); pInfo.usuario = usuario; pInfo.senha = senha; PacketManager Write = new PacketManager(); Write.OP(3); data.Exec(Banco, "SELECT `userid`, `online`, `ban`, `moderador` FROM `contas` WHERE `usuario` = '" + usuario + "' AND `senha` = '" + senha + "'"); if (Banco.Tables[0].Rows.Count > 0) { pInfo.userid = Convert.ToInt32(Banco.Tables[0].Rows[0][0].ToString()); pInfo.online = Convert.ToInt32(Banco.Tables[0].Rows[0][1].ToString()); pInfo.ban = Convert.ToInt32(Banco.Tables[0].Rows[0][2].ToString()); pInfo.moderador = Convert.ToInt32(Banco.Tables[0].Rows[0][3].ToString()); pInfo.GetNickname(pInfo.userid); pInfo.GetGP(pInfo.userid); pInfo.GetVidaBonus(pInfo.userid); pInfo.GetSizeInvetario(pInfo.userid); //tentativa de Login com conta Banida if (pInfo.ban > 0) { Write.Int(0); Write.UStr(usuario); Write.Hex("00 00 00 00 05 00 11 3E 0F 28 04 1B 40 40 04 1B 77 01 31 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FD 00 00 00 64 01 7C 00 00 00 00 D1 C0 00 03 53 29 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 29 00 00 00 07 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 08 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 09 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 0B 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 0C 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 0D 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 0E 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 10 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 11 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 12 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 13 00 00 00 01 07 00 00 01 00 00 00 00 00 00 00 14 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 15 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 16 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 17 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 18 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 19 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 1A 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 1B 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 1E 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 24 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 27 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00 28 00 00 00 01 03 00 00 00 00 01 00 00 00 00 00 29 00 00 00 01 03 00 00 00 00 01 00 00 00 00 00 2A 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 2B 00 00 00 01 03 00 00 00 00 01 00 00 00 00 00 2C 00 00 00 01 03 00 00 00 00 01 00 00 00 00 00 2D 00 00 00 01 03 00 00 00 00 01 00 00 00 00 00 2E 00 00 00 01 03 00 00 00 00 01 00 00 00 00 00 2F 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 30 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 31 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 32 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 33 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 34 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 35 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 36 00 00 00 01 07 00 00 01 00 02 00 00 00 00 00 38 00 00 00 01 06 00 00 00 00 02 00 00 00 00 00 3E 00 00 00 01 01 00 00 01 00 00 00 00 0F 3C 08 8D 00 00 00 00 EC 46 08 8D 40 64 02 52 A2 00 7E E0 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 56 AD 8F E4 56 D3 E8 74 00 00 00 00 00 00 00 00 00 00 00 00 01 11 40 7E EE 00 00 00 00 40 64 02 52 A2 3C 7E E0 01 01 00 00 00 01 61 D0 B2 C0 FF 08 FF FF FF BC 02 50 EF C4 08 8D 11 00 00 00 00 00 7E EE A2 00 00 00 00 C0 00 00 00 00 00 00 00 00 00 00 00 04 7E F4 BA 01 00 00 00 00 00 00 00 00 00 00 00 00 11 34 08 8D FD FD 00 59 44 DD 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 01 29 00 7C 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01"); user.Send(Write.ack); } else { sendexptable.xptable(user); verifiqueInventario.GetInventory(user, pInfo.userid); charsInfo.GetCharactersFromDB(pInfo.userid); Write.UStr(usuario); Write.UStr(pInfo.nickname); Write.Byte(0); Write.Int(pInfo.gamePoint); Write.Hex("A0 04 8E C0 10 04 8E DD 01 DE 30 31 C8"); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Byte(255); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Short(0); Write.Byte(0); Write.Int(100); Write.Byte(0); Write.Byte(0); Write.Int(charsInfo.getLength()); for (int countchar = 0; countchar < charsInfo.getLength(); countchar++) { Write.Byte((byte)charsInfo.personagems[countchar].personagemid); Write.Byte((byte)charsInfo.personagems[countchar].personagemid); Write.Int(0); Write.Byte((byte)charsInfo.personagems[countchar].classe); Write.Byte((byte)charsInfo.personagems[countchar].classe); Write.Int(0); Write.Int(charsInfo.personagems[countchar].experiencia); Write.Int(charsInfo.personagems[countchar].vitoria); Write.Int(charsInfo.personagems[countchar].derrota); Write.Int(charsInfo.personagems[countchar].vitoria); Write.Int(charsInfo.personagems[countchar].derrota); Write.Int(0); Write.Int(charsInfo.personagems[countchar].experiencia); Write.Int(charsInfo.personagems[countchar].nivel); Write.Int(charsInfo.personagems[countchar].equipamentos.Length); for (int equipscount = 0; equipscount < charsInfo.personagems[countchar].equipamentos.Length; equipscount++) { Write.Int(charsInfo.personagems[countchar].equipamentos[equipscount].itemid); Write.Int(0); Write.Int(charsInfo.personagems[countchar].equipamentos[equipscount].itemuid); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Short(0); Write.Byte(0); } Write.Int(0); Write.Int(0); Write.Int(charsInfo.personagems[countchar].splef); Write.Hex("00 00 00 A0 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 07 AF 00 00 00 00 00 00 07 AF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"); } Write.Short((short)configserver.Port);//9401 Write.Int(pInfo.userid); Write.UStr(configserver.nome); Write.Int(configserver.checkMensagem); Write.Int(configserver.checkMensagem); if (configserver.mensagem.Length > 0) { Write.UStr(configserver.mensagem); } Write.Hex("00 00 00 4E 00 00 00 07 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 08 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 09 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0A 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0B 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0C 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0D 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5A 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5F 00 00 00 00 00 00 00 00 00 00 00 13 0B 75 8D 00 00 00 1C 00 07 0E 04 00 00 00 01 00 98 96 88 00 00 00 00 58 1F 3B 5C 58 1D DB CC 00 00 00 00 00 07 0E 0E 00 00 00 01 00 98 96 89 00 00 00 00 58 28 D9 00 58 27 87 80 00 00 00 00 00 07 0E 18 00 00 00 01 00 98 96 8A 00 00 00 00 58 28 D9 00 58 27 87 80 00 00 00 00 00 07 19 08 00 00 00 01 00 98 96 81 00 00 00 00 57 A8 09 60 57 A6 B7 E0 00 00 00 00 00 07 19 12 00 00 00 01 00 98 96 82 00 00 00 00 57 A8 09 60 57 A6 B7 E0 00 00 00 00 00 07 24 52 00 00 00 01 00 98 96 81 00 00 00 00 57 A8 09 60 57 A6 B7 E0 00 00 00 00 00 07 24 5C 00 00 00 01 00 98 96 82 00 00 00 00 57 A8 09 60 57 A6 B7 E0 00 00 00 00 00 07 C3 08 00 00 00 01 01 31 2D 03 00 00 00 00 58 2A 7B D4 58 29 2A 54 00 00 00 00 00 0A B0 36 00 00 00 01 00 98 96 83 00 00 00 00 57 AD 34 6C 57 AB E2 EC 00 00 00 00 00 0A B0 40 00 00 00 01 00 98 96 84 00 00 00 00 57 AD 34 6C 57 AB E2 EC 00 00 00 00 00 0A B0 4A 00 00 00 01 00 98 96 85 00 00 00 00 58 27 25 88 58 25 D4 08 00 00 00 00 00 0A B0 54 00 00 00 01 00 98 96 86 00 00 00 00 58 27 25 88 58 25 D4 08 00 00 00 00 00 0A B0 72 00 00 00 01 00 98 96 89 00 00 00 00 58 27 38 84 58 25 E7 04 00 00 00 00 00 0A B0 7C 00 00 00 01 00 98 96 8A 00 00 00 00 58 27 38 84 58 25 E7 04 00 00 00 00 00 0A B0 86 00 00 00 01 00 98 96 8B 00 00 00 00 58 2A 7D 78 58 29 2B F8 00 00 00 00 00 0A B0 90 00 00 00 01 00 98 96 8C 00 00 00 00 58 2A 7D 78 58 29 2B F8 00 00 00 00 00 0A B0 9A 00 00 00 01 00 98 96 8D 00 00 00 00 58 2A 7F 1C 58 29 2D 9C 00 00 00 00 00 0A B0 A4 00 00 00 01 00 98 96 8E 00 00 00 00 58 2A 7F 1C 58 29 2D 9C 00 00 00 00 00 0A B0 AE 00 00 00 01 00 98 96 8F 00 00 00 00 58 2A 80 C0 58 29 2F 40 00 00 00 00 00 0A B0 B8 00 00 00 01 00 98 96 90 00 00 00 00 58 2A 80 C0 58 29 2F 40 00 00 00 00 00 0A B0 C2 00 00 00 01 00 98 96 91 00 00 00 00 58 2A 82 A0 58 29 31 20 00 00 00 00 00 0A B0 CC 00 00 00 01 00 98 96 92 00 00 00 00 58 2A 82 A0 58 29 31 20 00 00 00 00 00 0A E8 58 00 00 00 01 00 98 96 81 00 00 00 00 57 A8 0E 10 57 A6 BC 90 00 00 00 00 00 0A E8 62 00 00 00 01 00 98 96 82 00 00 00 00 57 A8 0E 10 57 A6 BC 90 00 00 00 00 00 0D 48 D2 00 00 00 01 00 98 96 81 00 00 00 00 57 A8 0D D4 57 A6 BC 54 00 00 00 00 00 0D 48 DC 00 00 00 01 00 98 96 82 00 00 00 00 57 A8 0D D4 57 A6 BC 54 00 00 00 00 00 12 9E 04 00 00 00 01 00 98 98 15 00 00 00 00 58 1E B8 58 58 1D 66 D8 00 00 00 00 00 13 8C A6 00 00 00 01 00 B4 0D C2 00 00 00 00 58 2A 8A 98 58 29 39 18 00 00 00 00 00 80 00 18 00 00 00 00 00 5A 00 00 00 00 00 80 00 00 00 00 00 00 00 00"); Write.UStr(configserver.MsgNome); Write.Str(configserver.MsgIP); Write.Short((short)configserver.MsgPort); Write.Int(292); Write.Int(0); Write.Int(0); Write.Hex("FF FF FF FF FF FF FF FF"); Write.Str(configserver.MsgIP); Write.Int(0); Write.Int(0); Write.Int(56095091); Write.Hex("AC 57 F1 73 AC"); Write.Int(0); Write.Int(0);//PETS Write.Byte(0); Write.Int(1); Write.Int(pInfo.tamanhoinventario); Write.Int(0); Write.Int(pInfo.bonusvida); Write.Short(0); Write.Int(1); Write.Int(1); Write.Hex("61 D0 B2 C0 00 64 7E EE E2 C0 07 E7 10 6B 7C 92 A0 00 00 00 00 A4 72 93 E0 57 EF 5E F0"); Write.Int(0); Write.Int(20); for (int tChars = 0; tChars < 20; tChars++) { Write.Int(tChars); Write.Int(tChars); Write.Int(0); Write.Int(0); Write.Short(0); } Write.Int(2); Write.Int(30); Write.Int(779510); Write.Int(31); Write.Int(1404170); Write.Int(400); Write.Byte(0); user.Send(Write.ack); } } else { //falha ao logar Write.Int(20); Write.UStr(usuario); Write.Int(0); user.Send(Write.ack); user.close(); } servertime.servertime(user); tickets.sendlist(user); petvesteditem.petvesteditem(user); graduatecharacterinfo.GraduateCharacterInfo(user); missiondatechange.missiondatechange(user); jumpcharinfo.jumpingcharinfo(user); slotinfo.slotinfo(user); fulllookinfo.fulllookinfo(user); systemguideinfo.systemguideinfo(user); fairytreebuff.fairytreebuff(user); ritaschristimasinfo.ritaschristimasuserInfo(user); }
public void rungame(User user) { Sala sala = user.AtualSala; int playersInSala = sala.PlayersEmSala(); PacketManager Write = new PacketManager(); Write.OP(38); Write.Int(0); Write.Int(1379592610); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); Write.Int(playersInSala); for (int a = 0; a < sala.MaxJogadores; a++) { if (sala.slotslen[a].ativo == true) { Write.Int(sala.slotslen[a].user.pInfo.userid); } } Write.Int(149246); Write.Int(playersInSala); for (int b = 0; b < sala.MaxJogadores; b++) { if (sala.slotslen[b].ativo == true) { Write.Int(sala.slotslen[b].user.pInfo.userid); Write.Hex("00 00 01 04 00 00 00 6A"); } } Write.Int(0); Write.Int(sala.ObterSessao().pInfo.userid); Write.Hex("00 00 00 00 00 00 00"); Write.Byte((byte)sala.MatchMode); Write.Int(sala.GameMode); Write.Int(sala.ITMode); Write.Boolean(false); Write.Int(sala.Map); Write.Hex("00 00 00 00 FF FF FF FF 00 00 00 01 00 00 00"); Write.Short((short)playersInSala); Write.Short((short)sala.slotsAbertos()); for (int c = 0; c < sala.MaxJogadores; c++) { if (sala.slotslen[c].ativo == true) { Write.Boolean(sala.slotslen[c].aberto); } } Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 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 00 00 00 00"); Write.Short((short)playersInSala); for (int d = 0; d < sala.MaxJogadores; d++) { if (sala.slotslen[d].ativo == true) { Write.Int(sala.slotslen[d].user.pInfo.userid); Write.Byte((byte)sala.slotslen[d].user.PersonagemAtual); Write.Int(1000); } } Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); for (int e = 0; e < sala.MaxJogadores; e++) { if (sala.slotslen[e].ativo == true) { sala.slotslen[e].user.Send(Write.ack); } } sala.jogando = true; }
public void RoomInfoDivide(User user) { int temp = -1; for (int a = 0; a < user.AtualSala.MaxJogadores; a++) { if (user.AtualSala.slotslen[a].ativo == false) { continue; } temp++; PacketManager Write = new PacketManager(); Write.OP(1468); Write.Int(0); Write.Int(user.AtualSala.PlayersEmSala()); Write.Int(temp); Write.UStr(user.AtualSala.slotslen[a].user.pInfo.usuario); Write.Int(user.AtualSala.slotslen[a].user.pInfo.userid); Write.UStr(user.AtualSala.slotslen[a].user.pInfo.nickname); Write.Int(a); Write.Byte((byte)user.AtualSala.slotslen[a].user.PersonagemAtual); Write.Hex("00 FF 00 FF 00 FF 00 00 00 00"); Write.Byte((byte)user.AtualSala.obterTime(user.AtualSala.slotslen[a].user)); Write.Hex("01 00 00 00 0D 00 00 00 00 10 F4 00 00 00 00 00 4E 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5F 00 00 00 00 00 00 00 00 00 00 00"); if (user.AtualSala.ObterSessao() == user.AtualSala.slotslen[a].user) { Write.Byte(1); } else { Write.Byte(0); } Write.Hex("01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); Write.Byte((byte)user.AtualSala.slotslen[a].user.pInfo.charsinfo.getLength()); for (int countchar = 0; countchar < user.AtualSala.slotslen[a].user.pInfo.charsinfo.getLength(); countchar++) { Write.Byte((byte)user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].personagemid); Write.Int(0); Write.Byte((byte)user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].classe); Write.Int(0); Write.Byte(0); Write.Int(user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].experiencia); Write.Int(user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].nivel); Write.Int(user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].vitoria); Write.Int(user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].derrota); Write.Int(user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].equipamentos.Length); for (int equipscount = 0; equipscount < user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].equipamentos.Length; equipscount++) { Write.Int(user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].equipamentos[equipscount].itemid); Write.Int(1); Write.Int(user.AtualSala.slotslen[a].user.pInfo.charsinfo.personagems[countchar].equipamentos[equipscount].itemuid); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Short(0); Write.Byte(0); } Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 01 00"); Write.Int(0); Write.Int(255); Write.Int(160); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 FF 00 00 00 00 00 00"); Write.Int(0); Write.Hex("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"); } Write.Hex("00 00 00 04 13 00 A8 C0 01 EC A8 C0 9B BA FE A9"); Write.Hex(Ultilize.IpHex); Write.Hex("00 00 00 01 7E F5 00 00 00"); Write.Byte(user.AtualSala.slotslen[a].Status); Write.Hex("00 00 00 00 00 00 00 02 00 00 00 00 00 00 E5 6A 00 00 00 01 2C BD 52 5A 00 00 00 00 01 00 00 E5 88 00 00 00 01 2C BD 52 5B 00 00 00 00 00 00 00 00 00 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 00 00 00 01 56 86 32 00 56 87 6E D4 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); user.Send(Write.ack); } }
public void enterRoom(User user, Readers Ler, CharsInfo charsInfo) { Ler.Byte(); Ler.Byte(); Ler.Byte(); short salaindex = (short)Ler.UShort(); string senha = Ler.UString(); Sala sala = obterRoom(salaindex); int slotPos = -1; for (int i = 0; i < 3; i++) { if (slotPos == -1 && sala.slotslen[i].aberto == true) { slotPos = i; } } if (sala.slotsAbertos() == 0) { SalaCheia(user); } if (sala.jogando == true) { SalaCheia(user); } sala.slotslen[slotPos].ativo = true; sala.slotslen[slotPos].user = user; sala.slotslen[slotPos].aberto = false; sala.slotslen[slotPos].AFK = false; sala.slotslen[slotPos].Mortes = 0; sala.slotslen[slotPos].Lider = false; user.AtualSala = sala; PacketManager Write = new PacketManager(); Write.OP(22); Write.UStr(user.pInfo.usuario); Write.Int(user.pInfo.userid); Write.UStr(user.pInfo.nickname); Write.Int(slotPos); Write.Byte((byte)user.PersonagemAtual); Write.Hex("00 FF 00 FF 00 FF 00 00 00 00"); Write.Byte((byte)(slotPos / 3)); Write.Hex("01 00 00 00 0D 00 00 00 00 10 F4 00 00 00 00 00 4E 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5F 00 00 00 00 00 00 00 00 00 00 00"); if (sala.ObterSessao() == user) { Write.Byte(1); } else { Write.Byte(0); } Write.Hex("01 00 00 00 00 00 00 00 00 00 00 00 00"); Write.Int(charsInfo.getLength()); for (int countchar = 0; countchar < charsInfo.getLength(); countchar++) { Write.Byte((byte)charsInfo.personagems[countchar].personagemid); Write.Byte((byte)charsInfo.personagems[countchar].personagemid); Write.Int(0); Write.Byte((byte)charsInfo.personagems[countchar].classe); Write.Byte((byte)charsInfo.personagems[countchar].classe); Write.Int(0); Write.Int(charsInfo.personagems[countchar].experiencia); Write.Int(charsInfo.personagems[countchar].vitoria); Write.Int(charsInfo.personagems[countchar].derrota); Write.Int(charsInfo.personagems[countchar].vitoria); Write.Int(charsInfo.personagems[countchar].derrota); Write.Int(0); Write.Int(charsInfo.personagems[countchar].experiencia); Write.Int(charsInfo.personagems[countchar].nivel); Write.Int(charsInfo.personagems[countchar].equipamentos.Length); for (int equipscount = 0; equipscount < charsInfo.personagems[countchar].equipamentos.Length; equipscount++) { Write.Int(charsInfo.personagems[countchar].equipamentos[equipscount].itemid); Write.Int(0); Write.Int(charsInfo.personagems[countchar].equipamentos[equipscount].itemuid); Write.Int(0); Write.Int(0); Write.Int(0); Write.Int(0); Write.Short(0); Write.Byte(0); } Write.Int(0); Write.Int(0); Write.Int(charsInfo.personagems[countchar].splef); Write.Hex("00 00 00 A0 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 07 AF 00 00 00 00 00 00 07 AF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"); } Write.Hex("00 00 00 04 13 00 A8 C0 01 EC A8 C0 9B BA FE A9"); Write.Hex(Ultilize.IpHex); Write.Hex("00 00 00 01 7E F6 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 E5 6A 00 00 00 01 2C BD 52 5A 00 00 00 00 01 00 00 E5 88 00 00 00 01 2C BD 52 5B 00 00 00 00 00 00 00 00 00 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 00 00 00 01 56 86 32 00 56 87 6E D4 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); for (int a = 0; a < sala.MaxJogadores; a++) { if (user.AtualSala.slotslen[a].ativo == true && user.AtualSala.slotslen[a].user != user) { user.AtualSala.slotslen[a].user.Send(Write.ack); user.AtualSala.slotslen[a].user.Status = "SALA"; } } JoinRoomInfo(user, sala); }