public static void SendPing(WorldClient client) { using (var packet = new Packet(SH2Type.Ping)) { client.SendPacket(packet); } }
public static void SendError(WorldClient client, ServerError error) { using (Packet pack = new Packet(SH3Type.Error)) { pack.WriteShort((byte)error); client.SendPacket(pack); } }
public static void SendConnectError(WorldClient client, ConnectErrors error) { using (var packet = new Packet(SH4Type.ConnectError)) { packet.WriteUShort((ushort)error); client.SendPacket(packet); } }
public static void SendUnknown(WorldClient client) { using (var packet = new Packet(SH31Type.LoadUnkown)) { packet.WriteInt(0xbd1); //lolwut?! charid or sumtin' client.SendPacket(packet); } }
public static void SendServerTime(WorldClient client) { using (var packet = new Packet(SH2Type.ServerTime)) { packet.WriteByte(Convert.ToByte(DateTime.Now.Hour)); packet.WriteUShort(Convert.ToUInt16(DateTime.Now.Minute)); client.SendPacket(packet); } }
public static void SendZoneServerIP(WorldClient client, ZoneConnection info) { using (var packet = new Packet(SH4Type.ServerIP)) { packet.WriteString(client.Host == "127.0.0.1" ? "127.0.0.1" : info.IP, 16); packet.WriteUShort(info.Port); client.SendPacket(packet); } }
public static void SendGuildNameResult(WorldClient client, int pID, string pName) { using (var packet = new Packet(SH29Type.GuildNameResult)) { packet.WriteInt(pID); packet.WriteString(pName, 16); client.SendPacket(packet); } }
private static void SendCharDeleteOKResponse(WorldClient client, byte slot) { using (var packet = new Packet(SH5Type.CharDeleteOK)) { packet.WriteByte(slot); client.SendPacket(packet); } }
private static void SendCharCreationError(WorldClient client, CreateCharError error) { using (Packet packet = new Packet(SH5Type.CharCreationError)) { packet.WriteUShort((ushort)error); client.SendPacket(packet); } }
private static void SendCharOKResponse(WorldClient client, WorldCharacter character) { using (var packet = new Packet(SH5Type.CharCreationOK)) { packet.WriteByte(1); PacketHelper.WriteBasicCharInfo(character, packet); client.SendPacket(packet); } }
private static void SendCharacterList(WorldClient client) { if (!client.LoadCharacters()) { SendError(client, ServerError.DATABASE_ERROR); return; } using (var packet = new Packet(SH3Type.CharacterList)) { packet.WriteUShort(client.RandomID); packet.WriteByte((byte)client.Characters.Count); foreach (WorldCharacter ch in client.Characters.Values) { PacketHelper.WriteBasicCharInfo(ch, packet); } client.SendPacket(packet); } }
public static void SendShortcuts(WorldClient client) { using (var packet = new Packet(SH28Type.LoadShortCuts)) { byte[] data = client.Character.Character.Shortcuts; bool hasData = data != null; packet.WriteBool(hasData); packet.WriteBytes(hasData ? data : new byte[] { 0 }); client.SendPacket(packet); } }
public static void SendQuickbarState(WorldClient client) { using (var packet = new Packet(SH28Type.LoadQuickBarState)) { byte[] data = client.Character.Character.QuickBarState; bool hasData = data != null; packet.WriteBool(hasData); packet.WriteBytes(hasData ? data : new byte[] { 0 }); client.SendPacket(packet); } }