Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.sulake.habbo.communication.messages.parser.room.engine
- {
- import com.sulake.core.communication.messages.IMessageParser;
- import com.sulake.habbo.communication.messages.incoming.room.engine.ObjectRolling;
- import com.sulake.room.utils.Vector3d;
- import com.sulake.core.communication.messages.IMessageDataWrapper;
- public class ObjectsRollingParser implements IMessageParser
- {
- private var _rollerId:int;
- private var _itemsRolling:Array;
- private var _avatar:ObjectRolling = null;
- public function get id():int
- {
- return this._rollerId;
- }
- public function get avatar():ObjectRolling
- {
- return this._avatar;
- }
- public function get _Str_24284():Array
- {
- return this._itemsRolling;
- }
- public function flush():Boolean
- {
- this._rollerId = -1;
- this._avatar = null;
- this._itemsRolling = [];
- return true;
- }
- public function parse(k:IMessageDataWrapper):Boolean
- {
- var _id:int;
- var _local_8:ObjectRolling;
- var _currentLocation:Vector3d;
- var _nextLocation:Vector3d;
- var _currentHeight:Number;
- var _nextHeight:Number;
- if (k == null)
- {
- return false;
- }
- var _x:Number = k.readInteger();
- var _y:Number = k.readInteger();
- var _newX:Number = k.readInteger();
- var _newY:Number = k.readInteger();
- var _totalItems:int = k.readInteger();
- this._itemsRolling = new Array();
- var _totalItemsRead:int;
- while (_totalItemsRead < _totalItems)
- {
- _id = k.readInteger();
- _currentHeight = Number(k.readString());
- _nextHeight = Number(k.readString());
- _currentLocation = new Vector3d(_x, _y, _currentHeight);
- _nextLocation = new Vector3d(_newX, _newY, _nextHeight);
- _local_8 = new ObjectRolling(_id, _currentLocation, _nextLocation);
- this._itemsRolling.push(_local_8);
- _totalItemsRead++;
- }
- this._rollerId = k.readInteger();
- if (!k.bytesAvailable)
- {
- return true;
- }
- var _local_14:int = k.readInteger();
- switch (_local_14)
- {
- case 0:
- break;
- case 1:
- _id = k.readInteger();
- _currentHeight = Number(k.readString());
- _nextHeight = Number(k.readString());
- _currentLocation = new Vector3d(_x, _y, _currentHeight);
- _nextLocation = new Vector3d(_newX, _newY, _nextHeight);
- this._avatar = new ObjectRolling(_id, _currentLocation, _nextLocation, ObjectRolling.MV);
- break;
- case 2:
- _id = k.readInteger();
- _currentHeight = Number(k.readString());
- _nextHeight = Number(k.readString());
- _currentLocation = new Vector3d(_x, _y, _currentHeight);
- _nextLocation = new Vector3d(_newX, _newY, _nextHeight);
- this._avatar = new ObjectRolling(_id, _currentLocation, _nextLocation, ObjectRolling.SLD);
- break;
- default:
- Logger.log("** Incompatible character movetype!");
- }
- return true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement