     if not name or input.hasClass("initial")
       alert "Please enter your name first"
       return
+
     tupelo.player = new T.Player(name)
     T.log tupelo
     $.ajax
       url: "/ajax/player/register"
       data:
         player: JSON.stringify(tupelo.player)
-
       success: registerOk
       error: ajaxErr
 

        statusStr = "NOLO"
      else statusStr = "RAMI" if state.mode is T.RAMI

    statusStr = "<span>" + statusStr + "</span>"
    statusStr += "<span>tricks: " + state.tricks[0] + " - " + state.tricks[1] + "</span>"

    if state.score?

        data:
          akey: tupelo.player.akey
          game_id: game_id
        success: gameCreateOk
        error: ajaxErr

    if tupelo.game_id?
      $("button.game_join").attr "disabled", true
      $("tr#game_id_" + tupelo.game_id).addClass "highlight"
    else
      $("button#" + id).attr "disabled", true for id in disabledIds
      $("button.game_join").click gameJoinClicked

  listGamesOk = (result) ->
    #T.log "listGamesOk"
    #T.log result
    html = ""
    disabledIds = []
    for own game_id of result
      html += "<tr id=\"game_id_#{game_id}\">"
      #players = []
      #for res in result[game_id]
      #  plr = new T.Player().fromObj res
      #  players.push plr.player_name
      players = (new T.Player().fromObj(res).player_name for res in result[game_id])

      html += "<td>" + escapeHtml(players.join(", ")) + "</td>"
      html += "<td class=\"game_list_actions\"><button class=\"game_join btn\" id=\"game_join_" + game_id + "\"><span><span>join</span></span></button></td>"
      html += "</tr>"
      disabledIds.push "game_join_#{game_id}" if players.length is 4

    $("#game_list table tbody").html html
    updateGameLinks disabledIds
    dbg()

  listPlayersOk = (result) ->
    T.log result
    html = ""
