Skip to content
Twisted edited this page Jun 19, 2021 · 1 revision

API documentation for portal with examples


Content

This wiki is still being written.


Sessions

Sessions store all of the required information about a player who is connected to the proxy. They are also responsible for handling packets etc.

Creating a session

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.

Clone this wiki locally