diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-07 17:59:04 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-07 17:59:04 -0700 |
| commit | a82b93cf7e84dee23d8b0cdbc2bd473641ddf4b9 (patch) | |
| tree | 82245b71b17ec69426e277a251defd7f979ab701 | |
| parent | 8277fb93fd2c957e5fd609b68a001babea46cdc4 (diff) | |
Fix Nostalgia ghost user bug
| -rw-r--r-- | hotline/server.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hotline/server.go b/hotline/server.go index 64cc527..014824b 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -1,6 +1,7 @@ package hotline import ( + "bytes" "context" "encoding/binary" "errors" @@ -31,6 +32,8 @@ const ( trackerUpdateFrequency = 300 // time in seconds between tracker re-registration ) +var nostalgiaVersion = []byte{0, 0, 2, 0x2c} // version ID used by the Nostalgia client + type Server struct { Port int Accounts map[string]*Account @@ -569,8 +572,8 @@ func (s *Server) handleNewConnection(conn net.Conn, remoteAddr string) error { // Show agreement to client c.Server.outbox <- *NewTransaction(tranShowAgreement, c.ID, NewField(fieldData, s.Agreement)) - // assume simplified hotline v1.2.3 login flow that does not require agreement - if *c.Version == nil { + // Used simplified hotline v1.2.3 login flow for clients that do not send login info in tranAgreed + if *c.Version == nil || bytes.Equal(*c.Version, nostalgiaVersion) { c.Agreed = true c.notifyOthers( |