mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -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,235 @@
|
||||
package gameRedemption
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Loader;
|
||||
import flash.display.LoaderInfo;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.net.URLRequest;
|
||||
import gui.DarkenManager;
|
||||
import gui.GuiManager;
|
||||
import loader.MediaHelper;
|
||||
|
||||
public class CaptchaPopup
|
||||
{
|
||||
|
||||
private const POPUP_MEDIA_ID:int = 4821;
|
||||
|
||||
private var _closeCallback:Function;
|
||||
|
||||
private var _guiLayer:DisplayLayer;
|
||||
|
||||
private var _mediaHelper:MediaHelper;
|
||||
|
||||
private var _captchaPopup:MovieClip;
|
||||
|
||||
private var _itemWindow0:MovieClip;
|
||||
|
||||
private var _itemWindow1:MovieClip;
|
||||
|
||||
private var _itemWindow2:MovieClip;
|
||||
|
||||
private var _itemWindow3:MovieClip;
|
||||
|
||||
private var _itemLayer:MovieClip;
|
||||
|
||||
private var _closeBtn:MovieClip;
|
||||
|
||||
private var _options:Array;
|
||||
|
||||
private var _question:String;
|
||||
|
||||
private var _chosenAnswer:String;
|
||||
|
||||
public function CaptchaPopup()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:String, param2:Array, param3:Function) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
_question = param1;
|
||||
_options = param2;
|
||||
_closeCallback = param3;
|
||||
_guiLayer = GuiManager.guiLayer;
|
||||
_chosenAnswer = "";
|
||||
_mediaHelper = new MediaHelper();
|
||||
_mediaHelper.init(4821,onRedemptionPopupLoaded);
|
||||
}
|
||||
|
||||
public function destroy(param1:Boolean = false) : void
|
||||
{
|
||||
var _loc2_:Function = null;
|
||||
if(_closeCallback != null)
|
||||
{
|
||||
_loc2_ = _closeCallback;
|
||||
_closeCallback = null;
|
||||
if(_chosenAnswer != null && _chosenAnswer != "")
|
||||
{
|
||||
_chosenAnswer = _chosenAnswer.match(/.*images\/\s*([^\n\r]*)/)[1];
|
||||
_question = _question.match(/.*images\/\s*([^\n\r]*)/)[1];
|
||||
}
|
||||
_loc2_(param1,_question,_chosenAnswer);
|
||||
_loc2_ = null;
|
||||
return;
|
||||
}
|
||||
if(_mediaHelper)
|
||||
{
|
||||
_mediaHelper.destroy();
|
||||
_mediaHelper = null;
|
||||
}
|
||||
if(_captchaPopup)
|
||||
{
|
||||
removeEventListeners();
|
||||
DarkenManager.unDarken(_captchaPopup);
|
||||
_guiLayer.removeChild(_captchaPopup);
|
||||
}
|
||||
_guiLayer = null;
|
||||
_captchaPopup = null;
|
||||
}
|
||||
|
||||
private function onRedemptionPopupLoaded(param1:MovieClip) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_captchaPopup = param1.getChildAt(0) as MovieClip;
|
||||
_captchaPopup.x = 900 * 0.5;
|
||||
_captchaPopup.y = 550 * 0.5;
|
||||
_guiLayer.addChild(_captchaPopup);
|
||||
DarkenManager.darken(_captchaPopup);
|
||||
_itemWindow0 = _captchaPopup.iw0;
|
||||
_itemWindow1 = _captchaPopup.iw1;
|
||||
_itemWindow2 = _captchaPopup.iw2;
|
||||
_itemWindow3 = _captchaPopup.iw3;
|
||||
_itemLayer = _captchaPopup.itemBlock;
|
||||
_closeBtn = _captchaPopup.bx;
|
||||
setupQuestionAndAnswers();
|
||||
addEventListeners();
|
||||
}
|
||||
|
||||
private function setupQuestionAndAnswers() : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:Loader = new Loader();
|
||||
_loc2_.contentLoaderInfo.addEventListener("init",onLoaderInit);
|
||||
var _loc1_:URLRequest = new URLRequest(_question);
|
||||
_loc2_.load(_loc1_);
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < 4)
|
||||
{
|
||||
_loc2_ = new Loader();
|
||||
_loc2_.contentLoaderInfo.addEventListener("init",onLoaderInit);
|
||||
_loc1_ = new URLRequest(_options[_loc3_]);
|
||||
_loc2_.load(_loc1_);
|
||||
_loc3_++;
|
||||
}
|
||||
}
|
||||
|
||||
private function addEventListeners() : void
|
||||
{
|
||||
_captchaPopup.addEventListener("mouseDown",onPopup,false,0,true);
|
||||
_closeBtn.addEventListener("mouseDown",onCloseBtn,false,0,true);
|
||||
_itemWindow0.addEventListener("mouseDown",startDragging,true,0,true);
|
||||
_itemWindow1.addEventListener("mouseDown",startDragging,true,0,true);
|
||||
_itemWindow2.addEventListener("mouseDown",startDragging,true,0,true);
|
||||
_itemWindow3.addEventListener("mouseDown",startDragging,true,0,true);
|
||||
_itemWindow0.addEventListener("mouseUp",stopDragging,true,0,true);
|
||||
_itemWindow1.addEventListener("mouseUp",stopDragging,true,0,true);
|
||||
_itemWindow2.addEventListener("mouseUp",stopDragging,true,0,true);
|
||||
_itemWindow3.addEventListener("mouseUp",stopDragging,true,0,true);
|
||||
}
|
||||
|
||||
private function removeEventListeners() : void
|
||||
{
|
||||
_captchaPopup.removeEventListener("mouseDown",onPopup);
|
||||
_closeBtn.removeEventListener("mouseDown",onCloseBtn);
|
||||
_itemWindow0.removeEventListener("mouseDown",startDragging);
|
||||
_itemWindow1.removeEventListener("mouseDown",startDragging);
|
||||
_itemWindow2.removeEventListener("mouseDown",startDragging);
|
||||
_itemWindow3.removeEventListener("mouseDown",startDragging);
|
||||
_itemWindow0.removeEventListener("mouseUp",stopDragging);
|
||||
_itemWindow1.removeEventListener("mouseUp",stopDragging);
|
||||
_itemWindow2.removeEventListener("mouseUp",stopDragging);
|
||||
_itemWindow3.removeEventListener("mouseUp",stopDragging);
|
||||
}
|
||||
|
||||
private function onPopup(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
|
||||
private function onCloseBtn(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
destroy(true);
|
||||
}
|
||||
|
||||
private function startDragging(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(!param1.currentTarget.startX)
|
||||
{
|
||||
param1.currentTarget.startX = param1.currentTarget.x;
|
||||
param1.currentTarget.startY = param1.currentTarget.y;
|
||||
}
|
||||
param1.currentTarget.startDrag();
|
||||
}
|
||||
|
||||
private function stopDragging(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
(param1.currentTarget as MovieClip).stopDrag();
|
||||
if((param1.currentTarget as MovieClip).hitTestObject(_itemLayer))
|
||||
{
|
||||
_chosenAnswer = _options[(param1.currentTarget.name as String).substring(2)];
|
||||
destroy();
|
||||
}
|
||||
else if(param1.currentTarget.startX)
|
||||
{
|
||||
param1.currentTarget.x = param1.currentTarget.startX;
|
||||
param1.currentTarget.y = param1.currentTarget.startY;
|
||||
}
|
||||
}
|
||||
|
||||
private function onLoaderInit(param1:Event) : void
|
||||
{
|
||||
var _loc2_:DisplayObject = null;
|
||||
var _loc4_:Sprite = null;
|
||||
var _loc3_:int = 0;
|
||||
var _loc5_:LoaderInfo = param1.target as LoaderInfo;
|
||||
try
|
||||
{
|
||||
_loc2_ = _loc5_.loader.content;
|
||||
}
|
||||
catch(err:SecurityError)
|
||||
{
|
||||
_loc4_ = new Sprite();
|
||||
_loc4_.addChild(_loc5_.loader);
|
||||
_loc2_ = _loc4_ as DisplayObject;
|
||||
}
|
||||
if(_loc5_.url == _question)
|
||||
{
|
||||
_loc2_.x -= _itemLayer.width * 0.5;
|
||||
_loc2_.y -= _itemLayer.height * 0.5;
|
||||
_itemLayer.addChild(_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _options.length)
|
||||
{
|
||||
if(_loc5_.url == _options[_loc3_])
|
||||
{
|
||||
_loc2_.x -= this["_itemWindow" + _loc3_].width * 0.5;
|
||||
_loc2_.y -= this["_itemWindow" + _loc3_].height * 0.5;
|
||||
this["_itemWindow" + _loc3_].addChild(_loc2_);
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
package gameRedemption
|
||||
{
|
||||
import com.sbi.popup.SBOkPopup;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.events.KeyboardEvent;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.text.TextField;
|
||||
import gui.DarkenManager;
|
||||
import gui.GuiManager;
|
||||
import loader.MediaHelper;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class CodeRedemptionPopup
|
||||
{
|
||||
|
||||
private const POPUP_MEDIA_ID:int = 4625;
|
||||
|
||||
private const HELP_POPUP_MEDIA_ID:int = 4628;
|
||||
|
||||
private var _mediaHelper:MediaHelper;
|
||||
|
||||
private var _closeCallback:Function;
|
||||
|
||||
private var _guiLayer:DisplayLayer;
|
||||
|
||||
private var _redemptionPopup:MovieClip;
|
||||
|
||||
private var _closeBtn:MovieClip;
|
||||
|
||||
private var _continueBtn:MovieClip;
|
||||
|
||||
private var _codeInput:TextField;
|
||||
|
||||
private var _helpBtn:MovieClip;
|
||||
|
||||
private var _helpPopup:MovieClip;
|
||||
|
||||
private var _captchaPopup:CaptchaPopup;
|
||||
|
||||
private var _chosenCaptchaAnswer:String;
|
||||
|
||||
private var _captchaQuestion:String;
|
||||
|
||||
public function CodeRedemptionPopup()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:Function) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
_closeCallback = param1;
|
||||
_guiLayer = GuiManager.guiLayer;
|
||||
_mediaHelper = new MediaHelper();
|
||||
_mediaHelper.init(4625,onRedemptionPopupLoaded);
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
var _loc1_:Function = null;
|
||||
if(_closeCallback != null)
|
||||
{
|
||||
_loc1_ = _closeCallback;
|
||||
_closeCallback = null;
|
||||
_loc1_();
|
||||
_loc1_ = null;
|
||||
return;
|
||||
}
|
||||
if(_mediaHelper)
|
||||
{
|
||||
_mediaHelper.destroy();
|
||||
_mediaHelper = null;
|
||||
}
|
||||
if(_redemptionPopup)
|
||||
{
|
||||
removeEventListeners();
|
||||
DarkenManager.unDarken(_redemptionPopup);
|
||||
_guiLayer.removeChild(_redemptionPopup);
|
||||
}
|
||||
if(_helpPopup)
|
||||
{
|
||||
removeHelpPopupEventListeners();
|
||||
DarkenManager.unDarken(_helpPopup);
|
||||
_guiLayer.removeChild(_helpPopup);
|
||||
_helpPopup = null;
|
||||
}
|
||||
_guiLayer = null;
|
||||
_redemptionPopup = null;
|
||||
}
|
||||
|
||||
private function loadHelpPopup() : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
_mediaHelper = new MediaHelper();
|
||||
_mediaHelper.init(4628,onHelpPopupLoaded);
|
||||
}
|
||||
|
||||
private function onRedemptionPopupLoaded(param1:MovieClip) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_redemptionPopup = param1.getChildAt(0) as MovieClip;
|
||||
_redemptionPopup.x = 900 * 0.5;
|
||||
_redemptionPopup.y = 550 * 0.5;
|
||||
_guiLayer.addChild(_redemptionPopup);
|
||||
DarkenManager.darken(_redemptionPopup);
|
||||
_closeBtn = _redemptionPopup.bx;
|
||||
_continueBtn = _redemptionPopup.continueBtn;
|
||||
_codeInput = _redemptionPopup.codeTxt;
|
||||
_codeInput.restrict = "A-Za-z0-9\\-";
|
||||
_helpBtn = _redemptionPopup.helpBtn;
|
||||
if(gMainFrame.clientInfo.redemptionCode != undefined && gMainFrame.clientInfo.redemptionCode.length > 0)
|
||||
{
|
||||
_codeInput.text = gMainFrame.clientInfo.redemptionCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
_continueBtn.activateGrayState(true);
|
||||
}
|
||||
gMainFrame.stage.focus = _codeInput;
|
||||
_codeInput.setSelection(_codeInput.text.length,_codeInput.text.length);
|
||||
addEventListeners();
|
||||
}
|
||||
|
||||
private function onHelpPopupLoaded(param1:MovieClip) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_helpPopup = param1.getChildAt(0) as MovieClip;
|
||||
_helpPopup.x = 900 * 0.5;
|
||||
_helpPopup.y = 550 * 0.5;
|
||||
_guiLayer.addChild(_helpPopup);
|
||||
DarkenManager.unDarken(_redemptionPopup);
|
||||
DarkenManager.darken(_helpPopup);
|
||||
addHelpPopupEventListeners();
|
||||
}
|
||||
|
||||
private function addEventListeners() : void
|
||||
{
|
||||
gMainFrame.stage.addEventListener("keyDown",onKeyDown,false,0,true);
|
||||
_redemptionPopup.addEventListener("mouseDown",onPopup,false,0,true);
|
||||
_closeBtn.addEventListener("mouseDown",onCloseBtn,false,0,true);
|
||||
_continueBtn.addEventListener("mouseDown",onContinueBtn,false,0,true);
|
||||
_codeInput.addEventListener("change",onCodeInputChange,false,0,true);
|
||||
_helpBtn.addEventListener("mouseDown",onHelpBtn,false,0,true);
|
||||
}
|
||||
|
||||
private function addHelpPopupEventListeners() : void
|
||||
{
|
||||
_helpPopup.addEventListener("mouseDown",onPopup,false,0,true);
|
||||
_helpPopup.bx.addEventListener("mouseDown",onHelpClose,false,0,true);
|
||||
}
|
||||
|
||||
private function removeEventListeners() : void
|
||||
{
|
||||
gMainFrame.stage.removeEventListener("keyDown",onKeyDown);
|
||||
_redemptionPopup.removeEventListener("mouseDown",onPopup);
|
||||
_closeBtn.removeEventListener("mouseDown",onCloseBtn);
|
||||
_continueBtn.removeEventListener("mouseDown",onContinueBtn);
|
||||
_codeInput.removeEventListener("change",onCodeInputChange);
|
||||
_helpBtn.removeEventListener("mouseDown",onHelpBtn);
|
||||
}
|
||||
|
||||
private function removeHelpPopupEventListeners() : void
|
||||
{
|
||||
_helpPopup.removeEventListener("mouseDown",onPopup);
|
||||
_helpPopup.bx.removeEventListener("mouseDown",onHelpClose);
|
||||
}
|
||||
|
||||
private function onPopup(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
|
||||
private function onCloseBtn(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
destroy();
|
||||
}
|
||||
|
||||
private function onContinueBtn(param1:MouseEvent) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
if(!_continueBtn.isGray && _codeInput.length > 0)
|
||||
{
|
||||
if(GameRedemptionXtCommManager.captchaToShowData != null)
|
||||
{
|
||||
_captchaPopup = new CaptchaPopup();
|
||||
_captchaPopup.init(GameRedemptionXtCommManager.captchaToShowData.question,GameRedemptionXtCommManager.captchaToShowData.options,onCaptchaClose);
|
||||
}
|
||||
else
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
GameRedemptionXtCommManager.requestRedeemCode(_codeInput.text,_captchaQuestion,_chosenCaptchaAnswer,onCodeRedeemResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function onCodeInputChange(param1:Event) : void
|
||||
{
|
||||
if(_codeInput.length <= 0)
|
||||
{
|
||||
_continueBtn.activateGrayState(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_continueBtn.activateGrayState(false);
|
||||
}
|
||||
}
|
||||
|
||||
private function onHelpBtn(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(_helpPopup)
|
||||
{
|
||||
_helpPopup.visible = true;
|
||||
DarkenManager.unDarken(_redemptionPopup);
|
||||
DarkenManager.darken(_helpPopup);
|
||||
}
|
||||
else
|
||||
{
|
||||
loadHelpPopup();
|
||||
}
|
||||
}
|
||||
|
||||
private function onHelpClose(param1:MouseEvent) : void
|
||||
{
|
||||
_helpPopup.visible = false;
|
||||
DarkenManager.unDarken(_helpPopup);
|
||||
DarkenManager.darken(_redemptionPopup);
|
||||
}
|
||||
|
||||
private function onKeyDown(param1:KeyboardEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(param1.keyCode == 13)
|
||||
{
|
||||
onContinueBtn(null);
|
||||
}
|
||||
}
|
||||
|
||||
private function onCodeRedeemResponse(param1:String, param2:Object) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_captchaQuestion = "";
|
||||
_chosenCaptchaAnswer = "";
|
||||
switch(param1)
|
||||
{
|
||||
case "1":
|
||||
gMainFrame.clientInfo.redemptionCode = undefined;
|
||||
destroy();
|
||||
break;
|
||||
case "-3":
|
||||
GuiManager.initEmailConfirmation(null,null,true);
|
||||
break;
|
||||
case "-4":
|
||||
case "-5":
|
||||
new SBOkPopup(_guiLayer,LocalizationManager.translateIdOnly(25352));
|
||||
break;
|
||||
case "-6":
|
||||
GameRedemptionXtCommManager.captchaToShowData = param2;
|
||||
onContinueBtn(null);
|
||||
break;
|
||||
case "-7":
|
||||
GameRedemptionXtCommManager.captchaToShowData = param2;
|
||||
default:
|
||||
new SBOkPopup(_guiLayer,LocalizationManager.translateIdOnly(24878));
|
||||
}
|
||||
}
|
||||
|
||||
private function onCaptchaClose(param1:Boolean, param2:String, param3:String) : void
|
||||
{
|
||||
_captchaPopup.destroy();
|
||||
_captchaPopup = null;
|
||||
if(param3 != null && param3 != "")
|
||||
{
|
||||
_captchaQuestion = param2;
|
||||
_chosenCaptchaAnswer = param3;
|
||||
}
|
||||
GameRedemptionXtCommManager.captchaToShowData = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
package gameRedemption
|
||||
{
|
||||
import avatar.AvatarManager;
|
||||
import com.sbi.client.SFEvent;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.popup.SBOkPopup;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.geom.Point;
|
||||
import gui.GuiManager;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class GameRedemptionXtCommManager
|
||||
{
|
||||
|
||||
private static var _grcCallback:Function;
|
||||
|
||||
public static const RESPONSE_REDEEM_SUCCESS:String = "1";
|
||||
|
||||
public static const RESPONSE_CODE_NOT_VALID:String = "-1";
|
||||
|
||||
public static const RESPONSE_CODE_WRONG_GAME:String = "-2";
|
||||
|
||||
public static const RESPONSE_ACCOUNT_NOT_VERIFIED:String = "-3";
|
||||
|
||||
public static const RESPONSE_CAPTCHA_GET_LIMIT_EXCEEDED:String = "-4";
|
||||
|
||||
public static const RESPONSE_CAPTCHA_INCORRECT_ANSWER:String = "-5";
|
||||
|
||||
public static const RESPONSE_CAPTCHA_POST_SHOW_NOW:String = "-6";
|
||||
|
||||
public static const RESPONSE_CAPTCHA_POST_SHOW_ON_NEXT_REDEEM:String = "-7";
|
||||
|
||||
private static var _captchaToShow:Object;
|
||||
|
||||
private static var _hasAlternateDomains:Boolean;
|
||||
|
||||
private static var _additionalDomainsCallback:Function;
|
||||
|
||||
private static var _additionalDomainsPassback:Object;
|
||||
|
||||
public function GameRedemptionXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
XtReplyDemuxer.removeModule(handleXtReply);
|
||||
}
|
||||
|
||||
public static function requestRedeemCode(param1:String, param2:String, param3:String, param4:Function) : void
|
||||
{
|
||||
_grcCallback = param4;
|
||||
if(param2 == null || param3 == null)
|
||||
{
|
||||
param2 = param3 = "";
|
||||
}
|
||||
gMainFrame.server.setXtObject_Str("grc",[param1,param2,param3],gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
if(!param1.status)
|
||||
{
|
||||
DebugUtility.debugTrace("ERROR: GameRedemptionXtCommManager handleXtReply was called with bad evt.status:" + param1.status);
|
||||
return;
|
||||
}
|
||||
var _loc2_:Array = param1.obj;
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "grc":
|
||||
handleRedeemCodeResponse(_loc2_);
|
||||
break;
|
||||
case "grm":
|
||||
handleRedeemMembershipResponse(_loc2_);
|
||||
break;
|
||||
default:
|
||||
throw new Error("GameRedemptionXtCommManager illegal data:" + _loc2_[0]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function get captchaToShowData() : Object
|
||||
{
|
||||
return _captchaToShow;
|
||||
}
|
||||
|
||||
public static function set captchaToShowData(param1:Object) : void
|
||||
{
|
||||
_captchaToShow = param1;
|
||||
}
|
||||
|
||||
public static function checkIfHasGiftInOtherDomain(param1:Function, param2:Object = null) : void
|
||||
{
|
||||
if(_hasAlternateDomains)
|
||||
{
|
||||
_hasAlternateDomains = false;
|
||||
_additionalDomainsCallback = param1;
|
||||
_additionalDomainsPassback = param2;
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(28683,gMainFrame.userInfo.myUserName),true,onAdditionalDomainsOk);
|
||||
}
|
||||
else if(param1 != null)
|
||||
{
|
||||
if(param2 != null)
|
||||
{
|
||||
param1(param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
param1();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function onAdditionalDomainsOk(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
SBOkPopup.destroyInParentChain(param1.target.parent);
|
||||
if(_additionalDomainsCallback != null)
|
||||
{
|
||||
if(_additionalDomainsPassback != null)
|
||||
{
|
||||
_additionalDomainsCallback(_additionalDomainsPassback);
|
||||
}
|
||||
else
|
||||
{
|
||||
_additionalDomainsCallback();
|
||||
}
|
||||
}
|
||||
_additionalDomainsCallback = null;
|
||||
_additionalDomainsPassback = null;
|
||||
}
|
||||
|
||||
private static function handleRedeemCodeResponse(param1:Object) : void
|
||||
{
|
||||
var _loc3_:String = param1[2];
|
||||
var _loc2_:Object = param1[3] != null && param1[3] != "" ? JSON.parse(param1[3] as String) : null;
|
||||
_hasAlternateDomains = param1[4] != null && param1[4] == "1";
|
||||
if(_grcCallback != null)
|
||||
{
|
||||
_grcCallback(_loc3_,_loc2_);
|
||||
_grcCallback = null;
|
||||
}
|
||||
if(!gMainFrame.userInfo.needFastPass)
|
||||
{
|
||||
if(_loc3_ == "1")
|
||||
{
|
||||
GuiManager.setupInGameRedemptions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleRedeemMembershipResponse(param1:Object) : void
|
||||
{
|
||||
var _loc3_:Point = null;
|
||||
var _loc2_:Boolean = false;
|
||||
var _loc4_:int = int(param1[2]);
|
||||
if(_loc4_ == 1)
|
||||
{
|
||||
GuiManager.onExpiringPopupClose(null);
|
||||
gMainFrame.clientInfo.subscriptionSourceType = param1[5];
|
||||
_loc3_ = null;
|
||||
if(AvatarManager.avatarViewList && AvatarManager.playerAvatarWorldView)
|
||||
{
|
||||
_loc3_ = new Point(AvatarManager.playerAvatarWorldView.x,AvatarManager.playerAvatarWorldView.y);
|
||||
}
|
||||
gMainFrame.clientInfo.accountType = param1[3];
|
||||
_loc2_ = Boolean(gMainFrame.userInfo.isMember);
|
||||
gMainFrame.userInfo.isMember = Utility.isMember(gMainFrame.clientInfo.accountType);
|
||||
if(_loc2_ != gMainFrame.userInfo.isMember)
|
||||
{
|
||||
gMainFrame.clientInfo.accountTypeChanged = true;
|
||||
}
|
||||
gMainFrame.clientInfo.numDaysLeftOnSubscription = param1[4];
|
||||
gMainFrame.userInfo.clearPlayerAvatarInfoType();
|
||||
GuiManager.rebuildMainHud();
|
||||
if(_loc3_)
|
||||
{
|
||||
AvatarManager.loadSelfAssets(null,_loc3_.x,_loc3_.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user