Documentation
¶
Index ¶
- Variables
- func CreatePollNetworkSystem(world *ecs.World, networkChannel chan serdes.WorldUpdate) ecs.System
- func CreateServerSystems(world *ecs.World, server *Server, networkChannel chan serdes.WorldUpdate, ...) []ecs.System
- func Main()
- func ServeProxyConnection(serverConn *ServerConn, world *ecs.World, ...) error
- func ServerSendUpdate(world *ecs.World, server *Server, deleteList *DeleteList)
- type ClientTick
- type DeleteList
- type Server
- type ServerConn
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AvgWorldUpdateTime time.Duration
Functions ¶
func CreatePollNetworkSystem ¶
TODO - this kindof represents a greater pattern of trying to apply commands to the world in a threadsafe manner. Maybe integrate this into the ECS library: https://docs.rs/bevy/0.4.0/bevy/ecs/trait.Command.html
func CreateServerSystems ¶
func CreateServerSystems(world *ecs.World, server *Server, networkChannel chan serdes.WorldUpdate, deleteList *DeleteList, tilemap *tile.Tilemap) []ecs.System
func ServeProxyConnection ¶
func ServeProxyConnection(serverConn *ServerConn, world *ecs.World, networkChannel chan serdes.WorldUpdate, deleteList *DeleteList) error
func ServerSendUpdate ¶
func ServerSendUpdate(world *ecs.World, server *Server, deleteList *DeleteList)
This calculates the update to send to all players, finds the proxy associated with them, and sends that update over the wire
Types ¶
type ClientTick ¶
type ClientTick struct {
Tick uint16 // This is the tick that the player is currently on
}
This is the tick that the client says they are on
type DeleteList ¶
type DeleteList struct {
// contains filtered or unexported fields
}
-------------------------------------------------------------------------------- - Server --------------------------------------------------------------------------------
func NewDeleteList ¶
func NewDeleteList() *DeleteList
func (*DeleteList) Append ¶
func (d *DeleteList) Append(id ecs.Id)
func (*DeleteList) CopyAndClear ¶
func (d *DeleteList) CopyAndClear() []ecs.Id
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddProxy ¶
func (s *Server) AddProxy(proxyId uint64, conn *ServerConn)
func (*Server) RemoveProxy ¶
type ServerConn ¶
type ServerConn struct {
// contains filtered or unexported fields
}
--------------------------------------------------------------------------------
func (*ServerConn) LogoutUser ¶
func (c *ServerConn) LogoutUser(userId uint64)
func (*ServerConn) Recv ¶
func (c *ServerConn) Recv() (any, error)
func (*ServerConn) Send ¶
func (c *ServerConn) Send(msg any) error
Click to show internal directories.
Click to hide internal directories.