Skip to content

Commit

Permalink
fix of the [issue](#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhaillav committed Feb 23, 2024
1 parent b8a2433 commit 3c806e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ func (s *Server) StartHandle() {
}

arrayMotd := strings.Split(string(motd), ";")
if !usingOfflineMotd || (usingOfflineMotd && arrayMotd[6] == "SERVER_UNIQUE_ID") {
if (!usingOfflineMotd || arrayMotd[6] == "SERVER_UNIQUE_ID") && len(arrayMotd) >= 6 {
arrayMotd[6] = fmt.Sprint(listener.ID())
}
if !usingOfflineMotd || (usingOfflineMotd && arrayMotd[10] == "PORT_V_4") {
if (!usingOfflineMotd || arrayMotd[10] == "PORT_V_4") && len(arrayMotd) >= 10 {
arrayMotd[10] = fmt.Sprint(s.ProxyAddr.Port)
}
if !usingOfflineMotd || (usingOfflineMotd && arrayMotd[11] == "PORT_V_6") {
if (!usingOfflineMotd || arrayMotd[11] == "PORT_V_6") && len(arrayMotd) >= 11{
arrayMotd[11] = fmt.Sprint(s.ProxyAddr.Port)
}

Expand Down

0 comments on commit 3c806e0

Please sign in to comment.