MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / Kick

Method Kick

world.go:689–700  ·  view source on GitHub ↗

Force disconnect a user (Makes them linkdead)

(userId int, reason string)

Source from the content-addressed store, hash-verified

687
688// Force disconnect a user (Makes them linkdead)
689func (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
703func (w *World) EventLoop() {

Callers 1

HandleSystemEventsMethod · 0.95

Calls 5

GetByUserIdFunction · 0.92
SetLinkDeadUserFunction · 0.92
KickFunction · 0.92
ConnectionIdMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected