Count from the log again on Reset Serial Numbers

The button started the numbers again at one. N1MM's manual says it "sets
serial numbers on all computers to the highest value in any of the logs,
plus 1", and its own handler re-reads the highest number per band out of
the log, so a mixed network came apart at exactly the point the button is
meant to repair: the N1MM stations counted on from the highest number and
this one started at one, sending numbers that had already gone out.

ContestSession.RestartNumbers fills the pool from the log, which is where
the reset now lands. SerialNumbersFrom is gone with it, and so is the pool
this station sent afterwards: N1MM sends none, because each station works
the same number out of its own copy of the log.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015NZkFxHde1iifAQemFTHxf
This commit is contained in:
2026-09-10 12:28:03 +00:00
co-authored by Claude Opus 5
parent 7ba0b44fc1
commit 980ddb586f
8 changed files with 50 additions and 35 deletions
+1 -1
View File
@@ -456,7 +456,7 @@ public sealed class StationLink : IDisposable
computerName),
cancellation);
/// Tells every station to start its serial numbers again at one.
/// Tells every station to count its serial numbers from the log again.
public Task<int> SendResetSerialNumbersAsync(CancellationToken cancellation = default) =>
SendAsync(StationMessages.ResetSerialNumbers(StationNumber, computerName), cancellation);
+5 -3
View File
@@ -26,7 +26,7 @@ namespace Nonemm.Network;
/// | `CONTESTNAME` | which contest the sender is logging | yes | yes |
/// | `TIME` | the sender's clock | yes | yes |
/// | `MASTER` | which station is the master for the cluster and the time | yes | yes |
/// | `RESETQSONRS` | start the serial numbers again at one | yes | yes |
/// | `RESETQSONRS` | count the serial numbers from the log again | yes | yes |
/// | `ReserveNr` | a serial number the sender has taken for a contact | yes | yes |
/// | `QSONRS` | the highest serial number taken on each band | yes | yes |
/// | `STACKCALL` | a contact for another station's call stack | yes | yes |
@@ -304,8 +304,10 @@ public static class StationMessages
public static StationRecord Master(string masterName, int stationNumber, string computerName) =>
Record("MASTER", stationNumber, computerName, [masterName]);
/// Start the serial numbers again at one. It is sent when an operator finds
/// the entry has been logging with numbers from a contest before this one.
/// Count the serial numbers from the log again, so the next one is the
/// highest logged plus one. Each station works that out from its own copy
/// of the log, so the message carries nothing. N1MM's manual calls it "only
/// for use when you have screwed up".
public static StationRecord ResetSerialNumbers(int stationNumber, string computerName) =>
Record("RESETQSONRS", stationNumber, computerName, []);