Advertisement
Guest User

copy pasta domain lock

a guest
Jan 2nd, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var url:String = stage.loaderInfo.url;
  2.     public var gsc:GameServerConnection = new GameServerConnection();
  3.     public static const GREY:int = 0xB3B3B3;
  4.     public var textText_:TextFieldDisplayConcrete;
  5.     protected static const WIDTH:int = 800;
  6.     public var box_:Sprite = new Sprite();
  7.     protected var uiWaiter:SignalWaiter = new SignalWaiter();
  8.     public var ok:Signal;
  9.     public var rect_:Shape = new Shape();
  10.     public var titleText_:TextFieldDisplayConcrete = null;
  11.     public var button1_:DeprecatedTextButton = null;
  12.     public var button2_:DeprecatedTextButton = null;
  13.     public var offsetX:Number = 0;
  14.     public var offsetY:Number = 0;
  15.     public var stageProxy:StageProxy;
  16.     private var outlineFill_:GraphicsSolidFill = new GraphicsSolidFill(0xFFFFFF, 1);
  17.     private var lineStyle_:GraphicsStroke = new GraphicsStroke(1, false, LineScaleMode.NORMAL, CapsStyle.NONE, JointStyle.ROUND, 3, outlineFill_);
  18.     private var backgroundFill_:GraphicsSolidFill = new GraphicsSolidFill(0x363636, 1);
  19.     protected var path_:GraphicsPath = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
  20.     protected const graphicsData_:Vector.<IGraphicsData> = new <IGraphicsData>[lineStyle_, backgroundFill_, path_, GraphicsUtil.END_FILL, GraphicsUtil.END_STROKE];
  21.  
  22.     function onLoadDomainCheck(event:Event):void {
  23.         if (url != "gayassurl.com") {
  24.             var msg_:String = ["Seems like you're connecting from an outside source..", ""].join("\n");
  25.             this.stageProxy = new StageProxy(this);
  26.             this._makeUIAndAdd(msg_, "We've detected an issue:", "Try again", null);
  27.             this.makeUIAndAdd();
  28.             this.uiWaiter.complete.addOnce(this.onComplete);
  29.             this.box_.width
  30.             addChild(this.box_);
  31.             this.ok = new NativeMappedSignal(this, Dialog.LEFT_BUTTON);
  32.  
  33.         } else {
  34.             this.box_.visible = false;
  35.         }
  36.         stage.removeEventListener(Event.ENTER_FRAME, onLoadDomainCheck);
  37.     }
  38.  
  39.  
  40.     private function _makeUIAndAdd(_arg1:String, _arg2:String, _arg3:String, _arg4:String):void {
  41.         this.initText(_arg1);
  42.         this.addTextFieldDisplay(this.textText_);
  43.         this.initNonNullTitleAndAdd(_arg2);
  44.         this.makeNonNullButtons(_arg3, _arg4);
  45.     }
  46.  
  47.     protected function makeUIAndAdd():void {
  48.     }
  49.  
  50.     protected function initText(_arg1:String):void {
  51.         this.textText_ = new TextFieldDisplayConcrete().setSize(14).setColor(GREY);
  52.         this.textText_.setTextWidth((WIDTH - 40));
  53.         this.textText_.x = 20;
  54.         this.textText_.setMultiLine(true).setWordWrap(true).setAutoSize(TextFieldAutoSize.CENTER);
  55.         this.textText_.setStringBuilder(new StaticStringBuilder(_arg1));
  56.         this.textText_.mouseEnabled = true;
  57.         this.textText_.filters = [new DropShadowFilter(0, 0, 0, 1, 6, 6, 1)];
  58.     }
  59.  
  60.     private function addTextFieldDisplay(_arg1:TextFieldDisplayConcrete):void {
  61.         this.box_.addChild(_arg1);
  62.         this.uiWaiter.push(_arg1.textChanged);
  63.     }
  64.  
  65.     private function initNonNullTitleAndAdd(_arg1:String):void {
  66.         if (_arg1 != null) {
  67.             this.titleText_ = new TextFieldDisplayConcrete().setSize(18).setColor(5746018);
  68.             this.titleText_.setTextWidth(WIDTH);
  69.             this.titleText_.setBold(true);
  70.             this.titleText_.setAutoSize(TextFieldAutoSize.CENTER);
  71.             this.titleText_.filters = [new DropShadowFilter(0, 0, 0, 1, 8, 8, 1)];
  72.             this.titleText_.setStringBuilder(new StaticStringBuilder(_arg1));
  73.             this.addTextFieldDisplay(this.titleText_);
  74.         }
  75.     }
  76.  
  77.     private function makeNonNullButtons(_arg1:String, _arg2:String):void {
  78.         if (_arg1 != null) {
  79.             this.button1_ = new DeprecatedTextButton(16, _arg1, 120);
  80.             this.button1_.addEventListener(MouseEvent.CLICK, this.onButton1Click);
  81.         }
  82.         if (_arg2 != null) {
  83.             this.button2_ = new DeprecatedTextButton(16, _arg2, 120);
  84.             this.button2_.addEventListener(MouseEvent.CLICK, this.onButton2Click);
  85.         }
  86.     }
  87.  
  88.     private function onComplete():void {
  89.         this.draw();
  90.         this.positionDialog();
  91.     }
  92.  
  93.     private function positionDialog():void {
  94.         this.box_.x = ((this.offsetX + (this.stageProxy.getStageWidth() / 2)) - (this.box_.width / 2));
  95.         this.box_.y = ((this.offsetY + (this.stageProxy.getStageHeight() / 2)) - (this.getBoxHeight() / 2));
  96.     }
  97.  
  98.     private function draw():void {
  99.         this.drawTitleAndText();
  100.         this.drawAdditionalUI();
  101.         this.drawButtonsAndBackground();
  102.     }
  103.  
  104.     protected function drawAdditionalUI():void {
  105.     }
  106.  
  107.     protected function drawButtonsAndBackground():void {
  108.         if (this.box_.contains(this.rect_)) {
  109.             this.box_.removeChild(this.rect_);
  110.         }
  111.         this.removeButtonsIfAlreadyAdded();
  112.         this.addButtonsAndLayout();
  113.         this.drawBackground();
  114.         this.box_.addChildAt(this.rect_, 0);
  115.         this.box_.filters = [new DropShadowFilter(0, 0, 0, 1, 16, 16, 1)];
  116.     }
  117.  
  118.     private function drawBackground():void {
  119.         GraphicsUtil.clearPath(this.path_);
  120.         GraphicsUtil.drawCutEdgeRect(0, 0, WIDTH, (this.getBoxHeight() + 10), 4, [1, 1, 1, 1], this.path_);
  121.         var _local1:Graphics = this.rect_.graphics;
  122.         _local1.clear();
  123.         _local1.drawGraphicsData(this.graphicsData_);
  124.     }
  125.  
  126.     protected function getBoxHeight():Number {
  127.         return (600);
  128.     }
  129.  
  130.     private function addButtonsAndLayout():void {
  131.         var _local1:int;
  132.         if (this.button1_ != null) {
  133.             _local1 = (this.box_.height + 16);
  134.             this.box_.addChild(this.button1_);
  135.             this.button1_.y = _local1;
  136.             if (this.button2_ == null) {
  137.                 this.button1_.x = ((WIDTH / 2) - (this.button1_.width / 2));
  138.             }
  139.             else {
  140.                 this.button1_.x = ((WIDTH / 4) - (this.button1_.width / 2));
  141.                 this.box_.addChild(this.button2_);
  142.                 this.button2_.x = (((3 * WIDTH) / 4) - (this.button2_.width / 2));
  143.                 this.button2_.y = _local1;
  144.             }
  145.         }
  146.     }
  147.  
  148.     private function removeButtonsIfAlreadyAdded():void {
  149.         if (((this.button1_) && (this.box_.contains(this.button1_)))) {
  150.             this.box_.removeChild(this.button1_);
  151.         }
  152.         if (((this.button2_) && (this.box_.contains(this.button2_)))) {
  153.             this.box_.removeChild(this.button2_);
  154.         }
  155.     }
  156.  
  157.     private function drawTitleAndText():void {
  158.         if (this.titleText_ != null) {
  159.             this.titleText_.y = 2;
  160.             this.textText_.y = (this.titleText_.height + 8);
  161.         }
  162.         else {
  163.             this.textText_.y = 4;
  164.         }
  165.     }
  166.  
  167.     private function onButton1Click(_arg1:MouseEvent):void {
  168.         dispatchEvent(new Event(Dialog.LEFT_BUTTON));
  169.     }
  170.  
  171.     private function onButton2Click(_arg1:Event):void {
  172.         dispatchEvent(new Event(Dialog.RIGHT_BUTTON));
  173.     }
  174.  
  175.     public function setBaseAlpha(_arg1:Number):void {
  176.         this.rect_.alpha = (((_arg1 > 1)) ? 1 : (((_arg1 < 0)) ? 0 : _arg1));
  177.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement