Der M4-Umfang ist als Protokoll 4 portiert, serverautoritativ. Der Host besitzt LuneMatch und rechnet jeden Kampf; Clients senden nur Absichten und zeigen den Kampf aus Host-Momentaufnahmen. - LuneSession (Core/Net): Rollen offline/Host/Gast, sechs Sitze, Lobby, Hallo mit Protokollprüfung und Namenskürzung, Beitritt und Wieder- einstieg über den Anzeigenamen, private Planung mit Spoof-Schutz, Bereit ist verbindlich, Bots planen einmal je Runde, Disconnect gibt den Platz an einen Bot (nie Kernverlust), Übernahme verwirft den unbestätigten Bot-Entwurf, Revanche hält die Plätze, Hostverlust meldet und führt ins Menü zurück. - Kampfsynchronisation: Beginn mit Einheitenätzen und Gebäude-HP, alle 0,05 s neue Einheiten und ein Frame (13 Werte je Einheit), späte Frames über die Serial verworfen, Gast interpoliert (frame_alpha). - Transport: LuneLoopback (In-Prozess) für die Tests, LuneTcp + LuneWire (Cursor-Codec) für Echtverbindungen statt ENet; ein Socket je Gast. - Oberfläche: LuneMainMenu (Offline/Hosten/Beitreten, Bund, Lane, Name, Adresse, Port) als Startbildschirm, LuneNetPlay als Schale wie lune_main.gd. LuneGame leitet Befehle, Rückgängig und Bereit im Netzspiel über die Sitzung; Tempo und Pause bestimmt der Host. - Tests: NetSuite 43/43 (Port von test_lune_net.gd), NetRoundsSuite 12/12 (Port von net_rounds.py: 5 Runden, Prüfsummen gleich, Gast rechnet 0 Schritte, Drop und Wiedereinstieg auf denselben Sitz), LuneWireTests Round-trip. EditMode 29/29, PlayMode 13/13, Kerntests 457/457. Fingerabdrücke der Bot-Partien unverändert. - Dokumentation: U4-NETWORK (Abnahme, Grenzen), PORT-QA (U4), PORT-STATUS (U4 fertig, U5 nächster Schritt), KNOWN-BEHAVIOR-DIFFERENCES. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Luneraria.Core.Tests
|
|
{
|
|
/// <summary>
|
|
/// A test suite in the style of the Godot reference tests: named checks, counted, failures
|
|
/// collected with their label. The same suites run in the .NET harness (tools/dotnet) and in
|
|
/// Unity's Test Runner (Unity/CoreSuiteTests.cs); check counts stay comparable with Godot.
|
|
/// </summary>
|
|
public abstract class CheckSuite
|
|
{
|
|
public int Checks { get; private set; }
|
|
public readonly List<string> Failures = new List<string>();
|
|
public readonly List<string> Notes = new List<string>();
|
|
/// <summary>Folder with the golden files (Assets/Luneraria/Tests/Core/Golden).</summary>
|
|
public string GoldenDirectory = "";
|
|
|
|
public abstract string Name { get; }
|
|
|
|
protected abstract void RunChecks();
|
|
|
|
public bool Run()
|
|
{
|
|
Checks = 0;
|
|
Failures.Clear();
|
|
Notes.Clear();
|
|
try
|
|
{
|
|
RunChecks();
|
|
}
|
|
catch (Exception error)
|
|
{
|
|
Failures.Add("EXCEPTION " + error.GetType().Name + ": " + error.Message + "\n" + error.StackTrace);
|
|
}
|
|
return Failures.Count == 0;
|
|
}
|
|
|
|
protected void Check(bool ok, string label)
|
|
{
|
|
Checks += 1;
|
|
if (!ok)
|
|
Failures.Add(label);
|
|
}
|
|
|
|
protected void Note(string text)
|
|
{
|
|
Notes.Add(text);
|
|
}
|
|
|
|
public static IList<CheckSuite> All()
|
|
{
|
|
return new List<CheckSuite> { new ContentSuite(), new CoreRulesSuite(), new M2RulesSuite(), new GoldenSuite(), new DeterminismSuite(), new NetSuite(), new NetRoundsSuite() };
|
|
}
|
|
}
|
|
}
|