this makes errors that happen during login display

This commit is contained in:
adman
2026-05-01 22:17:51 +02:00
parent 52b3c1ce17
commit fccba0248a
3 changed files with 8 additions and 3 deletions
+5 -3
View File
@@ -163,12 +163,13 @@ func (l *LoginServer) OnEncryptionResponse(packet *v1_21_8.LoginToServerPacketEn
return
}
serverId := crypto.AuthDigest([]byte(l.ServerId), sharedSecret, l.PublicKeyBytes)
_, err = api.HasJoined(l.Requested.Name, serverId, "")
err = l.SetSecret(sharedSecret)
if err != nil {
return
}
err = l.SetSecret(sharedSecret)
serverId := crypto.AuthDigest([]byte(l.ServerId), sharedSecret, l.PublicKeyBytes)
_, err = api.HasJoined(l.Requested.Name, serverId, "")
if err != nil {
return
}
@@ -240,6 +241,7 @@ func ServeLogin(c *proto.Conn, settings ...LoginServerSetting) (ret *LoginServer
ret.RegisterCriticalUntilLatest(ret.OnLoginAcknowledged)
ret.RegisterCriticalUntilLatest(ret.OnStatusRequest)
ret.RegisterCriticalUntilLatest(ret.OnStatusPing)
ret.RegisterCriticalUntilLatest(ret.OnEncryptionResponse)
for _, s := range settings {
s(ret)
}
+1
View File
@@ -78,6 +78,7 @@ func StartServerWithOnConn(listenAddr string, onConn func(c *proto.Conn) (err er
if errors.Is(connErr, ShutDownServerErr) {
running = false
}
c.Log.Error("closing connection", "err", connErr)
if connErr != nil {
connErr = Kick(c, text.Pretty(connErr.Error()), "")
}
+2
View File
@@ -25,6 +25,8 @@ func wontFail[T any](v T, err error) T {
return v
}
// THIS IS REDUNDANT USE LOGIN PACKET IN MINECRAFT DATA
var (
// Edit these two
Version = "1.21.11"