X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/aebc4d3647b9823ae8cbb57b21b1af83bfd011fb..8277fb93fd2c957e5fd609b68a001babea46cdc4:/hotline/tracker.go diff --git a/hotline/tracker.go b/hotline/tracker.go index 0825fc7..63fb279 100644 --- a/hotline/tracker.go +++ b/hotline/tracker.go @@ -12,11 +12,11 @@ import ( ) type TrackerRegistration struct { - Port []byte // Server listening port number - UserCount int // Number of users connected to this particular server - PassID []byte // Random number generated by the server - Name string // Server name - Description string // Description of the server + Port [2]byte // Server listening port number + UserCount int // Number of users connected to this particular server + PassID []byte // Random number generated by the server + Name string // Server name + Description string // Description of the server } func (tr *TrackerRegistration) Payload() []byte { @@ -25,7 +25,7 @@ func (tr *TrackerRegistration) Payload() []byte { return concat.Slices( []byte{0x00, 0x01}, - tr.Port, + tr.Port[:], userCount, []byte{0x00, 0x00}, tr.PassID, @@ -36,7 +36,7 @@ func (tr *TrackerRegistration) Payload() []byte { ) } -func register(tracker string, tr TrackerRegistration) error { +func register(tracker string, tr *TrackerRegistration) error { conn, err := net.Dial("udp", tracker) if err != nil { return err