Take a contact from another station without reopening the contest

AppSession.TakeFromNetwork wrote the contact to the store and then called
OpenContest to see it, which built a new ContestSession, read the whole log
back and built new entry positions. Anything the operator was typing at either
radio went with them, and the entry boxes were rebuilt under the other
operator's hands. It also ran on the socket thread, so it was changing the log
while the windows were reading it.

ContestSession now applies the three messages itself: AddFromNetwork,
ReplaceFromNetwork and DeleteFromNetwork write the store, change the log in
place and raise Changed. None of them raises Logged, Edited or Deleted, so
nothing goes back out to the other stations. Points and multipliers are still
worked out here from the rules rather than trusted.

A contact that arrives goes in where its timestamp says it belongs, through
the new ContestLog.Insert, and the log is scored again: of two stations that
worked the same multiplier, the one that worked it first keeps it, however
late the message turns up. Add would have appended it at the end and given the
multiplier to the wrong contact.

The socket thread now hands the update to the thread the windows run on, which
is where every other change to the log is made.

The matching rule moved with the code, so ContestSession answers what a
message from N1MM refers to: the contact id, then the call and time it had
before the edit.

Still not tested against a second station. Two of these cannot run on one host
to try it, because they share one UDP port.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
2026-08-30 22:40:33 +00:00
co-authored by Claude Opus 5
parent 9b84b103ac
commit 98d51ab7f5
6 changed files with 288 additions and 40 deletions
+9
View File
@@ -71,6 +71,15 @@ public sealed class ContestLog
Rebuild();
}
/// Adds a contact that may be older than ones already logged, which is what
/// a contact from another station of the entry can be, and scores the log
/// again: the earlier of two contacts is the one that claims a multiplier.
public void Insert(Qso qso)
{
qsos.Add(qso);
Rebuild();
}
public void Remove(string id)
{
qsos.RemoveAll(q => q.Id == id);