Skip to content

Commit

Permalink
Update stealer.go
Browse files Browse the repository at this point in the history
  • Loading branch information
cherrychip8293 authored Aug 18, 2024
1 parent 80449a9 commit 9337655
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions stealer/stealer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ func handleConn(serverAddress string, src oauth2.TokenSource) {

fmt.Printf("Connecting to %s... (may take up to 5 minutes) \n", serverAddress)

// Use default values or configuration for the Dialer
dialer := minecraft.Dialer{
// Dial the server
serverConn, err = minecraft.Dialer{
TokenSource: src,
// Optionally set other configurations here if needed
}

serverConn, err = dialer.DialContext(ctx, "raknet", serverAddress)
// ProtocolVersion is not explicitly set here
}.DialContext(ctx, "raknet", serverAddress)
if err != nil {
panic(fmt.Errorf("error connecting to server: %w", err))
}
Expand All @@ -92,7 +90,6 @@ func handleConn(serverAddress string, src oauth2.TokenSource) {
}
}

// Ensure connection is closed properly
err = serverConn.Close()
if err != nil {
fmt.Printf("Warning: error closing connection: %v\n", err)
Expand Down

0 comments on commit 9337655

Please sign in to comment.