From 3d42de7b1870f3fdd3da2294ab649acf3a4dc1b1 Mon Sep 17 00:00:00 2001 From: Beric Bearnson <37596980+bericyb@users.noreply.github.com> Date: Thu, 24 Oct 2024 21:40:46 -0600 Subject: [PATCH] error fix --- internal/lobby/lobby.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/lobby/lobby.go b/internal/lobby/lobby.go index 7c456bc..f0a0d80 100644 --- a/internal/lobby/lobby.go +++ b/internal/lobby/lobby.go @@ -314,17 +314,15 @@ func (l *Lobby) InitialConnectionHandler(conn net.Conn) (Client, []byte, error) if err != nil { slog.Debug("error unmarshalling name message:", "error", err.Error(), "message", msg[1:nb]) - msgOut, merr := Marshal(ErrorData{ + msgOut, err := Marshal(ErrorData{ Message: "incorrectly formatted username in name message", }, Error) - if merr != nil { + if err != nil { slog.Error("error marshalling error message for incorrectly formatted username") } return Client{}, msgOut, err } - fmt.Println("Loading lobby") _, ok := l.lobbyMembers.Load(n.Name) - fmt.Println("past that") if ok { msg, merr := Marshal(ErrorData{ Message: "Sorry that name is already taken, please try a different name",