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

This commit is contained in:
EmoScape 2025-03-02 09:47:30 -05:00
parent 41db9ed3f9
commit 3d183bc97b
7 changed files with 45 additions and 55 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
/Glitonea /Glitonea
emo-client.code-workspace
emo-client.geany

View File

@ -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

View File

@ -15,23 +15,30 @@ namespace Saradomin.Infrastructure.Services
public ObservableCollection<ServerProfile> AvailableProfiles { get; private set; } = new(); public ObservableCollection<ServerProfile> AvailableProfiles { get; private set; } = new();
public async Task FetchServerProfileConfig(string outputPath) public async Task FetchServerProfileConfig(string outputPath)
{ {
using (var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) }) using (var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) })
{ {
var configJson = await httpClient.GetStringAsync(ServerProfilesURL); // Fetch the remote config JSON.
var configJson = await httpClient.GetStringAsync(ServerProfilesURL);
Console.WriteLine($"Fetched config from {ServerProfilesURL}:");
Console.WriteLine(configJson);
if (File.Exists(outputPath)) // Get the full path for clarity.
{ var fullPath = Path.GetFullPath(outputPath);
File.Delete(outputPath);
} if (File.Exists(outputPath))
else {
{ Console.WriteLine($"Deleting existing file at {fullPath}");
await File.WriteAllTextAsync(outputPath!, configJson); File.Delete(outputPath);
}
}
} }
Console.WriteLine($"Writing config to {fullPath}");
await File.WriteAllTextAsync(outputPath, configJson);
}
}
public async Task LoadServerProfileConfig(string filePath) public async Task LoadServerProfileConfig(string filePath)
{ {
using (var sr = new StreamReader(filePath)) using (var sr = new StreamReader(filePath))

View File

@ -8,21 +8,25 @@ namespace Saradomin.Model.Settings.Client
{ {
public const string FileName = "config.json"; 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 TestServerAddress = "test.2009scape.org";
public const string LocalServerAddress = "localhost"; public const string LocalServerAddress = "localhost";
public enum ServerProfile public enum ServerProfile
{ {
[Description("Stable server;play.2009scape.org")] [Description("EmoScape Game Server;play.emoscape.org")]
Live, Live,
[Description("Testing server;test.2009scape.org")] [Description("2009Scape Testing Server;test.2009scape.org")]
Testing, Testing,
[Description("Local server;localhost")] [Description("Local Server;localhost")]
Local, Local,
[Description("Original 2009Scape Server;play.2009scape.org")]
Original,
[Description("Unsupported server")] [Description("Unsupported server")]
Unsupported Unsupported
} }

View File

@ -7,36 +7,13 @@
<summary>2009 Runescape Emulation</summary> <summary>2009 Runescape Emulation</summary>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
<project_license>AGPL-3.0-or-later</project_license> <project_license>AGPL-3.0-or-later</project_license>
<url type="homepage">https://2009scape.org/</url> <url type="homepage">https://emoscape.org/</url>
<description> <description>
<p>2009scape is a free, open-source launcher for Runescape 2009 Emulation servers</p> <p>2009scape is a free, open-source launcher for Runescape 2009 Emulation servers</p>
<p>Not affiliated with the Jagex Launcher or OSRS.</p> <p>Not affiliated with the Jagex Launcher or OSRS.</p>
</description> </description>
<screenshots>
<screenshot type="default">
<image>https://i.imgur.com/pmcGBRd.jpg</image>
<caption>Running from Chickens - 2009scape, Play Now!</caption>
</screenshot>
<screenshot>
<image>https://i.imgur.com/mKJ3j1c.png</image>
<caption>2009scape Screenshot Collage - 2009scape Fully Authentic Remake</caption>
</screenshot>
<screenshot>
<image>https://i.imgur.com/HlyM2vN.png</image>
<caption>2009scape Login Screen - 2009scape has been hosted since 2017 for free</caption>
</screenshot>
<screenshot>
<image>https://i.imgur.com/SHqJlKf.png</image>
<caption>A 2009scape player in Falador after a Wyvern trip</caption>
</screenshot>
<screenshot>
<image>https://i.imgur.com/ZzXLnkc.png</image>
<caption>2009scape Hiscores - Players have cumulatively played over 20,000 hours on 2009scape</caption>
</screenshot>
</screenshots>
<releases> <releases>
<release version="1.8.1" date="2024-03-29"> <release version="1.8.1" date="2024-03-29">
<description> <description>

View File

@ -50,7 +50,7 @@
Command="{Binding ExitApplication}" Command="{Binding ExitApplication}"
IsVisible="{Binding !Launcher.PlaceCloseButtonOnLeft}" /> IsVisible="{Binding !Launcher.PlaceCloseButtonOnLeft}" />
</Grid> </Grid>
<!--
<Grid Grid.Row="1" <Grid Grid.Row="1"
Margin="0,2,4,0" Margin="0,2,4,0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
@ -83,7 +83,7 @@
Content="forums" Content="forums"
CornerRadius="0,8,8,0" /> CornerRadius="0,8,8,0" />
</Grid> </Grid>
-->
<TabControl Grid.Row="1" <TabControl Grid.Row="1"
Background="Transparent" Background="Transparent"
BorderBrush="{StaticResource DarkBorderBrush}" BorderBrush="{StaticResource DarkBorderBrush}"
@ -132,7 +132,7 @@
</Border> </Border>
</TabItem> </TabItem>
<TabItem Width="95" <!--<TabItem Width="95"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
CornerRadius="0,0,8,0" CornerRadius="0,0,8,0"
Header="singleplayer"> Header="singleplayer">
@ -147,7 +147,7 @@
<controls:SingleplayerView VerticalAlignment="Stretch" /> <controls:SingleplayerView VerticalAlignment="Stretch" />
</ScrollViewer> </ScrollViewer>
</Border> </Border>
</TabItem> </TabItem>-->
</TabControl> </TabControl>
<Border Grid.Row="2" <Border Grid.Row="2"

View File

@ -28,7 +28,7 @@ namespace Saradomin.ViewModel.Windows
private LauncherSettings Launcher { get; } private LauncherSettings Launcher { get; }
public string Title { get; set; } = "2009scape launcher"; public string Title { get; set; } = "EmoScape Launcher";
public bool CanLaunch { get; private set; } = true; public bool CanLaunch { get; private set; } = true;
public string LaunchText { get; private set; } = "Play!"; public string LaunchText { get; private set; } = "Play!";
@ -72,7 +72,7 @@ namespace Saradomin.ViewModel.Windows
private HtmlNode ConnectionErrorMessage(HtmlDocument doc, string msg) private HtmlNode ConnectionErrorMessage(HtmlDocument doc, string msg)
{ {
var failMessage = "<html><body><h3>Not Available<h3><br/>This content is unavailable, likely due to a "; var failMessage = "<html><body><h3>Not Available<h3><br/>Nothing Here: ";
doc.LoadHtml(failMessage + msg + "</body></html>"); doc.LoadHtml(failMessage + msg + "</body></html>");
return doc.DocumentNode; return doc.DocumentNode;
} }
@ -87,18 +87,18 @@ namespace Saradomin.ViewModel.Windows
try try
{ {
var response = 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()); doc.Load(await response.Content.ReadAsStreamAsync());
node = doc.DocumentNode.SelectSingleNode("//div[@class='msgcontents']"); node = doc.DocumentNode.SelectSingleNode("//div[@class='msgcontents']");
} }
catch (HttpRequestException) catch (HttpRequestException)
{ {
node = ConnectionErrorMessage(doc, "lack of an internet connection."); node = ConnectionErrorMessage(doc, "you seem to lack an internet connection.");
} }
if (node == null) if (node == null)
{ {
// If 2009scape is blocked // 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); var renderer = new HtmlRenderer(node);
HtmlInlines = renderer.Render(); HtmlInlines = renderer.Render();
@ -110,7 +110,7 @@ namespace Saradomin.ViewModel.Windows
DimContent = msg.WasOpened; DimContent = msg.WasOpened;
} }
public void LaunchPage(object parameter) /* public void LaunchPage(object parameter)
{ {
var url = parameter switch var url = parameter switch
{ {
@ -123,7 +123,7 @@ namespace Saradomin.ViewModel.Windows
}; };
CrossPlatform.LaunchURL(url); CrossPlatform.LaunchURL(url);
} } */
[DependsOn(nameof(CanLaunch))] [DependsOn(nameof(CanLaunch))]
public bool CanExecuteLaunchSequence(object parameter) public bool CanExecuteLaunchSequence(object parameter)