Documentation ¶
Index ¶
- Constants
- type Game
- func (game *Game) AddBots(amount int)
- func (g *Game) DispatchPlayerJoin(ctx context.Context, player *p.Player)
- func (g *Game) DispatchPlayerLeave(ctx context.Context, player *p.Player)
- func (g *Game) GenerateHandshakeData(ctx context.Context, client *ent.Client, player *p.Player) HandshakeData
- func (g *Game) GenerateItemEntitiesData() []gameItem.ItemEntityData
- func (g *Game) GeneratePlayersData() []p.PlayerData
- func (g *Game) HandleGameMessages(ctx context.Context, client *ent.Client, conn *websocket.Conn)
- func (g *Game) HandlePlayerJoin(ctx context.Context, conn *websocket.Conn, client *ent.Client, ...)
- func (g *Game) PlayerByConn(conn *websocket.Conn) *p.Player
- func (g *Game) PlayerByHustlerID(id string) *p.Player
- func (g *Game) PlayerByUUID(uuid uuid.UUID) *p.Player
- func (g *Game) Start(ctx context.Context, client *ent.Client)
- type HandshakeData
- type PlayerJoinData
- type TickData
Constants ¶
View Source
const ( TICKRATE = time.Second / 5 MINUTES_DAY = 24 * 60 BOT_COUNT = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct { // current time // we wrap around {MINUTES_DAY} Time float32 Ticker *time.Ticker SpawnPosition schema.Position Players []*p.Player ItemEntities []*gameItem.ItemEntity Register chan *p.Player Unregister chan *p.Player Broadcast chan messages.BroadcastMessage }
func (*Game) DispatchPlayerJoin ¶
func (*Game) DispatchPlayerLeave ¶
func (*Game) GenerateHandshakeData ¶
func (*Game) GenerateItemEntitiesData ¶
func (g *Game) GenerateItemEntitiesData() []gameItem.ItemEntityData
func (*Game) GeneratePlayersData ¶
func (g *Game) GeneratePlayersData() []p.PlayerData
func (*Game) HandleGameMessages ¶
func (*Game) HandlePlayerJoin ¶
type HandshakeData ¶
type HandshakeData struct { Id string `json:"id"` CurrentMap string `json:"current_map"` X float32 `json:"x"` Y float32 `json:"y"` // citizen: relation{} Relations json.RawMessage `json:"relations"` Players []p.PlayerData `json:"players"` ItemEntities []gameItem.ItemEntityData `json:"itemEntities"` }
type PlayerJoinData ¶
Click to show internal directories.
Click to hide internal directories.