@Override
public void onSuccess(Integer result) {
//if result = true;
switch(result){
case ScotConstants.LOGIN_RECONNECTED:
Window.addWindowClosingHandler(new WindowClosingHandlerImpl(usrName));
preGame.notifyReconnection(new AsyncCallback<String>(){
@Override
public void onFailure(Throwable caught) {
System.out.println("Failed at notifying attempt to reconnect!");
}
@Override
public void onSuccess(String result) {
System.out.println("Success at notifying attempt to reconnect!");
RootLayoutPanel.get().clear();
RootLayoutPanel.get().add(new Game(result));
}
});
break;
case ScotConstants.LOGIN_CONNECTED:
Window.addWindowClosingHandler(new WindowClosingHandlerImpl(usrName));
GameList list = new GameList();
RootLayoutPanel.get().clear();
RootLayoutPanel.get().add(list);
list.updateGameList();