logs
This commit is contained in:
parent
004c8ba794
commit
a8e6adfb04
|
@ -58,23 +58,22 @@ func LobbyListen() {
|
||||||
client, msgOut, err := l.InitialConnectionHandler(conn)
|
client, msgOut, err := l.InitialConnectionHandler(conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
conn.Write(msgOut)
|
conn.Write(msgOut)
|
||||||
return
|
} else {
|
||||||
}
|
fmt.Println("new client", client)
|
||||||
fmt.Println("new client", client)
|
_, err = conn.Write(msgOut)
|
||||||
|
|
||||||
_, err = conn.Write(msgOut)
|
|
||||||
if err != nil {
|
|
||||||
slog.Debug("error writing to new player... disconnecting")
|
|
||||||
// msg, err := lobby.Marshal(lobby.DisconnectData{
|
|
||||||
// From: client.Username,
|
|
||||||
// }, lobby.Disconnect)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("error marshalling disconnect message on player connect")
|
slog.Debug("error writing to new player... disconnecting")
|
||||||
|
msg, err := lobby.Marshal(lobby.DisconnectData{
|
||||||
|
From: client.Username,
|
||||||
|
}, lobby.Disconnect)
|
||||||
|
if err != nil {
|
||||||
|
slog.Error("error marshalling disconnect message on player connect")
|
||||||
|
}
|
||||||
|
l.BroadcastToLobby(msg)
|
||||||
}
|
}
|
||||||
// l.BroadcastToLobby(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
go l.HandleLobbyConnection(client)
|
go l.HandleLobbyConnection(client)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user