public Pong(int time, Socket socket) { OutgoingPacket packet = new OutgoingPacket(OpCodes.PONG); packet.Write(time); packet.Send(socket); }
public LoginFail(uint errorCode, Socket socket) { OutgoingPacket packet = new OutgoingPacket(OpCodes.LOGIN_MESSAGE); packet.Write(errorCode); packet.Send(socket); }
public ServerIp(string ipAddress, Socket socket) { OutgoingPacket packet = new OutgoingPacket(OpCodes.SERVER_IP); packet.Write(ipAddress); packet.Send(socket); }
public SessionKey(int sessionKey, Socket socket) { OutgoingPacket packet = new OutgoingPacket(OpCodes.SESSION_KEY); packet.Write(sessionKey); packet.Send(socket); }
public QueryTickCount(uint time, Socket socket) { OutgoingPacket packet = new OutgoingPacket(OpCodes.QUERY_TICK_COUNT); packet.Write(time); packet.Write((uint)DateTime.Now.Ticks); packet.Send(socket); }
public CharacterList(uint authKey, Dictionary <CharacterSlot, Character> characters, Socket socket) { // not finished OutgoingPacket packet = new OutgoingPacket(OpCodes.CHARACTER_LIST); packet.Write(authKey); // authkey packet.Write(characters.Keys.Count); // character count // if > 0 characters if (characters.Keys.Count > 0) { foreach (KeyValuePair <CharacterSlot, Character> character in characters) { packet.Write(character.Key.SlotId); packet.Write(2); // Character block packet.Write(character.Value.Map); packet.Write(0x0B); // Index? 0x0B? packet.Write(character.Value.Name); packet.Write(character.Value.Position.X); packet.Write(character.Value.Position.Y); packet.Write(character.Value.Position.Z); packet.Write(character.Value.CharacterId); packet.Write(0); // ID Party packet.Write(0); // ID Guild packet.Write(0); // ID War packet.Write(character.Value.Skinset); packet.Write(character.Value.HairStyle); packet.Write(character.Value.HairColor); packet.Write(character.Value.HeadMesh); packet.Write(character.Value.Gender); packet.Write(character.Value.ClassId); packet.Write(character.Value.Level); packet.Write(0); // Job level packet.Write(character.Value.Strength); packet.Write(character.Value.Stamina); packet.Write(character.Value.Dexterity); packet.Write(character.Value.Intelligence); packet.Write(0); // Mode packet.Write(0); // equipcount // for each item if (false) { packet.Write(0); // itemid } } } packet.Write(0); // countmessenger // for each in countmessenger if (false) { packet.Write(0); // slot? (byte) } packet.Send(socket); }
public AuthQuery(int value1, int value2, int value3, int value4, Socket socket) { OutgoingPacket packet = new OutgoingPacket(OpCodes.PONG); packet.Write(value1); packet.Write(value2); packet.Write(value3); packet.Write(value4); packet.Send(socket); }
public CharacterList(uint TimeGetTime, Socket socket) { // not finished OutgoingPacket packet = new OutgoingPacket(OpCodes.CHARACTER_LIST); packet.Write(TimeGetTime); // if 0 characters packet.Write(0); packet.Write(0); packet.Send(socket); // if >0 characters }
public ServerList(List <Cluster> clusters, string accountName, Socket socket) { OutgoingPacket packet = new OutgoingPacket(OpCodes.SERVER_LIST); packet.Write(0); // authkey packet.Write((byte)1); // accountflag packet.Write(accountName.ToLower()); int clusterAndChannelCount = clusters.Count; foreach (Cluster cluster in clusters) { clusterAndChannelCount += cluster.Channels.Count; } packet.Write(clusterAndChannelCount); foreach (Cluster cluster in clusters) { packet.Write(cluster.ParentId); packet.Write(cluster.Id); packet.Write(cluster.Name); packet.Write(cluster.Ip); packet.Write(cluster.Is18Plus); packet.Write(cluster.PlayerCount); packet.Write(cluster.Enabled); packet.Write(cluster.MaxPlayerCount); foreach (Channel channel in cluster.Channels) { packet.Write(channel.Parent.Id); packet.Write(channel.Id); packet.Write(channel.Name); packet.Write(channel.Ip); packet.Write(channel.Is18Plus); packet.Write(channel.PlayerCount); packet.Write(channel.Enabled); packet.Write(channel.MaxPlayerCount); } } packet.Send(socket); }