Guest User

Untitled

a guest
Jun 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. private function onLoginResponse( e:ElectroServerEvent ):void {
  2. var r:LoginResponse = e.message as LoginResponse;
  3. var elr:EupLoginResponse = new EupLoginResponse(pendingLoginType, EUP_LOGIN_RESPONSE);
  4. elr.setAccepted(r.getAccepted());
  5. elr.setUserName(r.getUserName());
  6.  
  7. if ( r.getAccepted() ) {
  8. var context:Object = {
  9. loginResponse: elr,
  10. loginType: pendingLoginType,
  11. name: r.getUserName()
  12. };
  13.  
  14. _loginActions.build(buildDefaultLoginActions(), context)();
  15. } else {
  16. var errorId:int;
  17. var errorHandled:Boolean = false;
  18. if ( r.getEsObject() != null && r.getEsObject().doesPropertyExist(EupLoginConstants.ERROR) ) {
  19. errorHandled = true;
  20. errorId = r.getEsObject().getInteger(EupLoginConstants.ERROR);
  21. }
  22. if ( !errorHandled || EupLoginError.getErrorById(errorId) == null ) {
  23. switch( r.getEsError() ) {
  24. case Errors.MaximumClientConnectionsReached:
  25. errorId = 1001;
  26. break;
  27. case Errors.UserAlreadyLoggedIn:
  28. errorId = 1002;
  29. break;
  30. case Errors.LoginEventHandlerFailure:
  31. errorId = 1003;
  32. break;
  33. default:
  34. errorId = 1000;
  35. }
  36. }
  37. //Loggers.quests.debug("ERROR ID: " + errorId);
  38. elr.setEupLoginError(EupLoginError.getErrorById(errorId));
  39. elr.setEsObject(r.getEsObject());
  40. loginComplete(elr);
  41. }
  42. }
Add Comment
Please, Sign In to add comment