func (s *Socket) writeMessage(m message.Message) error {
	if s.Debug {
		s.log.Printf("socket writing message with type %v", m.Type)
	}
	if err := s.Conn.WriteMessage(m); err != nil {
		return fmt.Errorf("writing socket message: %v", err)
	}
	if m.Type == message.PlayerRemove {
		return fmt.Errorf("player deleted")
	}
	return nil
}
// writeMessage writes a message to the connection.
writeMessage writes a message to the connection.
// writeMessage writes a message to the connection .
func (s *Socket) writeMessage(m message.Message) error {
	if s.Debug {
		s.log.Printf("socket writing message with type %v", m.Type)
	}
	if err := s.Conn.WriteMessage(m); err != nil {
		return fmt.Errorf("writing socket message: %v", err)
	}
	if m.Type == message.PlayerRemove {
		return fmt.Errorf("player deleted")
	}
	return nil
}
func ( s * Socket ) writeMessage ( m message . Message ) error { if s . Debug { s . log . Printf ( " " , m . Type ) } if err := s . Conn . WriteMessage ( m ) ; err != nil { return fmt . Errorf ( " " , err ) } if m . Type == message . PlayerRemove { return fmt . Errorf ( " " ) } return nil }
writeMessage writes a message to the connection.
writeMessage writes a message to the connection .