Documentation
¶
Index ¶
- Constants
- type ClientPlayer
- func (p *ClientPlayer) AddInventory(instance *object.Instance) error
- func (p *ClientPlayer) FindInventory(target string) (*object.Instance, bool)
- func (p *ClientPlayer) GetAllInventory() []*object.Instance
- func (p *ClientPlayer) GetCurrentHealth() int
- func (p *ClientPlayer) GetInventoryById(id uuid.UUID) (*object.Instance, bool)
- func (p *ClientPlayer) GetInventoryByName(name string) (*object.Instance, bool)
- func (p *ClientPlayer) GetMaxHealth() int
- func (p *ClientPlayer) GetName() string
- func (p *ClientPlayer) RemoveInventory(instance *object.Instance) error
- func (p *ClientPlayer) Send(msg interface{}) error
- func (p *ClientPlayer) Slots() *object.Slots
- func (p *ClientPlayer) String() string
- type GameServer
- type PulseCount
Constants ¶
View Source
const PULSE_INTERVAL time.Duration = 1 * time.Second // 1 second
Game Server ticks every PULSE_INTERVAL time const PULSE_INTERVAL time.Duration = 100 * time.Millisecond // 0.1 seconds
View Source
const PULSE_MOBILE = 10 * time.Second
Mobs consider doing something once every PULSE_MOBILE time
View Source
const PULSE_ZONE = 1 * time.Minute
zones reset based on their lifetime, check every pulse_zone (lifetime > pulse_zone)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientPlayer ¶
type ClientPlayer struct { Name string Client client.Client // contains filtered or unexported fields }
func NewClientPlayer ¶
func NewClientPlayer(name string, client client.Client) *ClientPlayer
Create a new player and set it up to work with this client
func NewTestClientPlayer ¶
func NewTestClientPlayer(name string) (p *ClientPlayer, cli *client.TestClient)
Create a ClientPlayer connected to a new TestClient (for testing)
func (*ClientPlayer) AddInventory ¶
func (p *ClientPlayer) AddInventory(instance *object.Instance) error
func (*ClientPlayer) FindInventory ¶
func (p *ClientPlayer) FindInventory(target string) (*object.Instance, bool)
func (*ClientPlayer) GetAllInventory ¶
func (p *ClientPlayer) GetAllInventory() []*object.Instance
func (*ClientPlayer) GetCurrentHealth ¶
func (p *ClientPlayer) GetCurrentHealth() int
func (*ClientPlayer) GetInventoryById ¶
func (p *ClientPlayer) GetInventoryById(id uuid.UUID) (*object.Instance, bool)
func (*ClientPlayer) GetInventoryByName ¶
func (p *ClientPlayer) GetInventoryByName(name string) (*object.Instance, bool)
func (*ClientPlayer) GetMaxHealth ¶
func (p *ClientPlayer) GetMaxHealth() int
func (*ClientPlayer) GetName ¶
func (p *ClientPlayer) GetName() string
func (*ClientPlayer) RemoveInventory ¶
func (p *ClientPlayer) RemoveInventory(instance *object.Instance) error
func (*ClientPlayer) Send ¶
func (p *ClientPlayer) Send(msg interface{}) error
func (*ClientPlayer) Slots ¶
func (p *ClientPlayer) Slots() *object.Slots
func (*ClientPlayer) String ¶
func (p *ClientPlayer) String() string
type GameServer ¶
func NewGameServer ¶
func NewGameServer(worldFilesDirectory string) (gs *GameServer, err error)
func (*GameServer) Receive ¶
func (gs *GameServer) Receive(msg *gameserver.HandlerParameter)
type PulseCount ¶
type PulseCount int64
Max value for an int64 is math.MaxInt64 == 9223372036854775807 If PULSE_INTERVAL is 1 nanosecond, the PULSE rollover won't happen for ~29 decades. If for some reason our uptime can be longer than that, the pulse-rollover code should be reinstated.
Click to show internal directories.
Click to hide internal directories.