/// <summary> /// Sends a CharacterRetirement packet to the LoginServer, retiring a specific character. /// </summary> /// <param name="Character">The character to retire.</param> public static void SendCharacterRetirement(UISim Character) { PacketStream Packet = new PacketStream((byte)PacketType.RETIRE_CHARACTER, 0); Packet.WritePascalString(PlayerAccount.Username); Packet.WritePascalString(Character.GUID.ToString()); PlayerAccount.Client.SendEncrypted((byte)PacketType.RETIRE_CHARACTER, Packet.ToArray()); }
/// <summary> /// Requests a token from the LoginServer, that can be used to log into a CityServer. /// </summary> /// <param name="Client">A NetworkClient instance.</param> public static void RequestCityToken(NetworkClient Client, Sim SelectedCharacter) { PacketStream Packet = new PacketStream((byte)PacketType.REQUEST_CITY_TOKEN, 0); Packet.WritePascalString(Client.ClientEncryptor.Username); Packet.WritePascalString(SelectedCharacter.ResidingCity.UUID); Packet.WritePascalString(SelectedCharacter.GUID.ToString()); Client.SendEncrypted((byte)PacketType.REQUEST_CITY_TOKEN, Packet.ToArray()); }
public static void SendCharacterInfoRequest(string TimeStamp) { PacketStream Packet = new PacketStream((byte)PacketType.CHARACTER_LIST, 0); //If this timestamp is newer than the server's timestamp, it means //the client doesn't have a charactercache. If it's older, it means //the cache needs to be updated. If it matches, the server sends an //empty responsepacket. //Packet.WriteString(TimeStamp); Packet.WritePascalString(TimeStamp); byte[] PacketData = Packet.ToArray(); //PlayerAccount.Client.Send(FinalizePacket(0x05, new DESCryptoServiceProvider(), PacketData)); PlayerAccount.Client.SendEncrypted((byte)PacketType.CHARACTER_LIST, PacketData); }
/// <summary> /// Sends a CharacterCreate packet to the LoginServer. /// </summary> /// <param name="Character">The character to create.</param> /// <param name="TimeStamp">The timestamp of when this character was created.</param> public static void SendCharacterCreate(TSOClient.VM.Sim Character, string TimeStamp) { PacketStream Packet = new PacketStream((byte)PacketType.CHARACTER_CREATE, 0); Packet.WritePascalString(PlayerAccount.Client.ClientEncryptor.Username); Packet.WritePascalString(TimeStamp); Packet.WritePascalString(Character.Name); Packet.WritePascalString(Character.Sex); Packet.WritePascalString(Character.Description); Packet.WriteUInt64(Character.HeadOutfitID); Packet.WriteUInt64(Character.BodyOutfitID); Packet.WriteByte((byte)Character.AppearanceType); Packet.WritePascalString(Character.ResidingCity.Name); Packet.WriteUInt64(Character.ResidingCity.Thumbnail); Packet.WritePascalString(Character.ResidingCity.UUID); Packet.WriteUInt64(Character.ResidingCity.Map); Packet.WritePascalString(Character.ResidingCity.IP); Packet.WriteInt32(Character.ResidingCity.Port); byte[] PacketData = Packet.ToArray(); PlayerAccount.Client.SendEncrypted((byte)PacketType.CHARACTER_CREATE, PacketData); }