server

package
v0.0.0-...-881dcfe Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	PlayerID   uint64
	PlayerName string

	StateLock sync.RWMutex
	State     *ClientState
}

func (*Client) SafeState

func (c *Client) SafeState() *ClientState

type ClientState

type ClientState struct {
	context.Context

	ConnectionID uint64
	Responses    chan<- *socket.Response
}

func (*ClientState) SendError

func (s *ClientState) SendError(err *socket.Response_Error)

func (*ClientState) SendMessage

func (s *ClientState) SendMessage(msg *socket.Response)

type Server

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

func NewServer

func NewServer() *Server

func (*Server) BroadcastMessage

func (s *Server) BroadcastMessage(ctx context.Context, msg *socket.Response)

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers(router fiber.Router)

func (*Server) Run

func (s *Server) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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