-
Notifications
You must be signed in to change notification settings - Fork 22
API
Twisted edited this page Jun 19, 2021
·
1 revision
API documentation for portal with examples
This wiki is still being written.
Sessions store all of the required information about a player who is connected to the proxy. They are also responsible for handling packets etc.
To create a session you will need an existing connection which can be obtained by accepting connections from a listener. All you need to do is call the session.New()
method and provide the connection as the first argument. A session and an error is returned.
// conn is of type *minecraft.Conn
s, err := session.New(conn)
if err != nil {
// If the error is not nil, the connection was unable to connect to a server. Here you can handle the error and close the connection.
return
}
To get more information about connections and listeners, visit the gophertunnel repository.