Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
Various fixes, stability, new features:
Browse files Browse the repository at this point in the history
* Added EchoRelay.Cli, a lightweight, more performant, naive multi-platform commandline app similar to EchoRelay.App
* Added optional game server endpoint validation (rejecting game servers at registration time if their game server port is not open).
* Added checks to enforce only 4v4 in public Echo Arena and Echo Combat matches (it's not 'correct', but it works).
* Added game executable version checks to EchoRelay.Patch, warning users if their game version is incorrect on start.
* Added "[DEMO]" suffix to window title when using -noovr, to distinguish OVR/NoOVR.
* Changed disable AFK timeout to be enabled by default for new accounts.
* Fixed -headless high CPU usage
* Added a -timestep argument for -headless, to set a fixed tickrate per second (default 120).
* Fixed EchoRelay.GameServer unloading so it can properly be unloaded now without needing to force quit.
* Hooked game server's "fail to load level" to instead re-create sessions, so requests for non-existent levels/gametypes cannot crash/trap game servers at a failed to load level screen.
* Various more bug fixes, including a thread deadlock issue in EchoRelay.App when games would end, causing large state transitions in the app (this example app still isn't great for that)
* Added unfinished AI/bot code.
  • Loading branch information
Xenomega committed Nov 9, 2023
1 parent 9b6202f commit d1bf840
Show file tree
Hide file tree
Showing 58 changed files with 2,049 additions and 426 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,6 @@ ipch/

# Nuget package cache
packages/

# EchoRelay.Cli
EchoRelay.Cli/Properties/launchSettings.json
13 changes: 13 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<PropertyGroup>
<!--
If you intend to derive from this project, please give credit to the original repository (https://github.com/Xenomega/EchoRelay)
as stated in the README, and distinguish your project from mine (the original), so I am not confused as the author of your project/fork.
Thank you,
~Xenomega (David Pokora)
-->
<Authors>Xenomega (David Pokora)</Authors>
<Company>Xenomega (David Pokora)</Company>
<Version>0.7.0</Version>
</PropertyGroup>
</Project>
2 changes: 2 additions & 0 deletions EchoRelay.App/EchoRelay.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<RepositoryUrl>https://github.com/Xenomega/EchoRelay</RepositoryUrl>
<Authors>Xenomega (David Pokora)</Authors>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 7 additions & 3 deletions EchoRelay.App/Forms/Controls/GameServersControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public GameServersControl()

public void AddOrUpdateGameServer(RegisteredGameServer gameServer)
{
// If the peer isn't connected, this might've been triggered out of order, do nothing.
if (!gameServer.Peer.Connected)
return;

// Obtain an existing list view item for this game server, or create one.
ListViewItem? listItem = null;
if (!_items.TryGetValue(gameServer.ServerId, out listItem))
Expand Down Expand Up @@ -60,7 +64,7 @@ public void AddOrUpdateGameServer(RegisteredGameServer gameServer)
{
listItem.SubItems[4].Text = "-";
}
listItem.SubItems[5].Text = $"{gameServer.SessionPlayerCount}/{gameServer.SessionPlayerLimit}";
listItem.SubItems[5].Text = $"{gameServer.SessionPlayerCount}/{gameServer.SessionPlayerLimits.TotalPlayerLimit}";
listItem.SubItems[6].Text = gameServer.SessionLobbyType.ToString();
listItem.SubItems[7].Text = gameServer.SessionLocked.ToString();
listItem.SubItems[8].Text = gameServer.SessionChannel?.ToString() ?? "-";
Expand Down Expand Up @@ -90,7 +94,7 @@ private void listGameServers_SelectedIndexChanged(object sender, EventArgs e)
listGameServers.ContextMenuStrip = listGameServers.SelectedItems.Count > 0 ? contextMenuGameServers : null;
}

private void RefreshSelectedGameServer()
private async void RefreshSelectedGameServer()
{
// Obtain the selected item, if any.
ListViewItem? selectedItem = null;
Expand All @@ -105,7 +109,7 @@ private void RefreshSelectedGameServer()
{
// Create items for every player in the game server.
RegisteredGameServer selectedGameServer = (RegisteredGameServer)selectedItem.Tag;
var playersInfo = selectedGameServer.GetPlayers().Result;
var playersInfo = await selectedGameServer.GetPlayers();
foreach (var playerInfo in playersInfo)
{
// Create a list item for this player
Expand Down
4 changes: 4 additions & 0 deletions EchoRelay.App/Forms/Controls/PeerConnectionsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public PeerConnectionsControl()

public void AddOrUpdatePeer(Peer peer)
{
// If the peer isn't connected, this might've been triggered out of order, do nothing.
if (!peer.Connected)
return;

// Obtain an existing list view item for this peer, or create one.
ListViewItem? listItem = null;
if (!_items.TryGetValue(peer.Id, out listItem))
Expand Down
3 changes: 2 additions & 1 deletion EchoRelay.App/Forms/Controls/ServerInfoControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EchoRelay.Core.Server;
using EchoRelay.Core.Utils;
using Newtonsoft.Json;

namespace EchoRelay.App.Forms.Controls
Expand Down Expand Up @@ -28,7 +29,7 @@ public void UpdateServerInfo(Server? server, bool updateServiceConfig)
if (server != null)
{
string hostName = server.PublicIPAddress?.ToString() ?? "localhost";
rtbGeneratedServiceConfig.Text = JsonConvert.SerializeObject(server.Settings.GenerateServiceConfig(hostName), Formatting.Indented);
rtbGeneratedServiceConfig.Text = JsonConvert.SerializeObject(server.Settings.GenerateServiceConfig(hostName, serverConfig: true), Formatting.Indented, StreamIO.JsonSerializerSettings);
}
else
{
Expand Down
Loading

0 comments on commit d1bf840

Please sign in to comment.