Imports System.Net Imports System.IO Imports System.Text Public Class Form1 Dim ServerIP As String = "192.168.1.19" ' Remote IP (Hamachi IP, Root IP) Dim ClientExe As String = "Shine.bin" ' Die Exe welche gestartet werden soll Dim ServerPort As String = "9010" 'Nur gebraucht wenn 2 Server parralel am laufen habt und unabhängig voneinander sein sollen. Wenn nicht einfach standard lassen. Dim WebsiteAddress As String = "http://127.0.0.1/Login/" 'Zu eurem Websitepfad ändern Dim CashShopAddress As String = "http://cashshop.com/" 'Link zu eurem Cash Shop Dim YoutubeAddress As String = "http://youtube.com/" ' Link zum YouTube Channel Dim ForumAddress As String = "http://elitepvpers.com/" ' Link zum Forum Dim FacebookAddress As String = "http://facebook.com" Dim cpx, cpy As Int32 Friend WithEvents downloader As New Net.WebClient Dim wc As New WebClient Dim MyFunction As New MyFunction Dim ClientConfigFile As String() = Nothing Dim PatchList As String() = Nothing Private Property Facebook_MouseHover As Bitmap Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load LaunchBtn.Enabled = False WebBrowser1.Refresh() If Not File.Exists("UnRAR.exe") Then My.Computer.Network.DownloadFile(WebsiteAddress & "UnRAR.exe", "UnRAR.exe") End If If Not File.Exists("Launcher/config.lul") Then Directory.CreateDirectory("Launcher") File.WriteAllText("Launcher/config.lul", MyFunction.Encrypt("Version=0")) End If ClientConfigFile = IO.File.ReadAllLines("Launcher/config.lul") ClientConfigFile(0) = MyFunction.Decrypt(ClientConfigFile(0)) PatchList = wc.DownloadString(WebsiteAddress & "list.txt").Split(vbNewLine) ClientVersionLabel.Text = ClientConfigFile(0).Split("=")(1) ServerVersionlabel.Text = MyFunction.CountPatches(WebsiteAddress & "list.txt") If ClientVersionLabel.Text = ServerVersionlabel.Text Then LaunchBtn.Enabled = True Label11.Text = "No new Updates available!" Label9.Visible = False ProgressBar1.Hide() PatchProgressLabel.Hide() Else ProgressBar1.Value = 0 Label9.Text = ClientVersionLabel.Text + 1 downloader.DownloadFileAsync(New Uri(PatchList(Label9.Text).Split(vbTab)(1)), "patch.rar") End If End Sub Private Sub downloader_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles downloader.DownloadFileCompleted Dim oProcess As Process oProcess = System.Diagnostics.Process.Start("UnRAR.exe", "x -y -ac patch.rar") oProcess.WaitForExit() File.Delete("patch.rar") Label9.Text = Val(Label9.Text) + Val("1") ClientVersionLabel.Text = Val(ClientVersionLabel.Text) + Val("1") IO.File.WriteAllText("Launcher/config.lul", MyFunction.Encrypt("LauncherVersion=" & ClientVersionLabel.Text)) If ServerVersionlabel.Text = ClientVersionLabel.Text Then LaunchBtn.Enabled = True Label11.Text = "No new Updates avaiable!" Label9.Visible = False PatchProgressLabel.Hide() Else ProgressBar1.Value = 0 downloader.DownloadFileAsync(New Uri(PatchList(Label9.Text).Split(vbTab)(1)), "patch.rar") End If End Sub Private Sub downloader_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles downloader.DownloadProgressChanged PatchProgressLabel.Text = e.ProgressPercentage & "%" ProgressBar1.Value = e.ProgressPercentage If PatchProgressLabel.Text = "100%" Then ProgressBar1.Value = 100 End If End Sub Private Sub PictureBox3_Click_1(sender As System.Object, e As System.EventArgs) Handles LaunchBtn.Click Process.Start(ClientExe, " -i " & ServerIP & " -p " & ServerPort) 'Startet die .exe Environment.Exit(0) 'Beendet Patcher End Sub Private Sub PictureBox7_Click_1(sender As System.Object, e As System.EventArgs) Handles Facebook.Click Process.Start(FacebookAddress) 'Facebook End Sub Private Sub PictureBox6_Click(sender As System.Object, e As System.EventArgs) Handles Youtube.Click Process.Start(YoutubeAddress) 'YouTube End Sub Private Sub PictureBox2_Click_2(sender As System.Object, e As System.EventArgs) Handles Forum.Click Process.Start(ForumAddress) 'Forum End Sub Private Sub PictureBox8_Click(sender As System.Object, e As System.EventArgs) Handles Closebtn.Click Environment.Exit(0) 'Patcher schließen End Sub Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown cpx = e.X cpy = e.Y End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If e.Button = Windows.Forms.MouseButtons.Left Then Me.Top = Windows.Forms.Cursor.Position.Y() - cpy Me.Left = Windows.Forms.Cursor.Position.X() - cpx End If End Sub Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) If e.KeyCode = Keys.Enter Then PictureBox3_Click_1(sender, e) '// call the event procedure. End Sub Private Sub PictureBox1_Click(sender As Object, e As EventArgs) End Sub Private Sub ServerVersionlabel_Click(sender As Object, e As EventArgs) Handles ServerVersionlabel.Click End Sub Private Sub Facebook_MouseHover1(sender As Object, e As EventArgs) Handles Facebook.MouseHover Facebook.Image = My.Resources.FacebookAktiv End Sub Private Sub Facebook_MouseLeave(sender As Object, e As EventArgs) Handles Facebook.MouseLeave Facebook.Image = My.Resources.FacebookInaktiv End Sub Private Sub Youtube_MouseHover(sender As Object, e As EventArgs) Handles Youtube.MouseHover Youtube.Image = My.Resources.YouTubeAktiv End Sub Private Sub Youtube_MouseLeave(sender As Object, e As EventArgs) Handles Youtube.MouseLeave Youtube.Image = My.Resources.YouTubeInaktiv End Sub Private Sub Forum_MouseHover(sender As Object, e As EventArgs) Handles Forum.MouseHover Forum.Image = My.Resources.ForumsAktiv End Sub Private Sub Forum_MouseLeave(sender As Object, e As EventArgs) Handles Forum.MouseLeave Forum.Image = My.Resources.ForumsInaktiv End Sub Private Sub Closebtn_MouseHover(sender As Object, e As EventArgs) Handles Closebtn.MouseHover Closebtn.Image = My.Resources.ExitAktiv End Sub Private Sub Closebtn_MouseLeave(sender As Object, e As EventArgs) Handles Closebtn.MouseLeave Closebtn.Image = My.Resources.ExitInaktiv End Sub Private Sub LaunchBtn_MouseDown(sender As Object, e As MouseEventArgs) Handles LaunchBtn.MouseDown LaunchBtn.Image = My.Resources.LaunchClick End Sub Private Sub LaunchBtn_MouseHover(sender As Object, e As EventArgs) Handles LaunchBtn.MouseHover LaunchBtn.Image = My.Resources.LaunchHover End Sub Private Sub LaunchBtn_MouseLeave(sender As Object, e As EventArgs) Handles LaunchBtn.MouseLeave LaunchBtn.Image = My.Resources.LaunchPatching End Sub End Class