- // Show agreement to client
- c.Server.outbox <- *NewTransaction(tranShowAgreement, c.ID, NewField(fieldData, s.Agreement))
+ // 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)")
+
+ // Notify other clients on the server that the new user has logged in. For 1.5+ clients we don't have this
+ // information yet, so we do it in TranAgreed instead
+ for _, t := range c.notifyOthers(
+ *NewTransaction(
+ TranNotifyChangeUser, nil,
+ NewField(FieldUserName, c.UserName),
+ NewField(FieldUserID, *c.ID),
+ NewField(FieldUserIconID, c.Icon),
+ NewField(FieldUserFlags, c.Flags),
+ ),
+ ) {
+ c.Server.outbox <- t
+ }
+ }