Advertisement
Guest User

Untitled

a guest
May 15th, 2019
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.sulake.habbo.communication.messages.parser.room.engine
  2. {
  3.     import com.sulake.core.communication.messages.IMessageParser;
  4.     import com.sulake.habbo.communication.messages.incoming.room.engine.ObjectRolling;
  5.     import com.sulake.room.utils.Vector3d;
  6.     import com.sulake.core.communication.messages.IMessageDataWrapper;
  7.  
  8.     public class ObjectsRollingParser implements IMessageParser
  9.     {
  10.         private var _rollerId:int;
  11.         private var _itemsRolling:Array;
  12.         private var _avatar:ObjectRolling = null;
  13.  
  14.  
  15.         public function get id():int
  16.         {
  17.             return this._rollerId;
  18.         }
  19.  
  20.         public function get avatar():ObjectRolling
  21.         {
  22.             return this._avatar;
  23.         }
  24.  
  25.         public function get _Str_24284():Array
  26.         {
  27.             return this._itemsRolling;
  28.         }
  29.  
  30.         public function flush():Boolean
  31.         {
  32.             this._rollerId = -1;
  33.             this._avatar = null;
  34.             this._itemsRolling = [];
  35.             return true;
  36.         }
  37.  
  38.         public function parse(k:IMessageDataWrapper):Boolean
  39.         {
  40.             var _id:int;
  41.             var _local_8:ObjectRolling;
  42.             var _currentLocation:Vector3d;
  43.             var _nextLocation:Vector3d;
  44.             var _currentHeight:Number;
  45.             var _nextHeight:Number;
  46.             if (k == null)
  47.             {
  48.                 return false;
  49.             }
  50.             var _x:Number = k.readInteger();
  51.             var _y:Number = k.readInteger();
  52.             var _newX:Number = k.readInteger();
  53.             var _newY:Number = k.readInteger();
  54.             var _totalItems:int = k.readInteger();
  55.             this._itemsRolling = new Array();
  56.             var _totalItemsRead:int;
  57.             while (_totalItemsRead < _totalItems)
  58.             {
  59.                 _id = k.readInteger();
  60.                 _currentHeight = Number(k.readString());
  61.                 _nextHeight = Number(k.readString());
  62.                 _currentLocation = new Vector3d(_x, _y, _currentHeight);
  63.                 _nextLocation = new Vector3d(_newX, _newY, _nextHeight);
  64.                 _local_8 = new ObjectRolling(_id, _currentLocation, _nextLocation);
  65.                 this._itemsRolling.push(_local_8);
  66.                 _totalItemsRead++;
  67.             }
  68.             this._rollerId = k.readInteger();
  69.             if (!k.bytesAvailable)
  70.             {
  71.                 return true;
  72.             }
  73.             var _local_14:int = k.readInteger();
  74.             switch (_local_14)
  75.             {
  76.                 case 0:
  77.                     break;
  78.                 case 1:
  79.                     _id = k.readInteger();
  80.                     _currentHeight = Number(k.readString());
  81.                     _nextHeight = Number(k.readString());
  82.                     _currentLocation = new Vector3d(_x, _y, _currentHeight);
  83.                     _nextLocation = new Vector3d(_newX, _newY, _nextHeight);
  84.                     this._avatar = new ObjectRolling(_id, _currentLocation, _nextLocation, ObjectRolling.MV);
  85.                     break;
  86.                 case 2:
  87.                     _id = k.readInteger();
  88.                     _currentHeight = Number(k.readString());
  89.                     _nextHeight = Number(k.readString());
  90.                     _currentLocation = new Vector3d(_x, _y, _currentHeight);
  91.                     _nextLocation = new Vector3d(_newX, _newY, _nextHeight);
  92.                     this._avatar = new ObjectRolling(_id, _currentLocation, _nextLocation, ObjectRolling.SLD);
  93.                     break;
  94.                 default:
  95.                     Logger.log("** Incompatible character movetype!");
  96.             }
  97.             return true;
  98.         }
  99.     }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement