From 3d183bc97bc75cb3e3c29324074f3d0736c02226 Mon Sep 17 00:00:00 2001 From: EmoScape Date: Sun, 2 Mar 2025 09:47:30 -0500 Subject: [PATCH] modified emo client to rely on non-gitlab resources and builds, and removed some stuff I want to change in the future on the main window --- .gitignore | 2 ++ Glitonea_Reminder | 2 +- .../Services/RemoteConfigService.cs | 35 +++++++++++-------- .../Model/Settings/Client/ClientSettings.cs | 14 +++++--- .../Linux/org._2009scape.Launcher.appdata.xml | 25 +------------ Saradomin/View/Windows/MainWindow.axaml | 8 ++--- .../ViewModel/Windows/MainWindowViewModel.cs | 14 ++++---- 7 files changed, 45 insertions(+), 55 deletions(-) diff --git a/.gitignore b/.gitignore index 6b9b67b..73587ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /Glitonea +emo-client.code-workspace +emo-client.geany diff --git a/Glitonea_Reminder b/Glitonea_Reminder index 204e5ff..15453f5 100644 --- a/Glitonea_Reminder +++ b/Glitonea_Reminder @@ -1 +1 @@ -Note this project requires Glitonea: https://github.com/vddCore/Glitonea +Note this project requires Glitonea: https://github.com/vddCore/Glitonea at commit 9fb6de8 diff --git a/Saradomin/Infrastructure/Services/RemoteConfigService.cs b/Saradomin/Infrastructure/Services/RemoteConfigService.cs index 0046fc7..5d73ba1 100644 --- a/Saradomin/Infrastructure/Services/RemoteConfigService.cs +++ b/Saradomin/Infrastructure/Services/RemoteConfigService.cs @@ -15,22 +15,29 @@ namespace Saradomin.Infrastructure.Services public ObservableCollection AvailableProfiles { get; private set; } = new(); - public async Task FetchServerProfileConfig(string outputPath) - { - using (var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) }) - { - var configJson = await httpClient.GetStringAsync(ServerProfilesURL); +public async Task FetchServerProfileConfig(string outputPath) +{ + using (var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) }) + { + // Fetch the remote config JSON. + var configJson = await httpClient.GetStringAsync(ServerProfilesURL); + Console.WriteLine($"Fetched config from {ServerProfilesURL}:"); + Console.WriteLine(configJson); - if (File.Exists(outputPath)) - { - File.Delete(outputPath); - } - else - { - await File.WriteAllTextAsync(outputPath!, configJson); - } - } + // Get the full path for clarity. + var fullPath = Path.GetFullPath(outputPath); + + if (File.Exists(outputPath)) + { + Console.WriteLine($"Deleting existing file at {fullPath}"); + File.Delete(outputPath); } + + Console.WriteLine($"Writing config to {fullPath}"); + await File.WriteAllTextAsync(outputPath, configJson); + } +} + public async Task LoadServerProfileConfig(string filePath) { diff --git a/Saradomin/Model/Settings/Client/ClientSettings.cs b/Saradomin/Model/Settings/Client/ClientSettings.cs index 2776343..05cfed6 100644 --- a/Saradomin/Model/Settings/Client/ClientSettings.cs +++ b/Saradomin/Model/Settings/Client/ClientSettings.cs @@ -8,21 +8,25 @@ namespace Saradomin.Model.Settings.Client { public const string FileName = "config.json"; - public const string LiveServerAddress = "play.2009scape.org"; + public const string LiveServerAddress = "play.emoscape.org"; + public const string OriginalServerAddress = "play.2009scape.org"; public const string TestServerAddress = "test.2009scape.org"; public const string LocalServerAddress = "localhost"; public enum ServerProfile { - [Description("Stable server;play.2009scape.org")] + [Description("EmoScape Game Server;play.emoscape.org")] Live, - [Description("Testing server;test.2009scape.org")] + [Description("2009Scape Testing Server;test.2009scape.org")] Testing, - [Description("Local server;localhost")] + [Description("Local Server;localhost")] Local, - + + [Description("Original 2009Scape Server;play.2009scape.org")] + Original, + [Description("Unsupported server")] Unsupported } diff --git a/Saradomin/Resources/Linux/org._2009scape.Launcher.appdata.xml b/Saradomin/Resources/Linux/org._2009scape.Launcher.appdata.xml index 3a0d335..e96b7a2 100644 --- a/Saradomin/Resources/Linux/org._2009scape.Launcher.appdata.xml +++ b/Saradomin/Resources/Linux/org._2009scape.Launcher.appdata.xml @@ -7,36 +7,13 @@ 2009 Runescape Emulation CC0-1.0 AGPL-3.0-or-later - https://2009scape.org/ + https://emoscape.org/

2009scape is a free, open-source launcher for Runescape 2009 Emulation servers

Not affiliated with the Jagex Launcher or OSRS.

- - - https://i.imgur.com/pmcGBRd.jpg - Running from Chickens - 2009scape, Play Now! - - - https://i.imgur.com/mKJ3j1c.png - 2009scape Screenshot Collage - 2009scape Fully Authentic Remake - - - https://i.imgur.com/HlyM2vN.png - 2009scape Login Screen - 2009scape has been hosted since 2017 for free - - - https://i.imgur.com/SHqJlKf.png - A 2009scape player in Falador after a Wyvern trip - - - https://i.imgur.com/ZzXLnkc.png - 2009scape Hiscores - Players have cumulatively played over 20,000 hours on 2009scape - - - diff --git a/Saradomin/View/Windows/MainWindow.axaml b/Saradomin/View/Windows/MainWindow.axaml index 4cba5f2..5db3654 100644 --- a/Saradomin/View/Windows/MainWindow.axaml +++ b/Saradomin/View/Windows/MainWindow.axaml @@ -50,7 +50,7 @@ Command="{Binding ExitApplication}" IsVisible="{Binding !Launcher.PlaceCloseButtonOnLeft}" /> - + - @@ -147,7 +147,7 @@ - + --> "); return doc.DocumentNode; } @@ -87,18 +87,18 @@ namespace Saradomin.ViewModel.Windows try { var response = - await httpClient.GetAsync("https://2009scape.org/services/m=news/archives/latest.html"); + await httpClient.GetAsync("https://2009scape.org/latest.html"); doc.Load(await response.Content.ReadAsStreamAsync()); node = doc.DocumentNode.SelectSingleNode("//div[@class='msgcontents']"); } catch (HttpRequestException) { - node = ConnectionErrorMessage(doc, "lack of an internet connection."); + node = ConnectionErrorMessage(doc, "you seem to lack an internet connection."); } if (node == null) { // If 2009scape is blocked - node = ConnectionErrorMessage(doc, "blocked internet connection. The stable server should still work."); + node = ConnectionErrorMessage(doc, "no updates or emoscape.org is blocked on your ISP."); } var renderer = new HtmlRenderer(node); HtmlInlines = renderer.Render(); @@ -110,7 +110,7 @@ namespace Saradomin.ViewModel.Windows DimContent = msg.WasOpened; } - public void LaunchPage(object parameter) + /* public void LaunchPage(object parameter) { var url = parameter switch { @@ -123,7 +123,7 @@ namespace Saradomin.ViewModel.Windows }; CrossPlatform.LaunchURL(url); - } + } */ [DependsOn(nameof(CanLaunch))] public bool CanExecuteLaunchSequence(object parameter)