 
     tupelo.player = new T.Player(name)
     T.log tupelo
-    $.ajax
-      url: "/ajax/player/register"
+    request
+      url: "/player/register"
       data:
         player: JSON.stringify(tupelo.player)
       success: registerOk
-      error: ajaxErr
 
   # sign in by pressing enter
   $("#register_name").keyup (event) ->

          # are we in a game?
          if result.player.game_id?
            gameCreateOk result.player.game_id
      error: ajaxErr

  updateGameLinks = (disabledIds) ->
    gameJoinClicked = (event) ->
      # "game_join_ID"
      game_id = @id[10..]
      T.log "joining game " + game_id
      $.ajax
        url: "/ajax/game/enter"
        data:
          akey: tupelo.player.akey
          game_id: game_id
        success: gameCreateOk
        error: ajaxErr

    if tupelo.game_id?
      $("button.game_join").attr "disabled", true


  $(".game_leave_btn").click ->
    # TODO: should we cancel timers already here?
    request
      url: "/game/leave"
      data:
        akey: tupelo.player.akey
        game_id: tupelo.game_id
