server

package
v0.0.0-...-d091464 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientHandler

type ClientHandler struct {
	// contains filtered or unexported fields
}

ClientHandler is responsible for managing the state and communications for a single client.

func NewClientHandler

func NewClientHandler(conn net.Conn, closeChan chan *ClientHandler, store *store.Store, game *game.Game, sessionKey uint64) *ClientHandler

NewClientHandler returns a new handler for a client connection. When the handler terminates, it will write to the provided closeChan to indicate its work is complete.

func (*ClientHandler) Handle

func (c *ClientHandler) Handle()

Handle processes request for the client connection.

type Options

type Options struct {
	Config    *config.Config
	Telemetry telemetry.Telemetry
}

Options contains parameters to configure a Server instance.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server provides the network infrastructure for a game and login server.

func New

func New(opts Options) (*Server, error)

New creates a server instance with a configuration.

func (*Server) Run

func (s *Server) Run() error

Run begins listening for connections and spawning request handlers.

func (*Server) Stop

func (s *Server) Stop()

Stop terminates the server and stops accepting new connections.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL