Skip to content

Commit

Permalink
fix a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
olebeck committed Jun 23, 2024
1 parent 2bf9725 commit bda9a6c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "dragonfly"]
path = dragonfly
url = https://github.com/olebeck/dragonfly.git
[submodule "go-raknet"]
path = go-raknet
url = git@github.com:olebeck/go-raknet
1 change: 1 addition & 0 deletions go-raknet
Submodule go-raknet added at 78796a
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ toolchain go1.21.4
use (
.
./dragonfly
./go-raknet
./gophertunnel
)
2 changes: 1 addition & 1 deletion gophertunnel
Submodule gophertunnel updated 1 files
+11 −8 minecraft/dial.go
3 changes: 2 additions & 1 deletion utils/proxy/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net"
"time"

"github.com/bedrock-tool/bedrocktool/locale"
"github.com/bedrock-tool/bedrocktool/ui/messages"
Expand Down Expand Up @@ -74,7 +75,7 @@ func (p *Context) connectServer(ctx context.Context) (err error) {
return err
}

server, err := d.DialContext(ctx, "raknet", p.serverAddress)
server, err := d.DialContext(ctx, "raknet", p.serverAddress, 10*time.Second)
if err != nil {
return err
}
Expand Down
4 changes: 3 additions & 1 deletion utils/proxy/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ func (p *Context) onServerConnect() error {
func (p *Context) doSession(ctx context.Context, cancel context.CancelCauseFunc) (err error) {
defer func() {
for _, handler := range p.handlers {
handler.OnSessionEnd()
if handler.OnSessionEnd != nil {
handler.OnSessionEnd()
}
}
}()

Expand Down

0 comments on commit bda9a6c

Please sign in to comment.