Force disconnect a user (Makes them linkdead)
(userId int, reason string)
| 687 | |
| 688 | // Force disconnect a user (Makes them linkdead) |
| 689 | func (w *World) Kick(userId int, reason string) { |
| 690 | |
| 691 | user := users.GetByUserId(userId) |
| 692 | if user == nil { |
| 693 | return |
| 694 | } |
| 695 | |
| 696 | users.SetLinkDeadUser(userId) |
| 697 | user.EventLog.Add(`conn`, fmt.Sprintf(`Kicked (%s)`, reason)) |
| 698 | |
| 699 | connections.Kick(user.ConnectionId(), reason) |
| 700 | } |
| 701 | |
| 702 | // Should only handle sending messages out to users |
| 703 | func (w *World) EventLoop() { |
no test coverage detected