|
@@ -54,22 +54,18 @@ func (cmd *Command) Run(server *Server, client *Client, session *Session, msg ir
|
54
|
54
|
return cmd.handler(server, client, msg, rb)
|
55
|
55
|
}()
|
56
|
56
|
|
|
57
|
+ // after each command, see if we can send registration to the client
|
|
58
|
+ if !exiting && !client.registered {
|
|
59
|
+ exiting = server.tryRegister(client, session)
|
|
60
|
+ }
|
|
61
|
+
|
57
|
62
|
// most servers do this only for PING/PONG, but we'll do it for any command:
|
58
|
63
|
if client.registered {
|
59
|
64
|
// touch even if `exiting`, so we record the time of a QUIT accurately
|
60
|
65
|
session.idletimer.Touch()
|
61
|
66
|
}
|
62
|
67
|
|
63
|
|
- if exiting {
|
64
|
|
- return
|
65
|
|
- }
|
66
|
|
-
|
67
|
|
- // after each command, see if we can send registration to the client
|
68
|
|
- if !client.registered {
|
69
|
|
- exiting = server.tryRegister(client, session)
|
70
|
|
- }
|
71
|
|
-
|
72
|
|
- if client.registered && !cmd.leaveClientIdle {
|
|
68
|
+ if !exiting && client.registered && !cmd.leaveClientIdle {
|
73
|
69
|
client.Active(session)
|
74
|
70
|
}
|
75
|
71
|
|