Documentation ¶
Overview ¶
Package dummy implements a mocked Warcraft III game client that can be used to add dummy players to lobbies.
Index ¶
- Variables
- func RejectReasonToError(r w3gs.RejectReason) error
- type Chat
- type Player
- func (p *Player) ChangeColor(c uint8) error
- func (p *Player) ChangeHandicap(h uint8) error
- func (p *Player) ChangeRace(r w3gs.RacePref) error
- func (p *Player) ChangeTeam(t uint8) error
- func (p *Player) Close() error
- func (p *Player) InitDefaultHandlers()
- func (p *Player) Join() error
- func (p *Player) Leave(reason w3gs.LeaveReason) error
- func (p *Player) Run() error
- func (p *Player) Say(s string) error
- type Say
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrJoinRejected = errors.New("dummy: Join rejected") ErrGameFull = errors.New("dummy: Join rejected (game full)") ErrGameStarted = errors.New("dummy: Join rejected (game started)") ErrInvalidFirstPacket = errors.New("dummy: Invalid first packet") )
Errors
Functions ¶
func RejectReasonToError ¶
func RejectReasonToError(r w3gs.RejectReason) error
RejectReasonToError converts w3gs.RejectReason to an appropriate error
Types ¶
type Player ¶
type Player struct { peer.Host network.W3GSConn // Set once before Join(), read-only after that HostAddr string HostCounter uint32 DialPeers bool }
Player represents a mocked player that can join a game lobby
func Join ¶
func Join(addr string, name string, hostCounter uint32, entryKey uint32, listenPort int) (*Player, error)
Join a game lobby as a mocked player
func (*Player) InitDefaultHandlers ¶
func (p *Player) InitDefaultHandlers()
InitDefaultHandlers adds the default callbacks for relevant packets
Click to show internal directories.
Click to hide internal directories.