Ejemplo n.º 1
0
        private void OnRoomFloorItems(DataInterceptedEventArgs e)
        {
            var floorItems = HFloorObject.Parse(e.Packet);

            for (int i = 0; i < floorItems.Length; i++)
            {
                _items.Add(floorItems[i].Id.ToString(), floorItems[i].TypeId);
            }
        }
Ejemplo n.º 2
0
        public static HFloorObject[] Parse(HMessage packet)
        {
            int ownersCount = packet.ReadInteger();
            var owners      = new Dictionary <int, string>(ownersCount);

            for (int i = 0; i < ownersCount; i++)
            {
                owners.Add(packet.ReadInteger(), packet.ReadString());
            }

            var floorObjects = new HFloorObject[packet.ReadInteger()];

            for (int i = 0; i < floorObjects.Length; i++)
            {
                var floorObject = new HFloorObject(packet);
                floorObject.OwnerName = owners[floorObject.OwnerId];

                floorObjects[i] = floorObject;
            }
            return(floorObjects);
        }