(s string)
| 298 | } |
| 299 | |
| 300 | func (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 | |
| 315 | func (player *Player) loginKick(s string) { |
| 316 | msg := fmt.Sprintf(`{"text": "%s"}`, s) |
no test coverage detected