Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RakNet Security layer is not supported #28

Closed
RaphiMC opened this issue Jan 1, 2024 · 2 comments
Closed

RakNet Security layer is not supported #28

RaphiMC opened this issue Jan 1, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@RaphiMC
Copy link

RaphiMC commented Jan 1, 2024

Trying to connect to a server which uses the RakNet security flag (In OpenConnectionReply1) causes a timeout. While I am not 100% sure that the timeout is not caused by some other error in go-raknet other RakNet libraries failed because of the servers usage of the security flag (See CloudburstMC/Network#37). Connecting to the server with Bedrock Edition (or https://github.com/extremeheat/fb-raknet) works fine since both use the original RakNet.

Reproduceable example code:

package main

import (
	"github.com/sandertv/go-raknet"
	"time"
)

func main() {
	conn, err := raknet.DialTimeout("play.timecrack.net:19132", time.Duration(5)*time.Second)
	if err != nil {
		panic(err.Error())
	}
	defer func(conn *raknet.Conn) {
		err := conn.Close()
		if err != nil {
			panic(err.Error())
		}
	}(conn)

	println("Connected")
}
Sandertv added a commit that referenced this issue Apr 1, 2024
…small allocations.

This improves the performance of these packets. Also cleaned up dial.go and 'added support' for security (insofar timecrack requires it, see #28).
@dktapps
Copy link

dktapps commented Apr 6, 2024

FWIW, the vanilla RakNet client decodes OpenConnectionReply1 differently depending on whether it was compiled with security support or not. If the server enables security but the client doesn't support it, the client won't read the key bytes from the packet, and will interpret those bytes as the MTU size. Basically the server needs to be psychic and know whether the client supports encryption in order to structure the packet properly. RakNet Quality Code ™

@Sandertv
Copy link
Owner

Sandertv commented May 2, 2024

Fixed in 1beb5ce.

@Sandertv Sandertv closed this as completed May 2, 2024
@Sandertv Sandertv added the enhancement New feature or request label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants