func (l *Lobby) AddUser(username string, w http.ResponseWriter, r *http.Request) error {
	result := make(chan error)
	pn := player.Name(username)
	sm := message.Socket{
		Type:           message.SocketAdd,
		PlayerName:     pn,
		ResponseWriter: w,
		Request:        r,
		Result:         result,
	}
	l.socketMessages <- sm
	err := <-result
	if err != nil {
		return err
	}
	return nil
}
// AddUser adds a user to the lobby, it opens a new websocket (player) for the username.
AddUser adds a user to the lobby, it opens a new websocket (player) for the username.
// AddUser adds a user to the lobby it opens a new websocket ( player ) for the username .
func (l *Lobby) AddUser(username string, w http.ResponseWriter, r *http.Request) error {
	result := make(chan error)
	pn := player.Name(username)
	sm := message.Socket{
		Type:           message.SocketAdd,
		PlayerName:     pn,
		ResponseWriter: w,
		Request:        r,
		Result:         result,
	}
	l.socketMessages <- sm
	err := <-result
	if err != nil {
		return err
	}
	return nil
}
func ( l * Lobby ) AddUser ( username string , w http . ResponseWriter , r * http . Request ) error { result := make ( chan error ) pn := player . Name ( username ) sm := message . Socket { Type : message . SocketAdd , PlayerName : pn , ResponseWriter : w , Request : r , Result : result , } l . socketMessages <- sm err := <- result if err != nil { return err } return nil }
AddUser adds a user to the lobby, it opens a new websocket (player) for the username.
AddUser adds a user to the lobby it opens a new websocket ( player ) for the username .