I fucking hate microsoft. Added support for handling 24.01.2026, mightve broken older versions, fuck if I know!

This commit is contained in:
IveBeenAlone
2026-01-25 15:34:42 -05:00
parent 636ad3d6ae
commit 3ae40534df
5 changed files with 152 additions and 20 deletions

View File

@@ -11,6 +11,7 @@ using System.Net.Http;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
@@ -25,6 +26,9 @@ namespace HelloWorld
private const string UpdateURL = "https://ibatv.xyz/data/lnch/hy.txt";
private string SanSessionID;
private string SanTokenID;
public Form1()
{
InitializeComponent();
@@ -165,10 +169,10 @@ namespace HelloWorld
}
private void button1_Click(object sender, EventArgs e){}
private void lblHelloWorld_Click(object sender, EventArgs e){}
private void label2_Click(object sender, EventArgs e){}
private void button2_Click(object sender, EventArgs e)
private void button1_Click(object sender, EventArgs e) { }
private void lblHelloWorld_Click(object sender, EventArgs e) { }
private void label2_Click(object sender, EventArgs e) { }
private async void button2_Click(object sender, EventArgs e)
{
// All of this shit for username data
@@ -267,6 +271,51 @@ namespace HelloWorld
var payload = new
{
uuid = "13371337-1337-1337-1337-1337" + textBoxUUID.Text,
name = textBoxUsername.Text,
scopes = new[] { "hytale:server", "hytale:client" }
};
//textBoxUUID.Text + " --name \"" + textBoxUsername.Text
string json = JsonSerializer.Serialize(payload);
using (HttpClient client = new HttpClient())
{
using (HttpContent content = new StringContent(json, Encoding.UTF8, "application/json"))
{
HttpResponseMessage response = await client.PostAsync(
"https://sessions.sanasol.ws/game-session/child",
content
);
response.EnsureSuccessStatusCode();
string responseJson = await response.Content.ReadAsStringAsync();
// Deserialize response
SessionResponse session =
JsonSerializer.Deserialize<SessionResponse>(responseJson);
SanSessionID = session.sessionToken;
SanTokenID = session.identityToken;
//MessageBox.Show("Session created!");
Console.WriteLine("Session: " + SanSessionID + "\n\nToken: " + SanTokenID);
}
}
// Genuinely FUCK windows and C# and fucking whatever else to make this shit work
// I swear to fucking god I spent a solid 3 hours trying to make this thing
// OPEN A FUCKING EXE AND PASS ARGS CORRECTLY
@@ -282,10 +331,10 @@ namespace HelloWorld
string GamePath = "\"" + workingDirectory + "\\" + LaunchVersion + "\\" + relativeExePath + "\""; //hytale.exe
string AppPath = "\"" + workingDirectory + "\\" + LaunchVersion + Hytaleappdir + "\""; // game\latest
string UserdataPath = "\"" + baseDirectory + "UserData"+"\"";
string UserdataPath = "\"" + baseDirectory + "UserData" + "\"";
string JavaPath = "\"" + workingDirectory + "\\" + LaunchVersion + HytaleJava + "\""; // java
string arguments = " --app-dir " +AppPath+ " --user-dir " + UserdataPath + " --java-exec " + JavaPath + " --auth-mode offline --uuid 13371337-1337-1337-1337-1337" + textBoxUUID.Text + " --name \"" + textBoxUsername.Text + "\""; // Command-line arguments for the VB app
string arguments = " --app-dir " + AppPath + " --user-dir " + UserdataPath + " --java-exec " + JavaPath + " --auth-mode authenticated --uuid 13371337-1337-1337-1337-1337" + textBoxUUID.Text + " --name \"" + textBoxUsername.Text + "\"" + " --identity-token " + SanTokenID + " --session-token " + SanSessionID; // Command-line arguments for the VB app
@@ -309,15 +358,15 @@ namespace HelloWorld
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e){}
private void textBox2_TextChanged(object sender, EventArgs e){}
private void checkBox1_CheckedChanged(object sender, EventArgs e) { }
private void textBox2_TextChanged(object sender, EventArgs e) { }
private void button1_Click_1(object sender, EventArgs e)
{
Random random = new Random();
int GeneratedUUIDVal = random.Next(10000000, 100000000);
textBoxUUID.Text = GeneratedUUIDVal.ToString();
}
private void checkUUID_CheckedChanged(object sender, EventArgs e){}
private void checkUUID_CheckedChanged(object sender, EventArgs e) { }
private async void LoadComboBoxItems()
@@ -344,7 +393,7 @@ namespace HelloWorld
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e){}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { }
private async void btnInstallVersion_Click(object sender, EventArgs e)
{
@@ -366,7 +415,7 @@ namespace HelloWorld
string savePath = Path.Combine(InstallBaseDirectory, fileName);
string installDir = Path.Combine(InstallBaseDirectory, "Versions");
string localListPath = Path.Combine(installDir,"versions.txt");
string localListPath = Path.Combine(installDir, "versions.txt");
try
@@ -503,7 +552,7 @@ namespace HelloWorld
Directory.Delete(versionPath, true); // true = recursive delete
// Update local list
// string localListPath = Path.Combine(installDir, "downloaded_files.txt");
// string localListPath = Path.Combine(installDir, "downloaded_files.txt");
if (File.Exists(localListPath))
{
var downloadedFiles = File.ReadAllLines(localListPath).ToList();
@@ -582,9 +631,14 @@ namespace HelloWorld
await CheckForUpdateAsync();
}
private void labelLauncherVersion_Click(object sender, EventArgs e)
{
private void labelLauncherVersion_Click(object sender, EventArgs e) { }
public class SessionResponse
{
public string sessionToken { get; set; }
public string identityToken { get; set; }
}
}
}