From e9a11d31751105f19c4462929ab70269ae82657a Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 3 Oct 2023 13:05:02 +0300 Subject: [PATCH] Update client.go --- client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index caa8890..430dc1f 100644 --- a/client.go +++ b/client.go @@ -22,10 +22,9 @@ type RCONClient struct { Connection net.Conn } -func NewRCONClient(address string) *RCONClient { +func NewRCONClient() *RCONClient { counter++ return &RCONClient{ - Address: address, RequestID: RequestIDStart + counter - 1, } } @@ -40,11 +39,12 @@ func (client *RCONClient) RecvPacket() (*Packet, error) { } func (client *RCONClient) Connect(address string) error { - connection, err := net.Dial("tcp", client.Address) + connection, err := net.Dial("tcp", address) if err != nil { return err } client.Connection = connection + client.Address = address return nil }