伊谢尔伦2017-04-17 16:45:15
The question is not very clear. It is recommended that the questioner explain his or her question clearly and concisely.
Assuming that being kicked offline is a management-side function (such as clicking on a user menu and selecting to kick out), the login timeout is what we usually understand as server-side timeout.
If the broadcast message is implemented to say, "So-and-so logged out (login timeout)/So-and-so was kicked out", I will do this:
1. At least one session manager is required, whether it is a server-side extension or a custom one. Manage login sessions, basic CRUD.
2. A user ID, marking the reason why this person logged out after the last login. 1. It timed out; 2. It was kicked; 3. It logged out by itself.
Events about user entry and exit are emitted or relayed through the session manager. For example, if I kick someone, I have to tell the session manager to take this person's execution offline. The parameters may include UID and the reason for the shutdown.
When a session manager event (someone logs in, logs out after timeout, logs out, or is kicked out) occurs, just broadcast the message.