Fix Windows client not properly sending username

This commit is contained in:
raul 2024-05-27 10:40:59 +02:00
parent e48521b456
commit bc2ed1ff63
1 changed files with 2 additions and 2 deletions

View File

@ -165,9 +165,9 @@ func sendName(conn net.Conn) {
if err != nil {
log.Fatalf("Error occurred sending message to server: %v\n", err)
}
Profile.Username = strings.TrimRight(message, "\n")
Profile.Username = strings.TrimRight(message, "\n\r")
if _, err := conn.Write([]byte(message)); err != nil {
if _, err := conn.Write([]byte(Profile.Username + "\n")); err != nil {
log.Fatalf("Error occurred writing to server: %v\n", err)
}
}