workaround for localhost connections

This commit is contained in:
wish
2023-02-25 16:12:51 +11:00
parent bbaec08b67
commit 747f21c4db
3 changed files with 20 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"io"
"net"
"strings"
"sync"
"erupe-ce/config"
@@ -112,7 +113,11 @@ func (s *Server) handleEntranceServerConnection(conn net.Conn) {
s.logger.Debug("Got entrance server command:\n", zap.String("raw", hex.Dump(pkt)))
data := makeSv2Resp(s.erupeConfig, s)
local := false
if strings.Split(conn.RemoteAddr().String(), ":")[0] == "127.0.0.1" {
local = true
}
data := makeSv2Resp(s.erupeConfig, s, local)
if len(pkt) > 5 {
data = append(data, makeUsrResp(pkt, s)...)
}