This commit is contained in:
Xytrizareal committed 2024-03-06 20:24:00 -07:00
1 parent d4d8bedc3f
commit 2b72547f1c
10 files changed
+233 -38

No files matched your search

+45 -10
View File
@@ -42,11 +42,15 @@ namespace XPSLauncher
this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pictureBox6 = new System.Windows.Forms.PictureBox();
this.pictureBox7 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
this.SuspendLayout();
//
// button1
@@ -106,7 +110,7 @@ namespace XPSLauncher
this.label1.ForeColor = System.Drawing.SystemColors.ButtonFace;
this.label1.Location = new System.Drawing.Point(96, 111);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(408, 23);
this.label1.Size = new System.Drawing.Size(172, 13);
this.label1.TabIndex = 4;
this.label1.Text = "What version do you want to load?";
//
@@ -115,52 +119,52 @@ namespace XPSLauncher
this.pictureBox5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.pictureBox5.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox5.Image = global::XPS.Properties.Resources.Twitch;
this.pictureBox5.Location = new System.Drawing.Point(376, 568);
this.pictureBox5.Location = new System.Drawing.Point(517, 571);
this.pictureBox5.Name = "pictureBox5";
this.pictureBox5.Size = new System.Drawing.Size(65, 62);
this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox5.TabIndex = 9;
this.pictureBox5.TabStop = false;
this.pictureBox5.Click += new System.EventHandler(this.twitchButton);
this.pictureBox5.Click += new System.EventHandler(this.TwitchButton);
//
// pictureBox4
//
this.pictureBox4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.pictureBox4.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox4.Image = global::XPS.Properties.Resources.YouTube;
this.pictureBox4.Location = new System.Drawing.Point(306, 568);
this.pictureBox4.Location = new System.Drawing.Point(447, 571);
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.Size = new System.Drawing.Size(61, 62);
this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox4.TabIndex = 8;
this.pictureBox4.TabStop = false;
this.pictureBox4.Click += new System.EventHandler(this.youtubeButton);
this.pictureBox4.Click += new System.EventHandler(this.YoutubeButton);
//
// pictureBox3
//
this.pictureBox3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.pictureBox3.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox3.Image = global::XPS.Properties.Resources.Twitter;
this.pictureBox3.Location = new System.Drawing.Point(235, 568);
this.pictureBox3.Location = new System.Drawing.Point(376, 571);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(61, 62);
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox3.TabIndex = 7;
this.pictureBox3.TabStop = false;
this.pictureBox3.Click += new System.EventHandler(this.twitterButton);
this.pictureBox3.Click += new System.EventHandler(this.TwitterButton);
//
// pictureBox2
//
this.pictureBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.pictureBox2.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox2.Image = global::XPS.Properties.Resources.Discord;
this.pictureBox2.Location = new System.Drawing.Point(165, 568);
this.pictureBox2.Location = new System.Drawing.Point(306, 571);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(61, 62);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox2.TabIndex = 6;
this.pictureBox2.TabStop = false;
this.pictureBox2.Click += new System.EventHandler(this.discordButton);
this.pictureBox2.Click += new System.EventHandler(this.DiscordButton);
//
// pictureBox1
//
@@ -174,12 +178,40 @@ namespace XPSLauncher
this.pictureBox1.TabIndex = 5;
this.pictureBox1.TabStop = false;
//
// pictureBox6
//
this.pictureBox6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.pictureBox6.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox6.Image = global::XPS.Properties.Resources.Website;
this.pictureBox6.Location = new System.Drawing.Point(4, 575);
this.pictureBox6.Name = "pictureBox6";
this.pictureBox6.Size = new System.Drawing.Size(155, 62);
this.pictureBox6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox6.TabIndex = 10;
this.pictureBox6.TabStop = false;
this.pictureBox6.Click += new System.EventHandler(this.WebsiteButton);
//
// pictureBox7
//
this.pictureBox7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.pictureBox7.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox7.Image = global::XPS.Properties.Resources.Tools;
this.pictureBox7.Location = new System.Drawing.Point(4, 520);
this.pictureBox7.Name = "pictureBox7";
this.pictureBox7.Size = new System.Drawing.Size(155, 62);
this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox7.TabIndex = 11;
this.pictureBox7.TabStop = false;
this.pictureBox7.Click += new System.EventHandler(this.ToolsButton);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.ClientSize = new System.Drawing.Size(584, 636);
this.Controls.Add(this.pictureBox7);
this.Controls.Add(this.pictureBox6);
this.Controls.Add(this.pictureBox5);
this.Controls.Add(this.pictureBox4);
this.Controls.Add(this.pictureBox3);
@@ -193,12 +225,13 @@ namespace XPSLauncher
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Text = "XPS";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -216,6 +249,8 @@ namespace XPSLauncher
private PictureBox pictureBox3;
private PictureBox pictureBox4;
private PictureBox pictureBox5;
private PictureBox pictureBox6;
private PictureBox pictureBox7;
}
}
+146 -15
View File
@@ -7,14 +7,30 @@ using System.Net.Http;
using System.Security.Principal;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Compression;
using System.Collections.Generic;
namespace XPSLauncher
{
public partial class Form1 : Form
{
private static readonly HttpClient client = new HttpClient();
private static readonly string currentVersion = "2.0.1";
private static readonly string currentVersion = "2.1.0";
private PrivateFontCollection privateFonts = new PrivateFontCollection();
private Dictionary<string, bool> downloadingVersions = new Dictionary<string, bool>()
{
{ "2.2", false },
{ "2.1", false },
{ "2.0", false },
{ "1.9", false }
};
private Dictionary<string, bool> errorVersions = new Dictionary<string, bool>()
{
{ "2.2", false },
{ "2.1", false },
{ "2.0", false },
{ "1.9", false }
};
public Form1()
{
@@ -28,8 +44,9 @@ namespace XPSLauncher
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.pictureBox1.SendToBack();
checkVersion();
LoadFontFromFile();
CheckVersion();
CheckDownloaded();
}
private void LoadFontFromFile()
@@ -43,10 +60,6 @@ namespace XPSLauncher
label1.Font = new Font(privateFonts.Families[0], 15.75F);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void load22(object sender, EventArgs e)
{
launchGDPS("2.2");
@@ -88,6 +101,16 @@ namespace XPSLauncher
string executionPath = GetExecutionPath();
string path = "";
if (downloadingVersions[version])
{
MessageBox.Show($"Version {version} is currently being downloaded. Please wait until the download is complete.", $"Downloading {version}", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (errorVersions[version])
{
MessageBox.Show($"Version {version} had an issue while downloading and cannot be launched. Please create a support ticket in our Discord server for assistance.", $"Error downloading {version}", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
switch (version)
{
case "2.2":
@@ -116,27 +139,37 @@ namespace XPSLauncher
}
}
private void discordButton(object sender, EventArgs e)
private void DiscordButton(object sender, EventArgs e)
{
OpenUrl("https://xps.xytriza.com/discord");
}
private void twitterButton(object sender, EventArgs e)
private void TwitterButton(object sender, EventArgs e)
{
OpenUrl("https://xps.xytriza.com/twitter");
}
private void youtubeButton(object sender, EventArgs e)
private void YoutubeButton(object sender, EventArgs e)
{
OpenUrl("https://xps.xytriza.com/youtube");
}
private void twitchButton(object sender, EventArgs e)
private void TwitchButton(object sender, EventArgs e)
{
OpenUrl("https://xps.xytriza.com/twitch");
}
private async void checkVersion()
private void WebsiteButton(object sender, EventArgs e)
{
OpenUrl("https://xps.xytriza.com");
}
private void ToolsButton(object sender, EventArgs e)
{
OpenUrl("https://xps.xytriza.com/tools");
}
private async void CheckVersion()
{
var versionCheckResult = await CheckVersionAsync();
this.button1.UseWaitCursor = false;
@@ -158,10 +191,83 @@ namespace XPSLauncher
this.button2.Cursor = Cursors.Hand;
this.button3.Cursor = Cursors.Hand;
this.button4.Cursor = Cursors.Hand;
this.button1.Click += new System.EventHandler(this.load22);
this.button2.Click += new System.EventHandler(this.load21);
this.button3.Click += new System.EventHandler(this.load20);
this.button4.Click += new System.EventHandler(this.load19);
this.button1.Click += new EventHandler(this.load22);
this.button2.Click += new EventHandler(this.load21);
this.button3.Click += new EventHandler(this.load20);
this.button4.Click += new EventHandler(this.load19);
this.KeyPreview = true;
this.KeyPress += MainForm_KeyPress;
}
}
private void CheckDownloaded()
{
string executionPath = GetExecutionPath();
string[] versions = { "2.2", "2.1", "2.0", "1.9" };
foreach (string version in versions)
{
string path = Path.Combine(executionPath, "gdps", version);
if (!Directory.Exists(path))
{
downloadingVersions[version] = true;
Directory.CreateDirectory(path);
DownloadAndExtractFiles(version);
}
}
}
private async void DownloadAndExtractFiles(string version)
{
string executionPath = GetExecutionPath();
string zipPath = Path.Combine(executionPath, $"pkg-{version}.zip");
string extractPath = Path.Combine(executionPath, "gdps", version);
string downloadUrl = $"https://xps.xytriza.com/download/windows/package-{version}.zip";
try
{
using (var client = new HttpClient())
{
var response = await client.GetAsync(downloadUrl, HttpCompletionOption.ResponseHeadersRead);
if (response.IsSuccessStatusCode)
{
using (var fileStream = File.Create(zipPath))
{
await response.Content.CopyToAsync(fileStream);
}
downloadingVersions[version] = false;
MessageBox.Show($"Version {version} has been downloaded successfully!", $"Downloaded {version}", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
errorVersions[version] = true;
downloadingVersions[version] = false;
Directory.Delete(extractPath, true);
MessageBox.Show($"Error downloading files for version {version}. Create a support ticket in the Discord and we will try to help you.", $"Error downloading {version}", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
catch (Exception ex)
{
errorVersions[version] = true;
downloadingVersions[version] = false;
Directory.Delete(extractPath, true);
MessageBox.Show($"Error downloading files for version {version}. Create a support ticket in the Discord and we will try to help you.\n\nError message: {ex.Message}", $"Error downloading {version}", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try
{
ZipFile.ExtractToDirectory(zipPath, extractPath);
File.Delete(zipPath);
}
catch (Exception ex)
{
errorVersions[version] = true;
downloadingVersions[version] = false;
Directory.Delete(extractPath, true);
MessageBox.Show($"Error extracting files for version {version}. Create a support ticket in the Discord and we will try to help you.\n\nError message: {ex.Message}", $"Error extracting {version}", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
@@ -228,6 +334,31 @@ namespace XPSLauncher
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
}
private void MainForm_KeyPress(object sender, KeyPressEventArgs e)
{
switch (e.KeyChar)
{
case '1':
button1.Focus();
button1.PerformClick();
break;
case '2':
button2.Focus();
button2.PerformClick();
break;
case '3':
button3.Focus();
button3.PerformClick();
break;
case '4':
button4.Focus();
button4.PerformClick();
break;
default:
break;
}
}
}
}
+6 -6
View File
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XPSLauncher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("XPS")]
[assembly: AssemblyDescription("Xytriza's Geometry Dash Private Server")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XPSLauncher")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyProduct("XPS")]
[assembly: AssemblyCopyright("Copyright © Xytriza 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("2.0.2")]
[assembly: AssemblyFileVersion("2.0.2")]
+20
View File
@@ -90,6 +90,16 @@ namespace XPS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tools {
get {
object obj = ResourceManager.GetObject("Tools", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@@ -110,6 +120,16 @@ namespace XPS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Website {
get {
object obj = ResourceManager.GetObject("Website", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
+13 -7
View File
@@ -118,22 +118,28 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="logoPng" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\XPS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="YouTube" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\YouTube.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Twitch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Twitch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logoIco" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\XPS.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tools" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Tools.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Twitter" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Twitter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logoPng" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\XPS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Discord" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Discord.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Twitch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Twitch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="YouTube" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\YouTube.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Website" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Website.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+3
View File
@@ -38,6 +38,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -93,6 +94,8 @@
<None Include="Resources\Twitter.png" />
<None Include="Resources\YouTube.png" />
<None Include="Resources\Twitch.png" />
<None Include="Resources\Tools.png" />
<None Include="Resources\Website.png" />
<Content Include="XPS.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />