public void doTask() {
if(enabled){
setEnabled(false);
messageLabel.setText("checkiing...");
final ASBOTXGame game=(ASBOTXGame)MEngine.getGeneralGame();
Player player=game.getLocalPlayer().getPlayer();
player.setID(sb.toString().trim());
game.getPlayerService().createNewPlayer(player, new AsyncCallback<PlayerCreatedResponse>(){
@Override
public void onFailure(Throwable caught) {
messageLabel.setText("an Error occured. Please contact the developer about this error");
setEnabled(true);
}
@Override
public void onSuccess(PlayerCreatedResponse result) {
messageLabel.setText(result.getStatus().getMessage());
if(result.getStatus()==CreateStatus.SUCCESS){
game.getLocalPlayer().setID(sb.toString());
game.getLocalPlayer().setTimestamp(result.getCreateTime());
closeIDBoard();
sb.delete(0, sb.length());
idLabel.clearText();
messageLabel.clearText();