Documentation
¶
Overview ¶
Package lan implements a mocked Warcraft III LAN client that can be used to discover local games.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GameList ¶
type GameList struct { network.EventEmitter network.W3GSPacketConn // Set once before Run(), read-only after that GameVersion w3gs.GameVersion BroadcastInterval time.Duration // contains filtered or unexported fields }
GameList keeps track of all the hosted games in the Local Area Network Emits events for every received packet and Update{} when the output of Games() changes Public methods/fields are thread-safe unless explicitly stated otherwise
func NewGameList ¶
func NewGameList(gv w3gs.GameVersion, port int) (*GameList, error)
NewGameList opens a new UDP socket to listen for LAN GameList updates
func (*GameList) Games ¶
Games returns the current list of LAN games. Map key is the remote address.
func (*GameList) InitDefaultHandlers ¶
func (g *GameList) InitDefaultHandlers()
InitDefaultHandlers adds the default callbacks for relevant packets
Click to show internal directories.
Click to hide internal directories.