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:
11
main.go
11
main.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user