public static void SendCheck() { PacketOut packetOut = new PacketOut(1); packetOut.WriteUInt32((uint)Client.Version); System.IO.FileInfo fileInfo = new System.IO.FileInfo("mythloginserviceconfig.xml"); if (fileInfo.Exists) { packetOut.WriteByte(1); packetOut.WriteUInt64((ulong)fileInfo.Length); } else { packetOut.WriteByte(0); } Client.SendTCP(packetOut); }
private void CONNECT_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // If the user doesn't have WAR in the directory don't even let them send their info since it won't matter if (File.Exists(Directory.GetCurrentDirectory() + "/WAR.exe") == false) { Error = "WAR.exe was not found in the same directory as the launcher."; return; } string text = this.UsernameTextBox.Text.ToLower(); string str = (this.PasswordMode == 0) ? this.PasswordTextBox.Password.ToLower() : this.PasswordTextBox.Password; if (this.Password == "") { this.Password = MainWindow.ConvertSHA256(text + ":" + str); } if (this.savePassword) { Settings.Default.Username = this.UsernameTextBox.Text; Settings.Default.Password = System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(this.Password)); Settings.Default.Save(); } if (Client._Socket == null || !Client._Socket.Connected) { // This will be shown even in NoErrorMode due to being a critical usability issue Error = "Error encountered with connection. Socket: " + ((Client._Socket == null)?"Null":"Exists") + ", Connected: " + Client._Socket.Connected.ToString(); return; } Client.User = text; PacketOut packetOut = new PacketOut(3); packetOut.WriteString(text); packetOut.WriteString(this.Password); Client.SendTCP(packetOut); this.Connect_button.Visibility = Visibility.Hidden; this.Connect_button_grey.Visibility = Visibility.Visible; }
public static void SendTCPRaw(PacketOut packet) { Client.SendTCP((byte[])packet.GetBuffer().Clone()); }
public static void SendTCP(PacketOut packet) { packet.WritePacketLength(); byte[] buffer = packet.GetBuffer(); Client.SendTCP(buffer); }
public static void UpdateRealms() { PacketOut packet = new PacketOut(7); Client.SendTCP(packet); }