Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasteles committed Mar 25, 2024
1 parent 591c47f commit ed16f48
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/SpaceWar/SaveInputsToFileListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public void OnConfirmed(in Frame frame, in ConfirmedInputs<PlayerInputs> inputs)
for (var i = 0; i < inputs.Count; i++)
{
var input = (ushort) inputs.Inputs[i];
Array.Clear(inputBuffer);
if (!input.TryFormat(inputBuffer, out _))
throw new InvalidOperationException("unable to save input");

Expand Down
Binary file modified samples/SpaceWar/replay.inputs
Binary file not shown.
7 changes: 7 additions & 0 deletions samples/SpaceWar/scripts/linux/start_2players_save.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
dotnet build -c Release "$(dirname "$0")/../.."
pushd "$(dirname "$0")/../../bin/Release/net8.0" || exit
rm ./*.log
dotnet SpaceWar.dll 9000 2 --save-to replay.inputs local 127.0.0.1:9001 &
dotnet SpaceWar.dll 9001 2 127.0.0.1:9000 local &
popd || exit
6 changes: 6 additions & 0 deletions samples/SpaceWar/scripts/linux/start_replay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
dotnet build -c Release "$(dirname "$0")/../.."
pushd "$(dirname "$0")/../../bin/Release/net8.0" || exit
rm ./*.log
dotnet SpaceWar.dll 9000 2 replay replay.inputs &
popd || exit

0 comments on commit ed16f48

Please sign in to comment.