Simplify config: encode channels in address strings

- from: "0.0.1:50-100" specifies channel range
- to: "0.0.1:50" specifies starting channel only (range implied by from)
- Remove from_channel, to_channel, count fields
- Support plain universe numbers with channels: "1:50-100"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2025-12-22 09:37:09 -08:00
parent 7743836d53
commit d88ef4ccee
3 changed files with 169 additions and 90 deletions

11
main.go
View File

@@ -41,13 +41,10 @@ func main() {
// Log mappings
for _, m := range cfg.Mappings {
if m.Count == 512 && m.FromChannel == 1 {
log.Printf(" %s -> %s (all channels)", m.From.Universe, m.To.Universe)
} else {
log.Printf(" %s[%d-%d] -> %s[%d-%d]",
m.From.Universe, m.FromChannel, m.FromChannel+m.Count-1,
m.To.Universe, m.ToChannel, m.ToChannel+m.Count-1)
}
toEnd := m.To.ChannelStart + m.From.Count() - 1
log.Printf(" %s:%d-%d -> %s:%d-%d",
m.From.Universe, m.From.ChannelStart, m.From.ChannelEnd,
m.To.Universe, m.To.ChannelStart, toEnd)
}
// Create sender