Documentation ¶
Index ¶
- Constants
- type Client
- type FileWriter
- type ScoreBoardSender
- type Sender
- func (sender *Sender) HandleObjectDestroyed(userDiedEvent *events.ObjectDestroyed)
- func (sender *Sender) HandlePhysicsReady(physicsReadyEvent *events.PhysicsReady)
- func (sender *Sender) HandleProjectileFired(projectileFiredEvent *events.ProjectileFired)
- func (sender *Sender) HandleProjectileHit(projectileHitEvent *events.ProjectileHit)
- func (sender *Sender) HandleUserConnected(userConnectedEvent *events.UserConnected)
- func (sender *Sender) HandleUserJoined(userJoinedEvent *events.UserJoined)
- func (sender *Sender) HandleUserLeft(userLeftEvent *events.UserLeft)
- type Server
- func (s *Server) ClientIDs() []uint32
- func (s *Server) GetClient(clientId uint32) (*Client, bool)
- func (s *Server) HandleUserLeft(userLeftEvent *events.UserLeft)
- func (s *Server) Listen()
- func (s *Server) SendToAllClients(message proto.Message)
- func (s *Server) SendToClient(clientID uint32, message proto.Message)
Constants ¶
View Source
const (
DIRECTORY = "log"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct holds client-specific variables.
func (*Client) Done ¶
func (c *Client) Done()
Done sends done message to the Client which closes the conection.
func (*Client) SendMessage ¶
SendMessage sends game state to the client.
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func NewFileWriter ¶
func NewFileWriter(space *state.Space) (*FileWriter, error)
func (*FileWriter) HandlePhysicsReady ¶
func (fileWriter *FileWriter) HandlePhysicsReady(physicsReadyEvent *events.PhysicsReady)
func (*FileWriter) HandleTimeTick ¶
func (fileWriter *FileWriter) HandleTimeTick(timeTickEvent *events.TimeTick)
func (*FileWriter) Run ¶
func (fileWriter *FileWriter) Run()
type ScoreBoardSender ¶
type ScoreBoardSender struct {
// contains filtered or unexported fields
}
func NewScoreBoardSender ¶
func NewScoreBoardSender(server *Server, scoreBoardReader *persistence.ScoreBoardReader, userNameRegistry *utils.UserNamesRegistry) *ScoreBoardSender
func (*ScoreBoardSender) HandleScoreSent ¶
func (sender *ScoreBoardSender) HandleScoreSent(scoreSent *events.ScoreSent)
func (*ScoreBoardSender) HandleUserJoined ¶
func (sender *ScoreBoardSender) HandleUserJoined(userJoinedEvent *events.UserJoined)
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
func (*Sender) HandleObjectDestroyed ¶
func (sender *Sender) HandleObjectDestroyed(userDiedEvent *events.ObjectDestroyed)
func (*Sender) HandlePhysicsReady ¶
func (sender *Sender) HandlePhysicsReady(physicsReadyEvent *events.PhysicsReady)
func (*Sender) HandleProjectileFired ¶
func (sender *Sender) HandleProjectileFired(projectileFiredEvent *events.ProjectileFired)
func (*Sender) HandleProjectileHit ¶
func (sender *Sender) HandleProjectileHit(projectileHitEvent *events.ProjectileHit)
func (*Sender) HandleUserConnected ¶
func (sender *Sender) HandleUserConnected(userConnectedEvent *events.UserConnected)
func (*Sender) HandleUserJoined ¶
func (sender *Sender) HandleUserJoined(userJoinedEvent *events.UserJoined)
func (*Sender) HandleUserLeft ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server struct holds server variables.
func NewServer ¶
func NewServer(pattern string, monitor *monitor.Monitor, eventDispatcher *events.EventDispatcher, idManager *utils.IdManager, userNameRegistry *utils.UserNamesRegistry) *Server
NewServer initializes a new server.
func (*Server) HandleUserLeft ¶
func (*Server) SendToAllClients ¶
Click to show internal directories.
Click to hide internal directories.