client

package
v0.0.0-...-85804c7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DISCONNECTED_MATCHMAKING channelSignal = iota
	BEGIN_HOSTING_FORWARDING
	BEGIN_LINKED_FORWARDING
	STOP_FORWARDING
)

Variables

This section is empty.

Functions

func CreateStartRelay

func CreateStartRelay() *gameDataRelayImpl

Types

type Client

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

Represents the entire Client that handles connecting to the proxy server and the relay server.

func NewClient

func NewClient(commandSource CommandSource, relay GameDataRelay) *Client

Creates a new Client with the specified command Source and GameDataRelay implementation

func (*Client) RunClient

func (client *Client) RunClient()

Main loop for processing commands

type CommandSource

type CommandSource interface {
	// Called by the client to get the next command for it to process.
	GetNextCommand() string
}

Represents a source for text commands for the client to process This is implemented with ConsoleCommandSource, but can be something else to source commands from, such as in a GUI application

type ConsoleCommandSource

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

Simple Implementation of CommandSource, which just reads commands from stdin

func NewConsoleCommandSource

func NewConsoleCommandSource() *ConsoleCommandSource

func (*ConsoleCommandSource) GetNextCommand

func (ccs *ConsoleCommandSource) GetNextCommand() string

type GameDataRelay

type GameDataRelay interface {
	OnConnectedToServer(address string, auth string) bool
	OnDisconnectedFromServer()
	OnBeginHosting()
	OnStopHosting()
	OnBeginLinked()
	OnStopLinked()
}

Jump to

Keyboard shortcuts

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