MCPcopy Create free account
hub / github.com/TyphoonMC/TyphoonCore / Kick

Method Kick

utils.go:300–313  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

298}
299
300func (player *Player) Kick(s string) {
301 if player.state == LOGIN {
302 player.loginKick(s)
303 return
304 }
305
306 player.core.CallEvent(&PlayerKickEvent{player, s})
307 msg := fmt.Sprintf(`{"text": "%s"}`, s)
308 disconnect := PacketPlayDisconnect{
309 Component: msg,
310 }
311 player.WritePacket(&disconnect)
312 player.conn.Close()
313}
314
315func (player *Player) loginKick(s string) {
316 msg := fmt.Sprintf(`{"text": "%s"}`, s)

Callers 5

ReadStringLimitedMethod · 0.95
ReadNStringLimitedMethod · 0.95
HandleMethod · 0.80
HandleMethod · 0.80
keepAliveMethod · 0.80

Calls 3

loginKickMethod · 0.95
WritePacketMethod · 0.95
CallEventMethod · 0.80

Tested by

no test coverage detected