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:
parent
41db9ed3f9
commit
3d183bc97b
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
/Glitonea
|
||||
emo-client.code-workspace
|
||||
emo-client.geany
|
||||
|
@ -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
|
||||
|
@ -15,23 +15,30 @@ namespace Saradomin.Infrastructure.Services
|
||||
|
||||
public ObservableCollection<ServerProfile> 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)
|
||||
{
|
||||
using (var sr = new StreamReader(filePath))
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -7,36 +7,13 @@
|
||||
<summary>2009 Runescape Emulation</summary>
|
||||
<metadata_license>CC0-1.0</metadata_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>
|
||||
<p>2009scape is a free, open-source launcher for Runescape 2009 Emulation servers</p>
|
||||
<p>Not affiliated with the Jagex Launcher or OSRS.</p>
|
||||
</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>
|
||||
<release version="1.8.1" date="2024-03-29">
|
||||
<description>
|
||||
|
@ -50,7 +50,7 @@
|
||||
Command="{Binding ExitApplication}"
|
||||
IsVisible="{Binding !Launcher.PlaceCloseButtonOnLeft}" />
|
||||
</Grid>
|
||||
|
||||
<!--
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,2,4,0"
|
||||
HorizontalAlignment="Right"
|
||||
@ -83,7 +83,7 @@
|
||||
Content="forums"
|
||||
CornerRadius="0,8,8,0" />
|
||||
</Grid>
|
||||
|
||||
-->
|
||||
<TabControl Grid.Row="1"
|
||||
Background="Transparent"
|
||||
BorderBrush="{StaticResource DarkBorderBrush}"
|
||||
@ -132,7 +132,7 @@
|
||||
</Border>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Width="95"
|
||||
<!--<TabItem Width="95"
|
||||
HorizontalContentAlignment="Center"
|
||||
CornerRadius="0,0,8,0"
|
||||
Header="singleplayer">
|
||||
@ -147,7 +147,7 @@
|
||||
<controls:SingleplayerView VerticalAlignment="Stretch" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</TabItem>
|
||||
</TabItem>-->
|
||||
</TabControl>
|
||||
|
||||
<Border Grid.Row="2"
|
||||
|
@ -28,7 +28,7 @@ namespace Saradomin.ViewModel.Windows
|
||||
|
||||
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 string LaunchText { get; private set; } = "Play!";
|
||||
@ -72,7 +72,7 @@ namespace Saradomin.ViewModel.Windows
|
||||
|
||||
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>");
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user