- // Used simplified hotline v1.2.3 login flow for clients that do not send login info in tranAgreed
- // 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) || bytes.Equal(c.Version, heildrun) {
- 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 }()))
+ // If the client has provided a username as part of the login, we can infer that it is using the 1.2.3 login
+ // flow and not the 1.5+ flow.
+ if len(c.UserName) != 0 {
+ // Add the client username to the logger. For 1.5+ clients, we don't have this information yet as it comes as
+ // part of TranAgreed
+ c.logger = c.logger.With("Name", string(c.UserName))
+
+ c.logger.Info("Login successful", "clientVersion", "Not sent (probably 1.2.3)")