]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/server.go
Improve compatibility with Obsession client
[rbdr/mobius] / hotline / server.go
index 1aa9b1a35e074aae26dd90e4dc3f280049c79972..bda0c2a6f3b4d68b69d3a5adf6b9d9ec45783aef 100644 (file)
@@ -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 }()))