mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2026-04-07 23:53:30 +00:00
working for valheim
This commit is contained in:
@@ -33,14 +33,14 @@ func createSession(caddr *net.UDPAddr, raddr *net.UDPAddr, proxyConn *net.UDPCon
|
||||
|
||||
func (s *Session) listen() error {
|
||||
for {
|
||||
buf := make([]byte, 1024)
|
||||
_, err := s.serverConn.Read(buf)
|
||||
buf := make([]byte, 2048)
|
||||
n, err := s.serverConn.Read(buf)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
continue
|
||||
}
|
||||
|
||||
go s.proxyFrom(buf)
|
||||
s.proxyFrom(buf[:n])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ func (c *Client) ListenAndServe() error {
|
||||
|
||||
for {
|
||||
buf := make([]byte, 2048)
|
||||
_, caddr, err := c.proxyConn.ReadFromUDP(buf)
|
||||
n, caddr, err := c.proxyConn.ReadFromUDP(buf)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
@@ -63,7 +63,7 @@ func (c *Client) ListenAndServe() error {
|
||||
c.sessions[caddr.String()] = session
|
||||
}
|
||||
|
||||
go session.proxyTo(buf)
|
||||
session.proxyTo(buf[:n])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user