remove username sniffer

This commit is contained in:
iceBear67
2026-07-15 16:05:34 +00:00
parent bbe4efbe16
commit a41cb7965e
5 changed files with 14 additions and 40 deletions
+3 -4
View File
@@ -221,8 +221,7 @@ func (c *Client) dispatchControl(payload []byte) {
pattern, _ := r.String()
ip, _ := r.String()
port, _ := r.U16()
username, _ := r.String()
go c.handleControlRequest(cid, pattern, ip, int(port), username)
go c.handleControlRequest(cid, pattern, ip, int(port))
case CtlPong:
// ignore
default:
@@ -248,13 +247,13 @@ func (c *Client) pingLoop(ctx context.Context, fc *wire.FramedConn) {
// handleControlRequest reacts to a matched player: allocate a worker stream,
// SYN it, and bridge it to the mapped destination.
func (c *Client) handleControlRequest(cid []byte, pattern, ip string, port int, username string) {
func (c *Client) handleControlRequest(cid []byte, pattern, ip string, port int) {
mapping, ok := c.mappings[NormalizeAddress(pattern)]
if !ok {
log.Printf("control-request for unmapped pattern %q; ignoring", pattern)
return
}
log.Printf("player %s:%d joined as %q via pattern %q -> %s", ip, port, username, pattern, mapping.Destination)
log.Printf("player %s:%d joined via pattern %q -> %s", ip, port, pattern, mapping.Destination)
wc, sid, err := c.pool.Allocate()
if err != nil {
log.Printf("worker allocate failed: %v", err)