Documentation
¶
Index ¶
- Constants
- Variables
- func LoadConfigFromLua(gamemode string) error
- func SetConfigVariable(l *lua.LState) int
- type Player
- func (p *Player) Hit(dmg uint8)
- func (p *Player) IsFiringPrimary() bool
- func (p *Player) IsFiringSecondary() bool
- func (p *Player) IsHoldingCrouch() bool
- func (p *Player) IsHoldingDown() bool
- func (p *Player) IsHoldingJump() bool
- func (p *Player) IsHoldingLeft() bool
- func (p *Player) IsHoldingRight() bool
- func (p *Player) IsHoldingSneak() bool
- func (p *Player) IsHoldingSprint() bool
- func (p *Player) IsHoldingUp() bool
- type State
- func (gs *State) AddPlayer(ev enet.Event) (*Player, error)
- func (gs *State) GetPlayerByID(id uint8) (*Player, error)
- func (gs *State) GetPlayerByIP(ip string) (*Player, error)
- func (gs *State) RemovePlayerByIP(ip string)
- func (gs *State) UpdatePlayer(playerID uint8, name []byte, team uint8, weapon uint8, held uint8, ...) error
- func (gs *State) UpdatePlayerBlockColor(playerID uint8, red uint8, green uint8, blue uint8) error
Constants ¶
Variables ¶
View Source
var Config = map[string]string{
"gamemode": "creative",
"serverName": "gospades default name",
"maxPlayers": "64",
"team1Name": "Red",
"team2Name": "Blue",
}
View Source
var ErrPlayerExists = errors.New("player already exists")
Functions ¶
func LoadConfigFromLua ¶
func SetConfigVariable ¶
func SetConfigVariable(l *lua.LState) int
SetConfigVariable is called from conf.lua as 'config(string string)` to override defaults
Types ¶
type Player ¶
type Player struct { Username string Position util.Vec3Float LastPosition util.Vec3Float Orientation util.Vec3Float ExistingPlayerPacketReceived bool IP string ID uint8 Team uint8 Weapon uint8 Held uint8 Kills uint32 BlockColor util.Color Peer enet.Peer KeyState uint8 WeaponState uint8 Tool uint8 // 0-spade, 1-block, 2-gun, 3-grenade Health uint8 }
func (*Player) IsFiringPrimary ¶
func (*Player) IsFiringSecondary ¶
func (*Player) IsHoldingCrouch ¶
func (*Player) IsHoldingDown ¶
func (*Player) IsHoldingJump ¶
func (*Player) IsHoldingLeft ¶
func (*Player) IsHoldingRight ¶
func (*Player) IsHoldingSneak ¶
func (*Player) IsHoldingSprint ¶
func (*Player) IsHoldingUp ¶
Click to show internal directories.
Click to hide internal directories.