mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,845 @@
|
||||
package createAccountFlow
|
||||
{
|
||||
import avatar.Avatar;
|
||||
import avatar.AvatarUtility;
|
||||
import avatar.AvatarXtCommManager;
|
||||
import avatar.INewAvatar;
|
||||
import com.sbi.analytics.SBTracker;
|
||||
import com.sbi.client.SFEvent;
|
||||
import com.sbi.corelib.crypto.SBCrypto;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.popup.SBPopupManager;
|
||||
import currency.UserCurrency;
|
||||
import flash.display.MovieClip;
|
||||
import flash.errors.IOError;
|
||||
import flash.events.Event;
|
||||
import flash.external.ExternalInterface;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.URLVariables;
|
||||
import flash.net.navigateToURL;
|
||||
import flash.system.Security;
|
||||
import flash.utils.Timer;
|
||||
import gui.DarkenManager;
|
||||
import loadProgress.LoadProgress;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class CreateAccount extends MovieClip implements INewAvatar
|
||||
{
|
||||
|
||||
public var accountCreation:MovieClip;
|
||||
|
||||
private var _createAccountFlashVars:Object;
|
||||
|
||||
private var _nextNewAccountServerIdx:int;
|
||||
|
||||
private var _triedReloadSwf:Boolean;
|
||||
|
||||
private var createUserAutoconnect:Boolean;
|
||||
|
||||
private var createAvatarAutoconnect:Boolean;
|
||||
|
||||
private var loginInfoAutoconnect:Boolean;
|
||||
|
||||
private var loginInfoAutologin:Boolean;
|
||||
|
||||
private var validateUserNameAutoconnect:Boolean;
|
||||
|
||||
private var _validateTestName:String;
|
||||
|
||||
private var _validateTestPass:String;
|
||||
|
||||
private var validateUserNameAutologin:Boolean;
|
||||
|
||||
private var validateAvNameAutoconnect:Boolean;
|
||||
|
||||
private var _validateTestAvName:String;
|
||||
|
||||
private var validateAvNameAutologin:Boolean;
|
||||
|
||||
private var _ignoreValidation:Boolean;
|
||||
|
||||
private var _newUserName:String;
|
||||
|
||||
private var _newUserPass:String;
|
||||
|
||||
private var _newSaveName:Boolean;
|
||||
|
||||
private var _caUserName:String;
|
||||
|
||||
private var _caUserPass:String;
|
||||
|
||||
private var _caBirthday:String;
|
||||
|
||||
private var _caGender:int;
|
||||
|
||||
private var _showAvatar:Avatar;
|
||||
|
||||
private var _caAvatarName:String;
|
||||
|
||||
private var _caAvatarNameIndexes:Array;
|
||||
|
||||
private var _caAvatarType:int;
|
||||
|
||||
private var _caAvatarColor:int;
|
||||
|
||||
private var _createUser:Boolean;
|
||||
|
||||
private var _createAvatar:Boolean;
|
||||
|
||||
private var _createUserLoggedIn:Boolean;
|
||||
|
||||
private var _createAvatarLoggedIn:Boolean;
|
||||
|
||||
private var _userNameValidGuiCallback:Function;
|
||||
|
||||
private var _avNameValidGuiCallback:Function;
|
||||
|
||||
private var _zone:String;
|
||||
|
||||
private var _alreadyCreated:Boolean;
|
||||
|
||||
private var _closeTimer:Timer;
|
||||
|
||||
private var _createdDBUserId:int;
|
||||
|
||||
private var _customAvId:int;
|
||||
|
||||
private var _unusablePasswords:Array;
|
||||
|
||||
private var _connectEvent:Event;
|
||||
|
||||
private var _loginEvent:Event;
|
||||
|
||||
private var _avNameIndexes:Array;
|
||||
|
||||
public function CreateAccount(param1:Object)
|
||||
{
|
||||
super();
|
||||
_createAccountFlashVars = param1;
|
||||
}
|
||||
|
||||
public function loginCtorHelper() : void
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
DebugUtility.debugTrace("security:" + Security.sandboxType);
|
||||
_nextNewAccountServerIdx = 0;
|
||||
_triedReloadSwf = false;
|
||||
_ignoreValidation = false;
|
||||
_newUserName = null;
|
||||
_newUserPass = null;
|
||||
_newSaveName = false;
|
||||
_caUserName = "";
|
||||
_caUserPass = "";
|
||||
_caBirthday = "";
|
||||
_caGender = -1;
|
||||
_caAvatarName = "";
|
||||
_caAvatarNameIndexes = [];
|
||||
_createUser = false;
|
||||
_createAvatar = false;
|
||||
_createUserLoggedIn = false;
|
||||
_createAvatarLoggedIn = false;
|
||||
_alreadyCreated = false;
|
||||
_zone = "sbiLogin";
|
||||
_avNameIndexes = [0,0,0];
|
||||
_createdDBUserId = -1;
|
||||
LoadProgress.init(this);
|
||||
LoadProgress.updateProgress(2);
|
||||
UserCurrency.initCurrency();
|
||||
initCreateAccountAssets();
|
||||
}
|
||||
|
||||
private function initCreateAccountAssets() : void
|
||||
{
|
||||
accountCreation = MainFrame.avatarCreationLogin;
|
||||
initAssets();
|
||||
}
|
||||
|
||||
public function initAssets() : void
|
||||
{
|
||||
LoadProgress.updateProgress(5);
|
||||
XtReplyDemuxer.init();
|
||||
CreateAccountXtCommManager.init(this);
|
||||
GenericListXtCommManager.init();
|
||||
createUserAutoconnect = false;
|
||||
createAvatarAutoconnect = false;
|
||||
loginInfoAutologin = false;
|
||||
validateUserNameAutoconnect = false;
|
||||
validateUserNameAutologin = false;
|
||||
validateAvNameAutoconnect = false;
|
||||
validateAvNameAutologin = false;
|
||||
gMainFrame.server.removeEventListener("OnConnect",onConnect);
|
||||
gMainFrame.server.removeEventListener("OnLogin",onLogIn);
|
||||
gMainFrame.server.removeEventListener("OnConectionLost",onLogOut);
|
||||
gMainFrame.server.addEventListener("OnConnect",onConnect,false,0,true);
|
||||
gMainFrame.server.addEventListener("OnLogin",onLogIn,false,0,true);
|
||||
gMainFrame.server.addEventListener("OnConectionLost",onLogOut,false,0,true);
|
||||
AJAudio.init();
|
||||
CreateAccountGui.init(this);
|
||||
loginInfoAutoconnect = true;
|
||||
connecting();
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
CreateAccountGui.destroy();
|
||||
CreateAccountXtCommManager.destroy();
|
||||
XtReplyDemuxer.destroy();
|
||||
SBPopupManager.destroyAll();
|
||||
gMainFrame.server.removeEventListener("OnConnect",onConnect);
|
||||
gMainFrame.server.removeEventListener("OnLogin",onLogIn);
|
||||
gMainFrame.server.removeEventListener("OnConectionLost",onLogOut);
|
||||
gMainFrame.userInfo.avtDefsCached = false;
|
||||
MainFrame.avatarCreationLogin = null;
|
||||
accountCreation = null;
|
||||
_showAvatar.destroy();
|
||||
_showAvatar = null;
|
||||
}
|
||||
|
||||
public function get validatedAvatarName() : String
|
||||
{
|
||||
return _caAvatarName;
|
||||
}
|
||||
|
||||
public function get validatedUserName() : String
|
||||
{
|
||||
return _caUserName;
|
||||
}
|
||||
|
||||
public function get validatedPassWord() : String
|
||||
{
|
||||
return _caUserPass;
|
||||
}
|
||||
|
||||
public function get showAvatar() : Avatar
|
||||
{
|
||||
return _showAvatar;
|
||||
}
|
||||
|
||||
public function registrationSuccess() : void
|
||||
{
|
||||
CreateAccountGui.trackUserCreateAccountPageChange("IntroComplete",-1,1);
|
||||
SBTracker.completeLastTrackingBatch(onLastBatchPushed);
|
||||
}
|
||||
|
||||
private function onLastBatchPushed() : void
|
||||
{
|
||||
var _loc1_:String = null;
|
||||
var _loc2_:URLRequest = null;
|
||||
var _loc3_:URLVariables = null;
|
||||
try
|
||||
{
|
||||
if(ExternalInterface.available)
|
||||
{
|
||||
ExternalInterface.call("complete_signup",_newUserName,_newUserPass);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc1_ = gMainFrame.clientInfo.websiteURL + "complete_signup";
|
||||
_loc2_ = new URLRequest(_loc1_);
|
||||
_loc2_.method = "POST";
|
||||
_loc3_ = new URLVariables();
|
||||
_loc3_.u = _newUserName;
|
||||
_loc3_.p = _newUserPass;
|
||||
DebugUtility.debugTrace("wurv:" + _loc3_);
|
||||
_loc2_.data = _loc3_;
|
||||
navigateToURL(_loc2_,"_self");
|
||||
}
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
DebugUtility.debugTrace("Error while trying to redirect to autologin (and then world)! msg:" + e.message + e.getStackTrace());
|
||||
}
|
||||
}
|
||||
|
||||
private function loadComplete(param1:Event) : void
|
||||
{
|
||||
gMainFrame.server.disconnect();
|
||||
destroy();
|
||||
AJClient(this.parent).setupGamePlay(_loginEvent,_connectEvent);
|
||||
}
|
||||
|
||||
private function ioError(param1:IOError) : void
|
||||
{
|
||||
DebugUtility.debugTrace("IO Error while trying to redirect to autologin (and then world)!");
|
||||
}
|
||||
|
||||
public function connecting() : void
|
||||
{
|
||||
CreateAccountGui.showConnectingMsg();
|
||||
LoadProgress.show(true);
|
||||
gMainFrame.server.connect();
|
||||
}
|
||||
|
||||
private function onConnect(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
LoadProgress.updateProgress(6);
|
||||
_connectEvent = param1;
|
||||
if(param1.status)
|
||||
{
|
||||
_triedReloadSwf = false;
|
||||
CreateAccountGui.hideNotifyPopup();
|
||||
if(loginInfoAutoconnect)
|
||||
{
|
||||
loginInfoAutoconnect = false;
|
||||
logInForCreateAvatarData();
|
||||
return;
|
||||
}
|
||||
if(validateUserNameAutoconnect)
|
||||
{
|
||||
validateUserNameAutoconnect = false;
|
||||
validateUserName(_validateTestName,_validateTestPass,0,0,0,_userNameValidGuiCallback);
|
||||
return;
|
||||
}
|
||||
if(validateAvNameAutoconnect)
|
||||
{
|
||||
validateAvNameAutoconnect = false;
|
||||
validateAvatarName(_validateTestAvName,_avNameIndexes[0],_avNameIndexes[1],_avNameIndexes[2],_avNameValidGuiCallback);
|
||||
return;
|
||||
}
|
||||
if(createUserAutoconnect)
|
||||
{
|
||||
createUserAutoconnect = false;
|
||||
createNewAccount();
|
||||
return;
|
||||
}
|
||||
if(createAvatarAutoconnect)
|
||||
{
|
||||
createAvatarAutoconnect = false;
|
||||
createNewAvatar();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(gMainFrame.server.allowAutoAttemptHttp && !gMainFrame.server.autoAttemptHttp)
|
||||
{
|
||||
if(_nextNewAccountServerIdx < gMainFrame.server.serverIps.length - 1)
|
||||
{
|
||||
gMainFrame.server.setNewServer(_nextNewAccountServerIdx);
|
||||
DebugUtility.debugTrace("new account trying next Server Node: " + gMainFrame.server.serverIp);
|
||||
gMainFrame.server.connect();
|
||||
_nextNewAccountServerIdx = _nextNewAccountServerIdx + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.server.autoAttemptHttp = true;
|
||||
_nextNewAccountServerIdx = 0;
|
||||
gMainFrame.server.setNewServer(_nextNewAccountServerIdx);
|
||||
DebugUtility.debugTrace("new account trying first httpProxy Server Node: " + gMainFrame.server.serverIp);
|
||||
gMainFrame.server.connect();
|
||||
}
|
||||
}
|
||||
else if(_nextNewAccountServerIdx < gMainFrame.server.serverIps.length - 1)
|
||||
{
|
||||
gMainFrame.server.setNewServer(_nextNewAccountServerIdx);
|
||||
DebugUtility.debugTrace("new account trying next httpProxy Server Node: " + gMainFrame.server.serverIp);
|
||||
gMainFrame.server.connect();
|
||||
_nextNewAccountServerIdx = _nextNewAccountServerIdx + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!_triedReloadSwf)
|
||||
{
|
||||
_triedReloadSwf = true;
|
||||
_loc2_ = Utility.reloadSWFOrGetIp(false,false);
|
||||
if(_loc2_)
|
||||
{
|
||||
gMainFrame.server.switchServerNode(_loc2_);
|
||||
DebugUtility.debugTrace("trying new Server Node: " + _loc2_);
|
||||
gMainFrame.server.connect();
|
||||
return;
|
||||
}
|
||||
}
|
||||
DebugUtility.debugTrace("entire new account cluster is down! _nextNewAccountServerIdx:" + _nextNewAccountServerIdx + " serverIps:" + gMainFrame.server.serverIps);
|
||||
CreateAccountGui.showConnectFailedPopup();
|
||||
}
|
||||
}
|
||||
|
||||
public function hideConnectingMsg() : void
|
||||
{
|
||||
CreateAccountGui.hideNotifyPopup();
|
||||
}
|
||||
|
||||
public function logInNewAccountDone() : void
|
||||
{
|
||||
registrationSuccess();
|
||||
}
|
||||
|
||||
public function newAvatarData(param1:int, param2:String, param3:Array, param4:Function, param5:int = -1, param6:int = -1, param7:Boolean = false) : void
|
||||
{
|
||||
_showAvatar = AvatarUtility.findCreationAvatarByType(param1,param6);
|
||||
_caAvatarType = param1;
|
||||
_caAvatarNameIndexes = param3;
|
||||
_customAvId = param6;
|
||||
validateAvatarName(param2,_caAvatarNameIndexes[0],_caAvatarNameIndexes[1],_caAvatarNameIndexes[2],param4);
|
||||
}
|
||||
|
||||
public function logInForCreateAvatarData() : void
|
||||
{
|
||||
if(!gMainFrame.server.isConnected)
|
||||
{
|
||||
loginInfoAutoconnect = true;
|
||||
CreateAccountGui.showConnectingMsg();
|
||||
gMainFrame.server.connect();
|
||||
return;
|
||||
}
|
||||
if(!gMainFrame.server.isLoggedIn)
|
||||
{
|
||||
loginInfoAutologin = true;
|
||||
gMainFrame.server.logIn("sbiAccountZone","","");
|
||||
}
|
||||
else
|
||||
{
|
||||
GenericListXtCommManager.requestGenericList(64,handleCreateAvatarData,null,false);
|
||||
}
|
||||
}
|
||||
|
||||
public function handleCreateAvatarData(param1:Array) : void
|
||||
{
|
||||
if(gMainFrame.server.isLoggedIn)
|
||||
{
|
||||
loginInfoAutologin = false;
|
||||
AvatarUtility.buildCreationAvatarViews(param1,true,onCreationAvatarViewsLoaded);
|
||||
}
|
||||
else
|
||||
{
|
||||
logInForCreateAvatarData();
|
||||
}
|
||||
}
|
||||
|
||||
private function onCreationAvatarViewsLoaded() : void
|
||||
{
|
||||
CreateAccountGui.showTypeSelectAvatars();
|
||||
CreateAccountGui.chooseAnimalScreen.init();
|
||||
}
|
||||
|
||||
public function invalidateUserName() : void
|
||||
{
|
||||
_caUserName = null;
|
||||
}
|
||||
|
||||
public function invalidatePassWord() : void
|
||||
{
|
||||
_caUserPass = null;
|
||||
}
|
||||
|
||||
public function invalidatePending() : void
|
||||
{
|
||||
_ignoreValidation = true;
|
||||
}
|
||||
|
||||
public function validateUserName(param1:String, param2:String, param3:int, param4:int, param5:int, param6:Function, param7:int = 0) : void
|
||||
{
|
||||
_userNameValidGuiCallback = param6;
|
||||
if(param1 && param1 != "" && param1.length > 2 && SbiConstants.USERNAME_REGEX.test(param1))
|
||||
{
|
||||
if(param2 == null || param2.toLowerCase().indexOf(param1.toLowerCase()) < 0)
|
||||
{
|
||||
if(!gMainFrame.server.isConnected)
|
||||
{
|
||||
validateUserNameAutoconnect = true;
|
||||
_validateTestName = param1;
|
||||
_validateTestPass = param2;
|
||||
CreateAccountGui.showConnectingMsg();
|
||||
gMainFrame.server.connect();
|
||||
return;
|
||||
}
|
||||
if(gMainFrame.server.isLoggedIn)
|
||||
{
|
||||
_validateTestName = param1;
|
||||
_validateTestPass = param2;
|
||||
CreateAccountXtCommManager.sendLoginAvailableRequest(param7,_validateTestName,0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
validateUserNameAutologin = true;
|
||||
_validateTestName = param1;
|
||||
_validateTestPass = param2;
|
||||
gMainFrame.server.logIn("sbiAccountZone","","");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateAccountGui.showNewPasswordBadMsg(-16);
|
||||
if(_userNameValidGuiCallback != null)
|
||||
{
|
||||
_userNameValidGuiCallback(false,[],2);
|
||||
}
|
||||
SBTracker.trackPageview("/login/usernameValidation/#usernameSameAsPassword",0,1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateAccountGui.showUsernameExistsMsg();
|
||||
if(_userNameValidGuiCallback != null)
|
||||
{
|
||||
_userNameValidGuiCallback(false,[],2);
|
||||
}
|
||||
SBTracker.trackPageview("/login/usernameValidation/#tooShortOrRegexFailed",0,1);
|
||||
}
|
||||
}
|
||||
|
||||
public function validatePassWord(param1:String, param2:String, param3:Function) : void
|
||||
{
|
||||
var _loc4_:RegExp = new RegExp(SbiConstants.PASSWORD_REGEX[0]);
|
||||
var _loc5_:RegExp = new RegExp(SbiConstants.PASSWORD_REGEX[1]);
|
||||
var _loc6_:RegExp = new RegExp(SbiConstants.PASSWORD_REGEX[2]);
|
||||
if(param1 && param1 != "" && param1.length >= 12)
|
||||
{
|
||||
if(_unusablePasswords == null)
|
||||
{
|
||||
_unusablePasswords = LocalizationManager.translateIdOnly(21913).split("|");
|
||||
}
|
||||
if(param2.toLowerCase().indexOf(param1.toLowerCase()) >= 0 || param1.toLowerCase().indexOf(param2.toLowerCase()) >= 0)
|
||||
{
|
||||
CreateAccountGui.showNewPasswordBadMsg(-16);
|
||||
param3(false);
|
||||
SBTracker.trackPageview("/login/usernameValidation/#passwordSameAsUsername",0,1);
|
||||
}
|
||||
else if(_unusablePasswords.indexOf(param1) != -1)
|
||||
{
|
||||
CreateAccountGui.showNewPasswordBadMsg(-5);
|
||||
param3(false);
|
||||
SBTracker.trackPageview("/login/usernameValidation/#passwordInvalid",0,1);
|
||||
}
|
||||
else if(!(_loc4_.test(param1) && _loc5_.test(param1) && _loc6_.test(param1)))
|
||||
{
|
||||
CreateAccountGui.showNewPasswordBadMsg(-101);
|
||||
param3(false);
|
||||
SBTracker.trackPageview("/login/usernameValidation/#passwordInvalid",0,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_caUserPass = param1;
|
||||
CreateAccountGui.hideNotifyPopup();
|
||||
param3(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
param3(false);
|
||||
}
|
||||
}
|
||||
|
||||
public function validateAvatarName(param1:String, param2:int, param3:int, param4:int, param5:Function) : void
|
||||
{
|
||||
_avNameValidGuiCallback = param5;
|
||||
if(param1 && param1 != "" && RegExp(/a-zA-Z0-9 /)["exec"](param1) == null)
|
||||
{
|
||||
_validateTestAvName = param1;
|
||||
if(!gMainFrame.server.isConnected)
|
||||
{
|
||||
validateAvNameAutoconnect = true;
|
||||
CreateAccountGui.showConnectingMsg();
|
||||
gMainFrame.server.connect();
|
||||
return;
|
||||
}
|
||||
if(gMainFrame.server.isLoggedIn)
|
||||
{
|
||||
CreateAccountXtCommManager.sendLoginAvailableRequest(1,"",param2,param3,param4);
|
||||
}
|
||||
else
|
||||
{
|
||||
validateAvNameAutologin = true;
|
||||
gMainFrame.server.logIn("sbiAccountZone","","");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateAccountGui.showAvNameExistsMsg();
|
||||
}
|
||||
}
|
||||
|
||||
public function setBirthday(param1:String, param2:String, param3:String) : void
|
||||
{
|
||||
var _loc4_:Date = null;
|
||||
var _loc5_:int = 0;
|
||||
try
|
||||
{
|
||||
_loc4_ = new Date();
|
||||
_loc5_ = _loc4_.fullYear - int(param3);
|
||||
if(param1 == "")
|
||||
{
|
||||
param1 = String(_loc4_.month + 1);
|
||||
}
|
||||
if(param2 == "")
|
||||
{
|
||||
param2 = String(_loc4_.date);
|
||||
}
|
||||
if(int(param1) > _loc4_.month + 1 || int(param1) == _loc4_.month + 1 && int(param2) >= _loc4_.date + 1)
|
||||
{
|
||||
_loc5_--;
|
||||
}
|
||||
if(_loc5_ < 0)
|
||||
{
|
||||
_loc5_ = 0;
|
||||
}
|
||||
_caBirthday = param1 + "/" + param2 + "/" + _loc5_;
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
DebugUtility.debugTrace("ERROR: Bad birthday provided! Using default 1/1/1 for now.");
|
||||
_caBirthday = "1/1/1";
|
||||
}
|
||||
}
|
||||
|
||||
public function setGender(param1:int) : void
|
||||
{
|
||||
_caGender = param1;
|
||||
}
|
||||
|
||||
public function screenInitCallback(param1:MovieClip) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function get playSound() : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private function createNewAccount() : void
|
||||
{
|
||||
var _loc2_:Array = null;
|
||||
var _loc1_:Array = null;
|
||||
if(!gMainFrame.server.isConnected)
|
||||
{
|
||||
createUserAutoconnect = true;
|
||||
CreateAccountGui.showConnectingMsg();
|
||||
gMainFrame.server.connect();
|
||||
return;
|
||||
}
|
||||
if(gMainFrame.server.isLoggedIn && _createUser)
|
||||
{
|
||||
_createUserLoggedIn = true;
|
||||
}
|
||||
if(_createUserLoggedIn)
|
||||
{
|
||||
_loc2_ = [_caUserName,SBCrypto.encrypt(_caUserPass,gMainFrame.server.hashKey),_caBirthday,_caGender,gMainFrame.clientInfo.sgParams];
|
||||
_loc1_ = [0,_caUserName,_caAvatarNameIndexes[0],LocalizationManager.isCurrLanguageReversed() ? _caAvatarNameIndexes[2] : _caAvatarNameIndexes[1],LocalizationManager.isCurrLanguageReversed() ? _caAvatarNameIndexes[1] : _caAvatarNameIndexes[2],_caAvatarType,_showAvatar.colors[0],_showAvatar.colors[1],_showAvatar.colors[2],_showAvatar.accShownItems];
|
||||
CreateAccountXtCommManager.sendLoginCreateRequest(_loc2_,_loc1_);
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.server.logIn("sbiAccountZone","","");
|
||||
}
|
||||
}
|
||||
|
||||
public function createNewAccountSetup(param1:Function) : Boolean
|
||||
{
|
||||
var _loc2_:Boolean = false;
|
||||
var _loc3_:Boolean = false;
|
||||
if(_alreadyCreated)
|
||||
{
|
||||
CreateAccountGui.loginCreateSuccess(_createdDBUserId);
|
||||
return true;
|
||||
}
|
||||
if(_caUserName == null || _caUserName == "" && !SbiConstants.USERNAME_REGEX.test(_caUserName))
|
||||
{
|
||||
_loc2_ = true;
|
||||
}
|
||||
if(_caUserPass == null || _caUserPass == "")
|
||||
{
|
||||
_loc3_ = true;
|
||||
}
|
||||
if(!_loc2_ && !_loc3_)
|
||||
{
|
||||
CreateAccountGui.loginCreateGuiCallback = param1;
|
||||
_newUserName = _caUserName;
|
||||
_newUserPass = _caUserPass;
|
||||
_createUser = true;
|
||||
_createAvatar = true;
|
||||
createNewAccount();
|
||||
return true;
|
||||
}
|
||||
CreateAccountGui.showUsernameExistsMsg(-10,_loc2_ ? true : false);
|
||||
return false;
|
||||
}
|
||||
|
||||
private function createNewAvatar() : void
|
||||
{
|
||||
var _loc1_:Array = null;
|
||||
if(!gMainFrame.server.isConnected)
|
||||
{
|
||||
createAvatarAutoconnect = true;
|
||||
CreateAccountGui.showConnectingMsg();
|
||||
gMainFrame.server.connect();
|
||||
return;
|
||||
}
|
||||
if(gMainFrame.server.isLoggedIn && _createAvatar)
|
||||
{
|
||||
_createAvatarLoggedIn = true;
|
||||
}
|
||||
if(_createAvatarLoggedIn)
|
||||
{
|
||||
_loc1_ = [_caUserName,_caAvatarNameIndexes[0],_caAvatarNameIndexes[1],_caAvatarNameIndexes[2],_caAvatarType,_showAvatar.colors[0],_showAvatar.colors[1],_showAvatar.colors[2],_showAvatar.accShownItems];
|
||||
CreateAccountXtCommManager.sendLoginNewRequest(_loc1_);
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.server.logIn("sbiAccountZone","","");
|
||||
}
|
||||
}
|
||||
|
||||
public function createNewAvatarPrep(param1:int = 0) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function nameTypeScreenDone() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function handleLoginAvailable(param1:Array, param2:int) : void
|
||||
{
|
||||
if(_ignoreValidation)
|
||||
{
|
||||
_ignoreValidation = false;
|
||||
return;
|
||||
}
|
||||
var _loc3_:int = int(param1[2]);
|
||||
if(_loc3_ == -24)
|
||||
{
|
||||
CreateAccountGui.showDifferentVersionsPopup();
|
||||
}
|
||||
else if(param2 == 0 || param2 == 2)
|
||||
{
|
||||
if(_loc3_ != 1)
|
||||
{
|
||||
_caUserName = null;
|
||||
SBTracker.trackPageview("/login/usernameValidation/#lcBadResponse" + param1[2],0,1);
|
||||
if(_userNameValidGuiCallback != null)
|
||||
{
|
||||
_userNameValidGuiCallback(_loc3_,param1,param2);
|
||||
}
|
||||
if(param2 != 2)
|
||||
{
|
||||
CreateAccountGui.showUsernameExistsMsg(_loc3_);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_caUserName = _validateTestName;
|
||||
if(_userNameValidGuiCallback != null)
|
||||
{
|
||||
_userNameValidGuiCallback(_loc3_,param1,param2);
|
||||
}
|
||||
if(param2 != 2)
|
||||
{
|
||||
CreateAccountGui.hideUsernameExistsMsg();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(param2 == 1)
|
||||
{
|
||||
if(_loc3_ == 1)
|
||||
{
|
||||
_caAvatarName = _validateTestAvName;
|
||||
if(_avNameValidGuiCallback != null)
|
||||
{
|
||||
_avNameValidGuiCallback(true);
|
||||
}
|
||||
}
|
||||
else if(_avNameValidGuiCallback != null)
|
||||
{
|
||||
_avNameValidGuiCallback(false);
|
||||
}
|
||||
CreateAccountGui.avatarNameValidateCallback(_loc3_);
|
||||
}
|
||||
}
|
||||
|
||||
public function handleLoginCreate(param1:Array) : void
|
||||
{
|
||||
var _loc2_:int = int(param1[2]);
|
||||
var _loc3_:int = int(param1[3]);
|
||||
if(_loc2_ <= 0)
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
if(_loc2_ == -24)
|
||||
{
|
||||
CreateAccountGui.showDifferentVersionsPopup();
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateAccountGui.showLoginCreateResultMsg(_loc2_);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.server.disconnect();
|
||||
_alreadyCreated = true;
|
||||
_createdDBUserId = _loc3_;
|
||||
DebugUtility.debugTrace("Created DbUserId = " + _createdDBUserId);
|
||||
CreateAccountGui.loginCreateSuccess(_loc3_);
|
||||
}
|
||||
}
|
||||
|
||||
public function handleLocalExternalCall(param1:Object) : void
|
||||
{
|
||||
}
|
||||
|
||||
private function onLogOut(param1:SFEvent) : void
|
||||
{
|
||||
_createUserLoggedIn = false;
|
||||
_createAvatarLoggedIn = false;
|
||||
}
|
||||
|
||||
private function onLogIn(param1:SFEvent) : void
|
||||
{
|
||||
_loginEvent = param1;
|
||||
gMainFrame.server.setInitRoom();
|
||||
if(validateUserNameAutologin || validateAvNameAutologin || loginInfoAutologin)
|
||||
{
|
||||
loginDone();
|
||||
return;
|
||||
}
|
||||
if(_createUser)
|
||||
{
|
||||
_createUserLoggedIn = true;
|
||||
}
|
||||
else if(_createAvatar)
|
||||
{
|
||||
_createAvatarLoggedIn = true;
|
||||
}
|
||||
loginDone();
|
||||
}
|
||||
|
||||
private function loginDone() : void
|
||||
{
|
||||
LoadProgress.updateProgress(6);
|
||||
if(!gMainFrame.userInfo.avtDefsCached)
|
||||
{
|
||||
AvatarXtCommManager.requestAvatarInfo(loginDone);
|
||||
return;
|
||||
}
|
||||
CreateAccountGui.loadNameLists();
|
||||
if(loginInfoAutologin)
|
||||
{
|
||||
GenericListXtCommManager.requestGenericList(64,handleCreateAvatarData,null,false);
|
||||
return;
|
||||
}
|
||||
if(validateUserNameAutologin)
|
||||
{
|
||||
validateUserNameAutologin = false;
|
||||
validateUserName(_validateTestName,_validateTestPass,0,0,0,_userNameValidGuiCallback);
|
||||
return;
|
||||
}
|
||||
if(validateAvNameAutologin)
|
||||
{
|
||||
validateAvNameAutologin = false;
|
||||
validateAvatarName(_validateTestAvName,_avNameIndexes[0],_avNameIndexes[1],_avNameIndexes[2],_avNameValidGuiCallback);
|
||||
return;
|
||||
}
|
||||
if(_createAvatarLoggedIn)
|
||||
{
|
||||
createNewAvatar();
|
||||
}
|
||||
if(_createUserLoggedIn)
|
||||
{
|
||||
createNewAccount();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,516 @@
|
||||
package createAccountFlow
|
||||
{
|
||||
import avatar.AvatarSwitch;
|
||||
import com.sbi.analytics.SBTracker;
|
||||
import com.sbi.corelib.audio.SBSound;
|
||||
import com.sbi.popup.SBOkPopup;
|
||||
import com.sbi.popup.SBPopup;
|
||||
import com.sbi.popup.SBPopupManager;
|
||||
import createAccountGui.GuiAvatarCreationAssets;
|
||||
import createAccountGui.GuiChooseAnimal;
|
||||
import createAccountGui.GuiCreateAName;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.system.ApplicationDomain;
|
||||
import gui.DarkenManager;
|
||||
import gui.GuiNameTypeScreen;
|
||||
import gui.PollManager;
|
||||
import loadProgress.LoadProgress;
|
||||
import localization.LocalizationManager;
|
||||
import resource.LoadAvatarCarouselResourceStackable;
|
||||
|
||||
public class CreateAccountGui
|
||||
{
|
||||
|
||||
public static const MSG_ID_SERVER_ERROR:int = -1;
|
||||
|
||||
public static const MSG_ID_USERNAME_BADWORD:int = -2;
|
||||
|
||||
public static const MSG_ID_USERNAME_UNAVAILABLE:int = -3;
|
||||
|
||||
public static const MSG_ID_USERNAME_MISSING:int = -4;
|
||||
|
||||
public static const MSG_ID_PASSWORD_INVALID:int = -5;
|
||||
|
||||
public static const MSG_ID_PASSWORD_MISSING:int = -6;
|
||||
|
||||
public static const MSG_ID_LOGIN_INVALID:int = -10;
|
||||
|
||||
public static const MSG_ID_LOGIN_IN_USE:int = -11;
|
||||
|
||||
public static const MSG_ID_LOGIN_ZONE_FULL:int = -12;
|
||||
|
||||
public static const MSG_ID_LOGIN_CONNECTION:int = -13;
|
||||
|
||||
public static const MSG_ID_LOGIN_BANNED:int = -14;
|
||||
|
||||
public static const MSG_ID_LOGIN_SERVER_MAIN:int = -15;
|
||||
|
||||
public static const MSG_ID_PASSWORD_SAME_AS_UN:int = -16;
|
||||
|
||||
public static const MSG_ID_AGE_BLANK:int = -98;
|
||||
|
||||
public static const MSG_ID_SEX_BLANK:int = -99;
|
||||
|
||||
public static const MSG_ID_MONTH_OR_DAY_BLANK:int = -100;
|
||||
|
||||
public static const MSG_ID_PASSWORD_FORMAT:int = -101;
|
||||
|
||||
public static const MIN_PASSWORD_LENGTH:int = 12;
|
||||
|
||||
public static var bgLayer:DisplayLayer;
|
||||
|
||||
public static var frgLayer:DisplayLayer;
|
||||
|
||||
public static var guiLayer:DisplayLayer;
|
||||
|
||||
public static var loginCreateGuiCallback:Function;
|
||||
|
||||
public static var vo1Sound:SBSound;
|
||||
|
||||
public static var vo2Sound:SBSound;
|
||||
|
||||
public static var vo3Sound:SBSound;
|
||||
|
||||
public static var vo4Sound:SBSound;
|
||||
|
||||
public static var vo5Sound:SBSound;
|
||||
|
||||
public static var vo2CombinedSound:SBSound;
|
||||
|
||||
private static var _login:CreateAccount;
|
||||
|
||||
private static var _loginAssets:GuiAvatarCreationAssets;
|
||||
|
||||
private static var _nameTypeScreen:GuiNameTypeScreen;
|
||||
|
||||
private static var _serverPopup:MovieClip;
|
||||
|
||||
private static var _charPopup:MovieClip;
|
||||
|
||||
private static var _spawnPopup:MovieClip;
|
||||
|
||||
private static var splashScreen:MovieClip;
|
||||
|
||||
private static var createAccountRulesPopup:SBPopup;
|
||||
|
||||
private static var selectAvatarPopup:SBPopup;
|
||||
|
||||
private static var createAccountCharacterPopup:SBPopup;
|
||||
|
||||
private static var createAccountAvEditorPopup:SBPopup;
|
||||
|
||||
private static var createAccountPasswordPopup:SBPopup;
|
||||
|
||||
private static var createAccountChatPopup:SBPopup;
|
||||
|
||||
private static var createAccountActivatePopup:SBPopup;
|
||||
|
||||
private static var createAccountSuccessPopup:SBPopup;
|
||||
|
||||
private static var _notifyPopup:MovieClip;
|
||||
|
||||
private static var connectingStr:int;
|
||||
|
||||
private static var connectFailedStr:int;
|
||||
|
||||
private static var loggingInStr:int;
|
||||
|
||||
private static var failedLoginStr:int;
|
||||
|
||||
private static var usernameExistsStr:int;
|
||||
|
||||
private static var oopsTitleStr:int;
|
||||
|
||||
private static var connectingTitleStr:int;
|
||||
|
||||
public function CreateAccountGui()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init(param1:CreateAccount) : void
|
||||
{
|
||||
_login = param1;
|
||||
_loginAssets = new GuiAvatarCreationAssets();
|
||||
_loginAssets.initFromAccountCreation(param1.accountCreation,param1);
|
||||
bgLayer = new DisplayLayer();
|
||||
frgLayer = new DisplayLayer();
|
||||
guiLayer = new DisplayLayer();
|
||||
_login.addChild(bgLayer);
|
||||
_login.addChild(guiLayer);
|
||||
_login.addChild(frgLayer);
|
||||
DarkenManager.init(frgLayer);
|
||||
SBPopupManager.darken = DarkenManager.darken;
|
||||
SBPopupManager.lighten = DarkenManager.unDarken;
|
||||
PollManager.init(frgLayer,guiLayer);
|
||||
_loginAssets.tipsPopup.visible = false;
|
||||
frgLayer.addChild(_loginAssets);
|
||||
setupVOSounds();
|
||||
connectingStr = 11143;
|
||||
connectFailedStr = 11144;
|
||||
oopsTitleStr = 11145;
|
||||
connectingTitleStr = 0;
|
||||
_notifyPopup = _loginAssets.notifyPopup;
|
||||
loggingInStr = 11146;
|
||||
failedLoginStr = 11147;
|
||||
usernameExistsStr = 11148;
|
||||
Utility.trackWhichBrowserIsUsed(true);
|
||||
trackUserCreateAccountPageChange(gMainFrame.clientInfo.clientPlatform);
|
||||
showNewChrPopup();
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
if(_login.contains(bgLayer))
|
||||
{
|
||||
_login.removeChild(bgLayer);
|
||||
}
|
||||
bgLayer = null;
|
||||
if(_login.contains(guiLayer))
|
||||
{
|
||||
_login.removeChild(guiLayer);
|
||||
}
|
||||
guiLayer = null;
|
||||
if(_login.contains(frgLayer))
|
||||
{
|
||||
frgLayer.removeChild(_loginAssets);
|
||||
_login.removeChild(frgLayer);
|
||||
}
|
||||
frgLayer = null;
|
||||
_login = null;
|
||||
createAccountRulesPopup.destroy();
|
||||
createAccountRulesPopup = null;
|
||||
selectAvatarPopup.destroy();
|
||||
selectAvatarPopup = null;
|
||||
createAccountCharacterPopup.destroy();
|
||||
createAccountCharacterPopup = null;
|
||||
createAccountAvEditorPopup.destroy();
|
||||
createAccountAvEditorPopup = null;
|
||||
createAccountChatPopup.destroy();
|
||||
createAccountChatPopup = null;
|
||||
createAccountActivatePopup.destroy();
|
||||
createAccountActivatePopup = null;
|
||||
createAccountSuccessPopup.destroy();
|
||||
createAccountSuccessPopup = null;
|
||||
_loginAssets.destroy();
|
||||
_loginAssets = null;
|
||||
vo1Sound.destroy();
|
||||
vo1Sound = null;
|
||||
vo2Sound.destroy();
|
||||
vo2Sound = null;
|
||||
vo3Sound.destroy();
|
||||
vo3Sound = null;
|
||||
vo4Sound.destroy();
|
||||
vo4Sound = null;
|
||||
vo5Sound.destroy();
|
||||
vo5Sound = null;
|
||||
vo2CombinedSound.destroy();
|
||||
vo2CombinedSound = null;
|
||||
DarkenManager.destroy();
|
||||
}
|
||||
|
||||
private static function setupVOSounds(param1:MovieClip = null) : void
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
MainFrame.avatarCreationVO = param1;
|
||||
}
|
||||
var _loc2_:ApplicationDomain = MainFrame.avatarCreationVO.loaderInfo.applicationDomain;
|
||||
vo1Sound = new SBSound(_loc2_.getDefinition("VO_Section1") as Class,false);
|
||||
vo2Sound = new SBSound(_loc2_.getDefinition("VO_Section2") as Class,false);
|
||||
vo3Sound = new SBSound(_loc2_.getDefinition("VO_Section3") as Class,false);
|
||||
vo4Sound = new SBSound(_loc2_.getDefinition("VO_Section4") as Class,false);
|
||||
vo5Sound = new SBSound(_loc2_.getDefinition("VO_Section5") as Class,false);
|
||||
if(LocalizationManager.currentLanguage == LocalizationManager.LANG_ENG)
|
||||
{
|
||||
vo2CombinedSound = new SBSound(_loc2_.getDefinition("VO_Section2Combined") as Class,false);
|
||||
}
|
||||
if(param1 && param1.passback != null)
|
||||
{
|
||||
param1.passback.callback(param1.passback.isInWorld,param1.passback.requiredParams);
|
||||
}
|
||||
}
|
||||
|
||||
public static function get nameTypeScreen() : GuiCreateAName
|
||||
{
|
||||
return _loginAssets.createNameScreen;
|
||||
}
|
||||
|
||||
public static function get chooseAnimalScreen() : GuiChooseAnimal
|
||||
{
|
||||
return _loginAssets.chooseAnimalScreen;
|
||||
}
|
||||
|
||||
public static function showConnectingMsg() : void
|
||||
{
|
||||
_loginAssets.notifyPopup.notifyTxt.borderColor = 0;
|
||||
_loginAssets.notifyPopup.notifyTxt.y = 0;
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,connectingStr);
|
||||
_loginAssets.notifyPopup.titleTxt.text = connectingTitleStr;
|
||||
_loginAssets.notifyPopup.visible = true;
|
||||
}
|
||||
|
||||
public static function hideNotifyPopup() : void
|
||||
{
|
||||
_loginAssets.notifyPopup.visible = false;
|
||||
}
|
||||
|
||||
public static function showConnectFailedPopup() : void
|
||||
{
|
||||
_loginAssets.notifyPopup.notifyTxt.borderColor = 0;
|
||||
_loginAssets.notifyPopup.notifyTxt.y = 0;
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,connectFailedStr);
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.titleTxt,oopsTitleStr);
|
||||
_loginAssets.notifyPopup.visible = true;
|
||||
}
|
||||
|
||||
public static function showDifferentVersionsPopup() : void
|
||||
{
|
||||
new SBOkPopup(frgLayer,LocalizationManager.translateIdOnly(19856),true,onClientVersionDifferentOk);
|
||||
}
|
||||
|
||||
public static function currAvatar() : MovieClip
|
||||
{
|
||||
return _loginAssets.currAvatarImage;
|
||||
}
|
||||
|
||||
public static function currBG() : String
|
||||
{
|
||||
return _loginAssets.currBG;
|
||||
}
|
||||
|
||||
public static function currType() : int
|
||||
{
|
||||
return _loginAssets.currType;
|
||||
}
|
||||
|
||||
public static function loadNameLists() : void
|
||||
{
|
||||
_loginAssets.loadNameLists();
|
||||
}
|
||||
|
||||
private static function onClientVersionDifferentOk(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
Utility.reloadSWFOrGetIp(true,false);
|
||||
}
|
||||
|
||||
public static function showNewChrPopup() : void
|
||||
{
|
||||
hideNotifyPopup();
|
||||
trackUserCreateAccountPageChange("ChooseAnimal");
|
||||
trackUserCreateAccountPageChange("currentLanguage",LocalizationManager.currentLanguage);
|
||||
}
|
||||
|
||||
public static function showLoginCreateResultMsg(param1:int) : void
|
||||
{
|
||||
var _loc2_:int = -1;
|
||||
switch(param1)
|
||||
{
|
||||
case -1:
|
||||
default:
|
||||
_loc2_ = 11149;
|
||||
break;
|
||||
case -2:
|
||||
_loc2_ = 11150;
|
||||
break;
|
||||
case -3:
|
||||
_loc2_ = 11148;
|
||||
break;
|
||||
case -4:
|
||||
_loc2_ = 11151;
|
||||
break;
|
||||
case -5:
|
||||
_loc2_ = 11152;
|
||||
break;
|
||||
case -101:
|
||||
_loc2_ = 37556;
|
||||
break;
|
||||
case -6:
|
||||
_loc2_ = 11153;
|
||||
break;
|
||||
case -10:
|
||||
_loc2_ = 11157;
|
||||
break;
|
||||
case -11:
|
||||
_loc2_ = 11158;
|
||||
break;
|
||||
case -12:
|
||||
_loc2_ = 11159;
|
||||
break;
|
||||
case -13:
|
||||
_loc2_ = 11160;
|
||||
break;
|
||||
case -16:
|
||||
_loc2_ = 11161;
|
||||
break;
|
||||
case -98:
|
||||
_loc2_ = 11162;
|
||||
break;
|
||||
case -99:
|
||||
_loc2_ = 11163;
|
||||
break;
|
||||
case -100:
|
||||
_loc2_ = 11164;
|
||||
}
|
||||
if(_loc2_ != -1)
|
||||
{
|
||||
_loginAssets.notifyPopup.notifyTxt.borderColor = 0;
|
||||
_loginAssets.notifyPopup.notifyTxt.y = 0;
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,_loc2_);
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.titleTxt,oopsTitleStr);
|
||||
_loginAssets.notifyPopup.visible = true;
|
||||
}
|
||||
if(loginCreateGuiCallback != null)
|
||||
{
|
||||
loginCreateGuiCallback();
|
||||
}
|
||||
}
|
||||
|
||||
public static function loginCreateSuccess(param1:int) : void
|
||||
{
|
||||
trackUserCreateAccountPageChange("CreateAndLogin",param1);
|
||||
_login.logInNewAccountDone();
|
||||
}
|
||||
|
||||
public static function showUsernameExistsMsg(param1:int = -10, param2:Boolean = true) : void
|
||||
{
|
||||
_loginAssets.notifyPopup.notifyTxt.borderColor = 0;
|
||||
_loginAssets.notifyPopup.notifyTxt.y = 0;
|
||||
if(param1 == -3)
|
||||
{
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,11148);
|
||||
}
|
||||
else
|
||||
{
|
||||
param2 ? LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,11168) : LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,11169);
|
||||
}
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.titleTxt,oopsTitleStr);
|
||||
_loginAssets.notifyPopup.visible = true;
|
||||
if(loginCreateGuiCallback != null)
|
||||
{
|
||||
loginCreateGuiCallback();
|
||||
}
|
||||
}
|
||||
|
||||
public static function showNewPasswordBadMsg(param1:int = -1) : void
|
||||
{
|
||||
if(param1 == -16)
|
||||
{
|
||||
LocalizationManager.translateId(_notifyPopup.notifyTxt,11161);
|
||||
}
|
||||
else if(param1 == -5)
|
||||
{
|
||||
LocalizationManager.translateId(_notifyPopup.notifyTxt,11152);
|
||||
}
|
||||
else if(param1 == -101)
|
||||
{
|
||||
LocalizationManager.translateId(_notifyPopup.notifyTxt,37556);
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalizationManager.translateId(_notifyPopup.notifyTxt,11170);
|
||||
}
|
||||
LocalizationManager.translateId(_notifyPopup.titleTxt,oopsTitleStr);
|
||||
_notifyPopup.visible = true;
|
||||
}
|
||||
|
||||
public static function showTipsPopup(param1:Boolean) : void
|
||||
{
|
||||
_loginAssets.tipsPopup.visible = param1;
|
||||
}
|
||||
|
||||
public static function showMustAgreeMsg() : void
|
||||
{
|
||||
_loginAssets.notifyPopup.notifyTxt.borderColor = 0;
|
||||
_loginAssets.notifyPopup.notifyTxt.y = 0;
|
||||
LocalizationManager.translateId(_notifyPopup.notifyTxt,11172);
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.titleTxt,oopsTitleStr);
|
||||
_notifyPopup.visible = true;
|
||||
}
|
||||
|
||||
public static function showMustConfirmMsg() : void
|
||||
{
|
||||
_loginAssets.notifyPopup.notifyTxt.borderColor = 0;
|
||||
_loginAssets.notifyPopup.notifyTxt.y = 0;
|
||||
LocalizationManager.translateId(_notifyPopup.notifyTxt,11173);
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.titleTxt,oopsTitleStr);
|
||||
_notifyPopup.visible = true;
|
||||
}
|
||||
|
||||
public static function avatarNameValidateCallback(param1:int) : void
|
||||
{
|
||||
if(param1 == 1)
|
||||
{
|
||||
hideNotifyPopup();
|
||||
}
|
||||
else
|
||||
{
|
||||
showAvNameExistsMsg(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function showAvNameExistsMsg(param1:int = -10) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_loginAssets.notifyPopup.notifyTxt.borderColor = 0;
|
||||
_loginAssets.notifyPopup.notifyTxt.y = 0;
|
||||
if(param1 == -3)
|
||||
{
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,11174);
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.notifyTxt,11175);
|
||||
}
|
||||
LocalizationManager.translateId(_loginAssets.notifyPopup.titleTxt,oopsTitleStr);
|
||||
_loginAssets.notifyPopup.visible = true;
|
||||
}
|
||||
|
||||
public static function hideUsernameExistsMsg() : void
|
||||
{
|
||||
if(_loginAssets.playerTagScreen)
|
||||
{
|
||||
_loginAssets.playerTagScreen.enableNext();
|
||||
}
|
||||
hideNotifyPopup();
|
||||
}
|
||||
|
||||
public static function showTypeSelectAvatars() : void
|
||||
{
|
||||
LoadProgress.show(false);
|
||||
}
|
||||
|
||||
public static function trackUserCreateAccountPageChange(param1:String, param2:int = -1, param3:int = 0) : void
|
||||
{
|
||||
if(param2 == -1)
|
||||
{
|
||||
SBTracker.trackPageview("/login/" + param1,0,param3);
|
||||
}
|
||||
else
|
||||
{
|
||||
SBTracker.trackPageview("/login/" + param1 + "##0#" + param2,0,param3);
|
||||
}
|
||||
}
|
||||
|
||||
public static function clearAvatarSwitchAddCallback() : void
|
||||
{
|
||||
AvatarSwitch.addAvatarCallback = null;
|
||||
}
|
||||
|
||||
public static function loadCreationVoSounds(param1:Function, param2:Object) : void
|
||||
{
|
||||
if(param2 == null)
|
||||
{
|
||||
param2 = {"callback":param1};
|
||||
}
|
||||
else
|
||||
{
|
||||
param2.callback = param1;
|
||||
}
|
||||
LoadAvatarCarouselResourceStackable.loadVOSounds(setupVOSounds,param2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
package createAccountFlow
|
||||
{
|
||||
import com.sbi.client.SFEvent;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class CreateAccountXtCommManager
|
||||
{
|
||||
|
||||
public static const LOGINAVAILABLE_TYPE_USERNAME:int = 0;
|
||||
|
||||
public static const LOGINAVAILABLE_TYPE_AVATARNAME:int = 1;
|
||||
|
||||
public static const LOGINAVAILABLE_TYPE_SUGGESTIONS:int = 2;
|
||||
|
||||
public static var logIn:CreateAccount;
|
||||
|
||||
private static var _laReturnType:int;
|
||||
|
||||
public function CreateAccountXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init(param1:CreateAccount) : void
|
||||
{
|
||||
logIn = param1;
|
||||
_laReturnType = -1;
|
||||
XtReplyDemuxer.addModule(handleXtReply,"l");
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
XtReplyDemuxer.removeModule(handleXtReply);
|
||||
}
|
||||
|
||||
public static function sendLoginAvailableRequest(param1:int, param2:String, param3:int, param4:int, param5:int) : void
|
||||
{
|
||||
_laReturnType = param1;
|
||||
gMainFrame.server.setXtObject_Str("la",[param1,param2,param3,LocalizationManager.isCurrLanguageReversed() ? param5 : param4,LocalizationManager.isCurrLanguageReversed() ? param4 : param5,LocalizationManager.currentLanguage,gMainFrame.clientInfo.deployVersion],false);
|
||||
}
|
||||
|
||||
public static function sendLoginMXLookup(param1:String, param2:Boolean = true) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("le",[param1,gMainFrame.clientInfo.deployVersion,param2 ? "1" : "0"],false);
|
||||
}
|
||||
|
||||
public static function sendLoginCreateRequest(param1:Array, param2:Array) : void
|
||||
{
|
||||
var _loc5_:int = 0;
|
||||
var _loc3_:int = 2;
|
||||
var _loc4_:Array = [param1[_loc5_++],param1[_loc5_++],param1[_loc5_++],param1[_loc5_++],param1[_loc5_++],param2[_loc3_++],param2[_loc3_++],param2[_loc3_++],param2[_loc3_++],LocalizationManager.accountLanguage,gMainFrame.clientInfo.countryCode,gMainFrame.clientInfo.deployVersion];
|
||||
if(gMainFrame.clientInfo.refererUuid != null && gMainFrame.clientInfo.refererUuid != "")
|
||||
{
|
||||
_loc4_.push(gMainFrame.clientInfo.refererUuid);
|
||||
}
|
||||
_loc3_ += 4;
|
||||
if(_loc5_ != param1.length)
|
||||
{
|
||||
throw new Error("Expected end of loginCreate data array lcdi:" + _loc5_ + " did not match length:" + param1.length + "!");
|
||||
}
|
||||
if(_loc3_ != param2.length)
|
||||
{
|
||||
throw new Error("Expected end of loginNew data array lndi:" + _loc3_ + " did not match length:" + param2.length + "!");
|
||||
}
|
||||
gMainFrame.server.setXtObject_Str("lc",_loc4_,gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
public static function sendLoginNewRequest(param1:Array) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:Array = [param1[_loc3_++],param1[_loc3_++],param1[_loc3_++],param1[_loc3_++],param1[_loc3_++],param1[_loc3_++]];
|
||||
var _loc4_:Array = param1[_loc3_++];
|
||||
if(_loc3_ != param1.length)
|
||||
{
|
||||
throw new Error("Expected end of loginNew data array lndi:" + _loc3_ + " did not match length:" + param1.length + "!");
|
||||
}
|
||||
loginNewAvatarHelper(_loc4_,_loc2_);
|
||||
gMainFrame.server.setXtObject_Str("ln",_loc2_,gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
private static function loginNewAvatarHelper(param1:Array, param2:Array) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:int = int(param1.length);
|
||||
param2.push(_loc4_);
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _loc4_)
|
||||
{
|
||||
param2.push(param1[_loc3_].defId);
|
||||
_loc3_++;
|
||||
}
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:Array = param1.obj;
|
||||
DebugUtility.debugTrace("data:" + _loc2_);
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "la":
|
||||
logIn.handleLoginAvailable(_loc2_,_laReturnType);
|
||||
break;
|
||||
case "lc":
|
||||
logIn.handleLoginCreate(_loc2_);
|
||||
break;
|
||||
default:
|
||||
throw new Error("LogIn illegal data:" + _loc2_[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user