mirror of
https://github.com/RoyalnetworkTR/simple-launcher.git
synced 2026-09-25 00:59:49 +03:00
Backend (PHP+SQLite): Discord OAuth2 + JWT, coklu hesap (1 Discord = 3-5), tek-kullanimlik join token (/api/join/prepare+verify), custom skin yukleme/sunma, hesap/Discord/HWID ban, admin paneli kartlari; deterministik offline UUID (PHP<->C# paritesi dogrulandi). 25 entegrasyon testi gecti. AthenaCore (Forge 1.12.2): tek client+server mod — join token dogrulama + kick, grace-gate, custom skin uygulama. Sunucu offline-mode kalir (UUID/dunya verisi korunur). Masaustu: WPF -> Avalonia (Windows+Linux), Discord giris/hesap/skin/oyna; WMI/DPAPI yerine cross-platform (machine-id HWID, AES-GCM secret store). Derlenir + calisir. CI: athenacore-mod.yml (JDK8), desktop-release.yml (Win+Linux self-contained). Deploy: deploy.sh (.env uretimi, php-gd, nginx Authorization gecisi) + HANDOFF.md. Android: backend hazir; entegrasyon spec'i ANDROID_INTEGRATION.md.
94 lines
3.4 KiB
C#
94 lines
3.4 KiB
C#
using System;
|
||
using System.Diagnostics;
|
||
using System.IO;
|
||
using System.Windows;
|
||
using System.Windows.Controls;
|
||
|
||
namespace OfflineMinecraftLauncher.Pages;
|
||
|
||
public partial class SettingsPage : UserControl
|
||
{
|
||
private readonly LauncherCore _core;
|
||
|
||
public SettingsPage(LauncherCore core)
|
||
{
|
||
_core = core;
|
||
InitializeComponent();
|
||
|
||
int max = Properties.Settings.Default.MaxRamMb; if (max < 1024) max = 4096;
|
||
int min = Properties.Settings.Default.MinRamMb; if (min < 512) min = 2048;
|
||
MaxRamSlider.Value = Math.Min(max, 32768);
|
||
MinRamSlider.Value = Math.Min(min, 16384);
|
||
JavaBox.Text = Properties.Settings.Default.JavaPath ?? "";
|
||
JvmBox.Text = Properties.Settings.Default.JvmArguments ?? "";
|
||
RamHint.Text = "İpucu: Maksimum RAM'i sistem belleğinin yarısı civarında tutun.";
|
||
}
|
||
|
||
private void MaxRamSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||
{
|
||
if (MaxRamLabel != null) MaxRamLabel.Text = $"{(int)e.NewValue} MB";
|
||
}
|
||
|
||
private void MinRamSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||
{
|
||
if (MinRamLabel != null) MinRamLabel.Text = $"{(int)e.NewValue} MB";
|
||
}
|
||
|
||
private void Browse_Click(object sender, RoutedEventArgs e)
|
||
{
|
||
var ofd = new Microsoft.Win32.OpenFileDialog
|
||
{
|
||
Filter = "Java (javaw.exe;java.exe)|javaw.exe;java.exe|Tüm dosyalar|*.*",
|
||
Title = "Java yürütülebilir dosyasını seçin"
|
||
};
|
||
if (ofd.ShowDialog() == true) JavaBox.Text = ofd.FileName;
|
||
}
|
||
|
||
private void PerfPreset_Click(object sender, RoutedEventArgs e)
|
||
{
|
||
JvmBox.Text = "-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC";
|
||
}
|
||
|
||
private void ClearJvm_Click(object sender, RoutedEventArgs e) => JvmBox.Text = "";
|
||
|
||
private void OpenFolder_Click(object sender, RoutedEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
Directory.CreateDirectory(_core.PackageDir);
|
||
Process.Start(new ProcessStartInfo { FileName = _core.PackageDir, UseShellExecute = true });
|
||
}
|
||
catch (Exception ex) { MessageBox.Show(ex.Message); }
|
||
}
|
||
|
||
private void ClearCache_Click(object sender, RoutedEventArgs e)
|
||
{
|
||
if (MessageBox.Show("Önbellek (assets, libraries) silinsin mi? Bir sonraki açılışta yeniden indirilir.",
|
||
"Önbelleği Temizle", MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
|
||
return;
|
||
try
|
||
{
|
||
foreach (var sub in new[] { "assets", "libraries" })
|
||
{
|
||
var p = Path.Combine(_core.PackageDir, sub);
|
||
if (Directory.Exists(p)) Directory.Delete(p, true);
|
||
}
|
||
SavedHint.Text = "Önbellek temizlendi.";
|
||
}
|
||
catch (Exception ex) { MessageBox.Show(ex.Message); }
|
||
}
|
||
|
||
private void Save_Click(object sender, RoutedEventArgs e)
|
||
{
|
||
int max = (int)MaxRamSlider.Value;
|
||
int min = (int)MinRamSlider.Value;
|
||
if (min > max) min = max;
|
||
Properties.Settings.Default.MaxRamMb = max;
|
||
Properties.Settings.Default.MinRamMb = min;
|
||
Properties.Settings.Default.JavaPath = JavaBox.Text;
|
||
Properties.Settings.Default.JvmArguments = JvmBox.Text;
|
||
Properties.Settings.Default.Save();
|
||
SavedHint.Text = "✓ Ayarlar kaydedildi.";
|
||
}
|
||
}
|