Skip to content

Commit

Permalink
Remove authentication from launcher (#195)
Browse files Browse the repository at this point in the history
* Remove authentication from launcher

* Remove FirebaseAuthentication NuGet package

* Remove unused files and update changelog for 931

* Update README
  • Loading branch information
CorruptComputer authored Mar 13, 2023
1 parent 67a9eea commit 0047018
Show file tree
Hide file tree
Showing 29 changed files with 29 additions and 1,250 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Flathub](https://img.shields.io/flathub/v/org.unitystation.StationHub?style=flat-square)](https://flathub.org/apps/details/org.unitystation.StationHub)
[![Discord](https://img.shields.io/discord/273774715741667329?style=flat-square)](https://discord.com/invite/tFcTpBp)

This is the official launcher for Unitystation, it handles account creation, downloading, updating, and server joining.
StationHub is the official launcher for Unitystation, it handles downloading, updating, and joining servers.

## Tech-stack
It is cross-platform using .NET 6 as the runtime and [Avalonia MVVM](https://docs.avaloniaui.net/guides/basics/mvvm) for the UI.
Expand Down
Binary file removed UnitystationLauncher/Assets/buttoncontext.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<li>Adds links to the Unitystation Discord and GitHub issues pages.</li>
<li>The auto update feature has been replaced with a notification.</li>
<li>Adds a placeholder to the News panel, this will be replaced with posts from the Unitystation Blog in the future.</li>
<li>Account creation, management, and login is now handled by the game instead of StationHub.</li>
</ul>
<p>Bug Fixes:</p>
<ul>
Expand Down
Binary file removed UnitystationLauncher/Assets/userbg.png
Binary file not shown.
Binary file removed UnitystationLauncher/Assets/userico.jpg
Binary file not shown.
1 change: 1 addition & 0 deletions UnitystationLauncher/Models/Api/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace UnitystationLauncher.Models.Api
{
[Serializable]
public class Server
{
public Server(string forkName, int buildVersion, string serverIp, int serverPort)
Expand Down
4 changes: 3 additions & 1 deletion UnitystationLauncher/Models/Api/ServerList.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;

namespace UnitystationLauncher.Models.Api
{
[Serializable]
public class ServerList
{
public List<Server> Servers { get; set; } = new List<Server>();
public List<Server> Servers { get; set; } = new();
}
}
4 changes: 2 additions & 2 deletions UnitystationLauncher/Models/Installation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public Installation(string folderPath)
return exe;
}

public void LaunchWithArgs(string ip, short port, string? refreshToken, string? uid)
public void LaunchWithArgs(string ip, short port)
{
Start($"--server {ip} --port {port} --refreshtoken {refreshToken} --uid {uid}");
Start($"--server {ip} --port {port}");
}

public void LaunchWithoutArgs()
Expand Down
247 changes: 0 additions & 247 deletions UnitystationLauncher/Services/AuthService.cs

This file was deleted.

9 changes: 7 additions & 2 deletions UnitystationLauncher/Services/ServerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using System.Linq;
using System.Net.Http;
using System.Reactive.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ReactiveUI;
using Serilog;
using UnitystationLauncher.Constants;
Expand Down Expand Up @@ -41,7 +41,12 @@ private async Task<IReadOnlyList<Server>> GetServerListAsync()
Refreshing = true;

string data = await _http.GetStringAsync(ApiUrls.ServerListUrl);
List<Server>? serverData = JsonConvert.DeserializeObject<ServerList>(data)?.Servers;
List<Server>? serverData = JsonSerializer.Deserialize<ServerList>(data, options: new()
{
IgnoreReadOnlyProperties = true,
PropertyNameCaseInsensitive = true
})?.Servers;

Log.Information("Server list fetched");

List<Server> servers = new();
Expand Down
4 changes: 0 additions & 4 deletions UnitystationLauncher/StandardModule.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Net.Http;
using Autofac;
using Firebase.Auth;
using UnitystationLauncher.Models.ConfigFile;

namespace UnitystationLauncher
Expand All @@ -18,9 +17,6 @@ protected override void Load(ContainerBuilder builder)

builder.RegisterAssemblyTypes(ThisAssembly)
.Where(t => t.Name.EndsWith("ViewModel"));

builder.Register(c => new FirebaseConfig("AIzaSyB7GorzPgwHYjSV4XaJoszj98tLM4_WZpE")).SingleInstance();
builder.RegisterType<FirebaseAuthProvider>().SingleInstance();
}
}
}
1 change: 0 additions & 1 deletion UnitystationLauncher/UnitystationLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
<PackageReference Include="MessageBox.Avalonia" Version="2.1.0" />
<PackageReference Include="morelinq" Version="3.3.2" />
<PackageReference Include="FirebaseAuthentication.net" Version="3.7.2" />
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9.3" />
<PackageReference Include="ReactiveProperty" Version="8.2.0" />
<PackageReference Include="Serilog" Version="2.12.0" />
Expand Down
Loading

0 comments on commit 0047018

Please sign in to comment.