diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2023-01-10 16:16:39 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-10 16:16:39 -0800 |
| commit | d8aeb2dea5395514ad49c6271bc7d62e201f371b (patch) | |
| tree | 3d7497caa9b3da28adfd9e87f60fbcb7d4dc72bf /hotline | |
| parent | f9dd0410ad540ddff1e1c9b60333aed51715df1e (diff) | |
| parent | fa0552fe1f5dc7862e24073423aeed15f9fe4ffe (diff) | |
Merge pull request #86 from jhalter/improve_obsession_compat
Improve compatibility with Obsession client
Diffstat (limited to 'hotline')
| -rw-r--r-- | hotline/server.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hotline/server.go b/hotline/server.go index 1aa9b1a..bda0c2a 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -36,6 +36,8 @@ type requestCtx struct { var nostalgiaVersion = []byte{0, 0, 2, 0x2c} // version ID used by the Nostalgia client var frogblastVersion = []byte{0, 0, 0, 0xb9} // version ID used by the Frogblast 1.2.4 client +var obsessionVersion = []byte{0xbe, 0x00} // version ID used by the Obsession client + type Server struct { Port int Accounts map[string]*Account @@ -673,7 +675,8 @@ func (s *Server) handleNewConnection(ctx context.Context, rwc io.ReadWriteCloser } // 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) || bytes.Equal(c.Version, frogblastVersion) { + // TODO: figure out a generalized solution that doesn't require playing whack-a-mole for specific client versions + if c.Version == nil || bytes.Equal(c.Version, nostalgiaVersion) || bytes.Equal(c.Version, frogblastVersion) || bytes.Equal(c.Version, obsessionVersion) { c.Agreed = true c.logger = c.logger.With("name", string(c.UserName)) c.logger.Infow("Login successful", "clientVersion", fmt.Sprintf("%v", func() int { i, _ := byteToInt(c.Version); return i }())) |