Skip to content

Commit

Permalink
Update handler.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengke15 authored Mar 3, 2024
1 parent 30b8f9e commit 68b7270
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions service/minecraft/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,22 +228,6 @@ func NewConnHandler(s *config.ConfigProxyService,
return nil, err
}

buffer.Reset(mcprotocol.MaxVarIntLen)
common.Must0(mcprotocol.WriteToPacket(buffer,
byte(0x00), // Client bound : Disconnect (login)
mcprotocol.VarInt(len(msg)),
))
err = conn.WriteVectorizedPacket(buffer, msg)
if err != nil {
return nil, err
}

c.(*net.TCPConn).SetLinger(10) //nolint:errcheck
c.Close()
return nil, ErrRejectedLoginAccessControl
}
log.Printf("Service %s : %s New Minecraft player logged in: %s [%s]", s.Name, ctx.ColoredID, playerName, accessibility)
ctx.AttachInfo("PlayerName=" + playerName)
if accessibility == "NEW" {
msg, err := generateNewMessage(s, playerName).MarshalJSON()
if err != nil {
Expand Down

0 comments on commit 68b7270

Please sign in to comment.