Beispiel #1
0
        public void UpdateRestrictionDB()
        {
            var restrictions = new RestrictionDB(House);

            // update house
            var house = GetHouse();

            if (house.PhysicsObj != null)
            {
                UpdateRestrictionDB(restrictions, house);
            }

            // for mansions, update the linked houses
            foreach (var linkedHouse in house.LinkedHouses)
            {
                UpdateRestrictionDB(restrictions, linkedHouse);
            }

            // update house dungeon
            if (house.HasDungeon)
            {
                var dungeonHouse = GetDungeonHouse();
                if (dungeonHouse == null || dungeonHouse.PhysicsObj == null)
                {
                    return;
                }

                UpdateRestrictionDB(restrictions, dungeonHouse);
            }
        }
Beispiel #2
0
        public GameEventHouseUpdateRestrictions(Session session, ObjectGuid sender, RestrictionDB restrictions)
            : base(GameEventType.HouseUpdateRestrictions, GameMessageGroup.UIQueue, session)
        {
            //Console.WriteLine("Sending 0x248 - House - UpdateRestrictions");

            Writer.Write(sender.Full);  // The object restrictions are being updated for
            Writer.Write(restrictions);
        }
Beispiel #3
0
        public static Recv_UpdateRestrictions read(BinaryReader binaryReader)
        {
            Recv_UpdateRestrictions newObj = new Recv_UpdateRestrictions();

            newObj._house_ts = binaryReader.ReadByte();
            newObj.object_id = binaryReader.ReadUInt32();
            newObj.db        = RestrictionDB.read(binaryReader);
            return(newObj);
        }
Beispiel #4
0
        public GameEventHouseUpdateRestrictions(Session session, WorldObject obj, RestrictionDB restrictions)
            : base(GameEventType.HouseUpdateRestrictions, GameMessageGroup.UIQueue, session)
        {
            //Console.WriteLine("Sending 0x248 - House - UpdateRestrictions");

            Writer.Write(obj.Sequences.GetNextSequence(SequenceType.UpdateRestrictionDB));
            Writer.Write(obj.Guid.Full);  // The object restrictions are being updated for
            Writer.Write(restrictions);
        }
Beispiel #5
0
        public void UpdateRestrictionDB(RestrictionDB restrictions, House house)
        {
            HouseSequence++;

            Sync(house);

            var nearbyPlayers = house.PhysicsObj.ObjMaint.VoyeurTable.Values.Select(v => (Player)v.WeenieObj.WorldObject).ToList();

            foreach (var player in nearbyPlayers)
            {
                player.Session.Network.EnqueueSend(new GameEventHouseUpdateRestrictions(player.Session, house.Guid, restrictions, HouseSequence));
            }
        }
Beispiel #6
0
        public static RestrictionDB read(BinaryReader binaryReader)
        {
            RestrictionDB newObj = new RestrictionDB();

            newObj.version      = binaryReader.ReadUInt32();
            newObj._bitmask     = binaryReader.ReadUInt32();
            newObj._monarch_iid = binaryReader.ReadUInt32();
            newObj._buckets     = binaryReader.ReadUInt16();
            newObj._table_size  = binaryReader.ReadUInt16();
            newObj._table       = new List <RestrictionDBTable>();
            for (int i = 0; i < newObj._buckets; i++)
            {
                newObj._table.Add(RestrictionDBTable.read(binaryReader));
            }
            return(newObj);
        }
        public static RestrictionDB read(BinaryReader binaryReader)
        {
            RestrictionDB newObj        = new RestrictionDB();
            var           startPosition = binaryReader.BaseStream.Position;

            newObj.version      = binaryReader.ReadUInt32();
            newObj._bitmask     = binaryReader.ReadUInt32();
            newObj._monarch_iid = binaryReader.ReadUInt32();
            newObj._buckets     = binaryReader.ReadUInt16();
            newObj._table_size  = binaryReader.ReadUInt16();
            newObj._table       = new List <RestrictionDBTable>();
            for (int i = 0; i < newObj._buckets; i++)
            {
                newObj._table.Add(RestrictionDBTable.read(binaryReader));
            }
            newObj.Length = (int)(binaryReader.BaseStream.Position - startPosition);
            return(newObj);
        }
Beispiel #8
0
        public void UpdateRestrictionDB()
        {
            // fix event broadcast so it doesn't require a player session beforehand
            var house = GetHouse();

            if (house.PhysicsObj == null)
            {
                return;
            }

            HouseSequence++;

            Sync(house);

            var restrictions = new RestrictionDB(house);

            var nearbyPlayers = house.PhysicsObj.ObjMaint.VoyeurTable.Values.Select(v => (Player)v.WeenieObj.WorldObject).ToList();

            foreach (var player in nearbyPlayers)
            {
                player.Session.Network.EnqueueSend(new GameEventHouseUpdateRestrictions(player.Session, house.Guid, restrictions, HouseSequence));
            }
        }