You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.Conns, err:=session.New(conn)
iferr!=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.