Skip to content

Commit

Permalink
Merge branch 'feat/mc-1-20-2' into feat/simplify-packet-encoding-util
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbraemer authored Dec 28, 2023
2 parents d032469 + aff012f commit bbc6838
Show file tree
Hide file tree
Showing 38 changed files with 986 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .web/docs/guide/builtin-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If you want to add custom commands refer to the [Developers Guide](/developers/)
|------------------|-----------------------|-----------------------------------------------------------------------------------------|
| `/server` | `gate.command.server` | Players can use the command to view and switch to another server. |
| `/glist` | `gate.command.glist` | View the number of players on the Gate instance. `/glist all` lists players per server. |

| `/send` | `gate.command.send` | Send one or all players to another server. |

## Permission

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.21.0
require (
github.com/agext/levenshtein v1.2.3
github.com/dboslee/lru v0.0.1
github.com/edwingeng/deque/v2 v2.1.1
github.com/gammazero/deque v0.2.1
github.com/go-faker/faker/v4 v4.1.1
github.com/go-logr/logr v1.2.4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ github.com/dboslee/lru v0.0.1/go.mod h1:vDIFJHUqr1vdYKAdG9x3r+zFWP0i9uJqQWpB6nSu
github.com/df-mc/atomic v1.10.0 h1:0ZuxBKwR/hxcFGorKiHIp+hY7hgY+XBTzhCYD2NqSEg=
github.com/df-mc/atomic v1.10.0/go.mod h1:Gw9rf+rPIbydMjA329Jn4yjd/O2c/qusw3iNp4tFGSc=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/edwingeng/deque/v2 v2.1.1 h1:+xjC3TnaeMPLZMi7QQf9jN2K00MZmTwruApqplbL9IY=
github.com/edwingeng/deque/v2 v2.1.1/go.mod h1:HukI8CQe9KDmZCcURPZRYVYjH79Zy2tIjTF9sN3Bgb0=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
Expand Down
80 changes: 0 additions & 80 deletions pkg/edition/bedrock/proxy/connection.go

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/edition/bedrock/proxy/player.go

This file was deleted.

34 changes: 0 additions & 34 deletions pkg/edition/bedrock/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ import (
"crypto/elliptic"
"crypto/rand"
"fmt"
"net"
"sync"
"sync/atomic"

"github.com/go-logr/logr"
"github.com/sandertv/go-raknet"

"github.com/robinbraemer/event"
"go.minekube.com/gate/pkg/edition/bedrock/config"
"go.minekube.com/gate/pkg/util/errs"
Expand Down Expand Up @@ -76,34 +73,3 @@ func (p *Proxy) Start(ctx context.Context) error {
// TODO
return nil
}

func (p *Proxy) listenAndServe(addr string, stop <-chan struct{}) error {
select {
case <-stop:
return nil
default:
}

ln, err := raknet.Listen(addr)
if err != nil {
return err
}
// TODO the raknet library sadly strictly couples the listener and accepted connections,
// make sure we first send players a disconnect packet before closing the listener
defer ln.Close()
go func() { <-stop; _ = ln.Close() }()

p.log.Info("listening for connections", "addr", addr)
for {
conn, err := ln.Accept()
if err != nil {
// TODO
return fmt.Errorf("error accepting new connection: %w", err)
}
go p.handleRawConn(conn)
}
}

func (p *Proxy) handleRawConn(raw net.Conn) {
defer raw.Close()
}
4 changes: 0 additions & 4 deletions pkg/edition/bedrock/proxy/session_login.go

This file was deleted.

Loading

0 comments on commit bbc6838

Please sign in to comment.