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

Commit d1bf840

Browse files
committed
Various fixes, stability, new features:
* 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.
1 parent 9b6202f commit d1bf840

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2049
-426
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,6 @@ ipch/
236236

237237
# Nuget package cache
238238
packages/
239+
240+
# EchoRelay.Cli
241+
EchoRelay.Cli/Properties/launchSettings.json

Directory.Build.targets

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<PropertyGroup>
3+
<!--
4+
If you intend to derive from this project, please give credit to the original repository (https://github.com/Xenomega/EchoRelay)
5+
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.
6+
Thank you,
7+
~Xenomega (David Pokora)
8+
-->
9+
<Authors>Xenomega (David Pokora)</Authors>
10+
<Company>Xenomega (David Pokora)</Company>
11+
<Version>0.7.0</Version>
12+
</PropertyGroup>
13+
</Project>

EchoRelay.App/EchoRelay.App.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<Nullable>enable</Nullable>
77
<UseWindowsForms>true</UseWindowsForms>
88
<ImplicitUsings>enable</ImplicitUsings>
9+
<RepositoryUrl>https://github.com/Xenomega/EchoRelay</RepositoryUrl>
10+
<Authors>Xenomega (David Pokora)</Authors>
911
</PropertyGroup>
1012

1113
<ItemGroup>

EchoRelay.App/Forms/Controls/GameServersControl.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public GameServersControl()
2929

3030
public void AddOrUpdateGameServer(RegisteredGameServer gameServer)
3131
{
32+
// If the peer isn't connected, this might've been triggered out of order, do nothing.
33+
if (!gameServer.Peer.Connected)
34+
return;
35+
3236
// Obtain an existing list view item for this game server, or create one.
3337
ListViewItem? listItem = null;
3438
if (!_items.TryGetValue(gameServer.ServerId, out listItem))
@@ -60,7 +64,7 @@ public void AddOrUpdateGameServer(RegisteredGameServer gameServer)
6064
{
6165
listItem.SubItems[4].Text = "-";
6266
}
63-
listItem.SubItems[5].Text = $"{gameServer.SessionPlayerCount}/{gameServer.SessionPlayerLimit}";
67+
listItem.SubItems[5].Text = $"{gameServer.SessionPlayerCount}/{gameServer.SessionPlayerLimits.TotalPlayerLimit}";
6468
listItem.SubItems[6].Text = gameServer.SessionLobbyType.ToString();
6569
listItem.SubItems[7].Text = gameServer.SessionLocked.ToString();
6670
listItem.SubItems[8].Text = gameServer.SessionChannel?.ToString() ?? "-";
@@ -90,7 +94,7 @@ private void listGameServers_SelectedIndexChanged(object sender, EventArgs e)
9094
listGameServers.ContextMenuStrip = listGameServers.SelectedItems.Count > 0 ? contextMenuGameServers : null;
9195
}
9296

93-
private void RefreshSelectedGameServer()
97+
private async void RefreshSelectedGameServer()
9498
{
9599
// Obtain the selected item, if any.
96100
ListViewItem? selectedItem = null;
@@ -105,7 +109,7 @@ private void RefreshSelectedGameServer()
105109
{
106110
// Create items for every player in the game server.
107111
RegisteredGameServer selectedGameServer = (RegisteredGameServer)selectedItem.Tag;
108-
var playersInfo = selectedGameServer.GetPlayers().Result;
112+
var playersInfo = await selectedGameServer.GetPlayers();
109113
foreach (var playerInfo in playersInfo)
110114
{
111115
// Create a list item for this player

EchoRelay.App/Forms/Controls/PeerConnectionsControl.cs

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public PeerConnectionsControl()
2929

3030
public void AddOrUpdatePeer(Peer peer)
3131
{
32+
// If the peer isn't connected, this might've been triggered out of order, do nothing.
33+
if (!peer.Connected)
34+
return;
35+
3236
// Obtain an existing list view item for this peer, or create one.
3337
ListViewItem? listItem = null;
3438
if (!_items.TryGetValue(peer.Id, out listItem))

EchoRelay.App/Forms/Controls/ServerInfoControl.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using EchoRelay.Core.Server;
2+
using EchoRelay.Core.Utils;
23
using Newtonsoft.Json;
34

45
namespace EchoRelay.App.Forms.Controls
@@ -28,7 +29,7 @@ public void UpdateServerInfo(Server? server, bool updateServiceConfig)
2829
if (server != null)
2930
{
3031
string hostName = server.PublicIPAddress?.ToString() ?? "localhost";
31-
rtbGeneratedServiceConfig.Text = JsonConvert.SerializeObject(server.Settings.GenerateServiceConfig(hostName), Formatting.Indented);
32+
rtbGeneratedServiceConfig.Text = JsonConvert.SerializeObject(server.Settings.GenerateServiceConfig(hostName, serverConfig: true), Formatting.Indented, StreamIO.JsonSerializerSettings);
3233
}
3334
else
3435
{

0 commit comments

Comments
 (0)