Running Server.Stop() should result in Client using Disconnected EventHandler getting DisconnectedEventArgs Reason of DisconnectReason.ServerStopped - instead it returns 80/unknown.
It can be repro-ed with this snippet:
using Riptide;
using Riptide.Utils;
public static class DemoBug
{
private static Server? Server;
private static Client? Client;
private static bool running = true;
private static bool triedToConnect;
private static uint tickCount;
static void Main(string[] args)
{
RiptideLogger.Initialize(Console.WriteLine, true);
Server = new Server();
Server!.Start(7777, 4);
Client = new Client();
Client.Disconnected += (_, dea) =>
{
if (dea.Reason != DisconnectReason.Disconnected)
Console.WriteLine($"Disconnected. Reason is {dea.Reason}");
};
while (running)
{
Server.Update();
Client.Update();
Thread.Sleep(10);
if (!triedToConnect)
{
triedToConnect = true;
Client.Connect("127.0.0.1:7777");
}
switch (tickCount)
{
case 250:
Server.Stop();
break;
case 500:
running = false;
break;
default:
break;
}
tickCount++;
}
}
}
Running Server.Stop() should result in Client using Disconnected EventHandler getting DisconnectedEventArgs Reason of DisconnectReason.ServerStopped - instead it returns 80/unknown.
It can be repro-ed with this snippet: