当前位置: 首页>>代码示例>>C#>>正文


C# Housing.House类代码示例

本文整理汇总了C#中DOL.GS.Housing.House的典型用法代码示例。如果您正苦于以下问题:C# House类的具体用法?C# House怎么用?C# House使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


House类属于DOL.GS.Housing命名空间,在下文中一共展示了House类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Attach

        /// <summary>
        /// Attach this vault to a hookpoint in a house.
        /// </summary>
        /// <param name="house"></param>
        /// <param name="hookpointID"></param>
        /// <returns></returns>
        public bool Attach(House house, uint hookpointID, ushort heading)
        {
            if (house == null)
                return false;

            // register vault in the DB.
            var hookedItem = new DBHouseHookpointItem
            {
                HouseNumber = house.HouseNumber,
                HookpointID = hookpointID,
                Heading = (ushort)(heading % 4096),
                ItemTemplateID = _templateID,
                Index = (byte)Index
            };

            var hpitem = GameServer.Database.SelectObjects<DBHouseHookpointItem>("`HouseNumber` = @HouseNumber AND `HookpointID` = @HookpointID", new[] { new QueryParameter("@HouseNumber", house.HouseNumber), new QueryParameter("@HookpointID", hookpointID) });

			// if there isn't anything already on this hookpoint then add it to the DB
			if (hpitem.Count == 0)
			{
				GameServer.Database.AddObject(hookedItem);
			}

            // now add the vault to the house.
            return Attach(house, hookedItem);
        }
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:32,代码来源:GameHouseVault.cs

示例2: AccountVault

        /// <summary>
        /// An account vault that masquerades as a house vault to the game client
        /// </summary>
        /// <param name="player">Player who owns the vault</param>
        /// <param name="vaultNPC">NPC controlling the interaction between player and vault</param>
        /// <param name="vaultOwner">ID of vault owner (can be anything unique, if it's the account name then all toons on account can access the items)</param>
        /// <param name="vaultNumber">Valid vault IDs are 0-3</param>
        /// <param name="dummyTemplate">An ItemTemplate to satisfy the base class's constructor</param>
        public AccountVault(GamePlayer player, GameNPC vaultNPC, string vaultOwner, int vaultNumber, ItemTemplate dummyTemplate)
            : base(dummyTemplate, vaultNumber)
        {
            m_player = player;
            m_vaultNPC = vaultNPC;
            m_vaultOwner = vaultOwner;
            m_vaultNumber = vaultNumber;

            DBHouse dbh = new DBHouse();
            //was allowsave = false but uhh i replaced with allowadd = false
            dbh.AllowAdd = false;
            dbh.GuildHouse = false;
            dbh.HouseNumber = player.ObjectID;
            dbh.Name = player.Name + "'s House";
            dbh.OwnerID = player.DBCharacter.ObjectId;
            dbh.RegionID = player.CurrentRegionID;

            CurrentHouse = new House(dbh);
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:27,代码来源:AccountVaultKeeper.cs

示例3: SendGarden

		public virtual void SendGarden(House house, int i)
		{
			using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseChangeGarden)))
			{
				pak.WriteShort((ushort) house.HouseNumber);
				pak.WriteByte(0x01);
				pak.WriteByte(0x00); // update
				var item = (OutdoorItem) house.OutdoorItems[i];
				pak.WriteByte((byte) i);
				pak.WriteShort((ushort) item.Model);
				pak.WriteByte((byte) item.Position);
				pak.WriteByte((byte) item.Rotation);
				SendTCP(pak);
			}
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:15,代码来源:PacketLib168.cs

示例4: SendEnterHouse

		public override void SendEnterHouse(House house)
		{
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseEnter));

			pak.WriteShort((ushort)house.HouseNumber);
			pak.WriteShort((ushort)25000);         //constant!
			pak.WriteInt((uint)house.X);
			pak.WriteInt((uint)house.Y);
			pak.WriteShort((ushort)house.Heading); //useless/ignored by client.
			pak.WriteByte(0x00);
			pak.WriteByte((byte)(house.GetGuildEmblemFlags() | (house.Emblem & 0x010000) >> 14));//new Guild Emblem
			pak.WriteShort((ushort)house.Emblem);	//emblem
			pak.WriteByte(0x00);
			pak.WriteByte(0x00);
			pak.WriteByte((byte)house.Model);
			pak.WriteByte(0x00);
			pak.WriteByte(0x00);
			pak.WriteByte(0x00);
			pak.WriteByte((byte)house.Rug1Color);
			pak.WriteByte((byte)house.Rug2Color);
			pak.WriteByte((byte)house.Rug3Color);
			pak.WriteByte((byte)house.Rug4Color);
			pak.WriteByte(0x00);

			SendTCP(pak);
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:26,代码来源:PacketLib176.cs

示例5: CreateHousingConsignmentMerchant

 /// <summary>
 /// This creates the housing consignment merchant attached to a house.
 /// You can override this to create your own consignment merchant derived from the standard merchant
 /// </summary>
 /// <returns></returns>
 public virtual GameConsignmentMerchant CreateHousingConsignmentMerchant(House house)
 {
     var m = new GameConsignmentMerchant();
     m.Name = "Consignment Merchant";
     return m;
 }
开发者ID:mynew4,项目名称:DAoC,代码行数:11,代码来源:AbstractServerRules.cs

示例6: ResetHouseData

		public static void ResetHouseData(House house)
		{
			house.Model = 0;
			house.Emblem = 0;
			house.IndoorGuildBanner = false;
			house.IndoorGuildShield = false;
			house.DoorMaterial = 0;
			house.OutdoorGuildBanner = false;
			house.OutdoorGuildShield = false;
			house.Porch = false;
			house.PorchMaterial = 0;
			house.PorchRoofColor = 0;
			house.RoofMaterial = 0;
			house.Rug1Color = 0;
			house.Rug2Color = 0;
			house.Rug3Color = 0;
			house.Rug4Color = 0;
			house.TrussMaterial = 0;
			house.WallMaterial = 0;
			house.WindowMaterial = 0;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:21,代码来源:HouseMgr.cs

示例7: RemoveHouseItems

		public static void RemoveHouseItems(House house)
		{
			house.RemoveConsignmentMerchant();

			IList<DBHouseIndoorItem> iobjs = GameServer.Database.SelectObjects<DBHouseIndoorItem>("HouseNumber = " + house.HouseNumber);
			foreach (DBHouseIndoorItem item in iobjs)
			{
				GameServer.Database.DeleteObject(item);
			}
			house.IndoorItems.Clear();

			IList<DBHouseOutdoorItem> oobjs = GameServer.Database.SelectObjects<DBHouseOutdoorItem>("HouseNumber = " + house.HouseNumber);
			foreach (DBHouseOutdoorItem item in oobjs)
			{
				GameServer.Database.DeleteObject(item);
			}
			house.OutdoorItems.Clear();

			IList<DBHouseHookpointItem> hpobjs = GameServer.Database.SelectObjects<DBHouseHookpointItem>("HouseNumber = " + house.HouseNumber);
			foreach (DBHouseHookpointItem item in hpobjs)
			{
				GameServer.Database.DeleteObject(item);
			}

			foreach (DBHouseHookpointItem item in house.HousepointItems.Values)
			{
				if (item.GameObject is GameObject)
				{
					(item.GameObject as GameObject).Delete();
				}
			}
			house.HousepointItems.Clear();
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:33,代码来源:HouseMgr.cs

示例8: SendFurniture

		public virtual void SendFurniture(House house, int i)
		{
			using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HousingItem)))
			{
				pak.WriteShort((ushort) house.HouseNumber);
				pak.WriteByte(0x01); //cnt
				pak.WriteByte(0x00); //upd
				var item = (IndoorItem) house.IndoorItems[i];
				WriteHouseFurniture(pak, item, i);
				SendTCP(pak);
			}
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:12,代码来源:PacketLib168.cs

示例9: SendHouseUsersPermissions

		public virtual void SendHouseUsersPermissions(House house)
		{
			if(house == null)
				return;

			using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseUserPermissions)))
			{
				pak.WriteByte((byte)house.HousePermissions.Count()); // number of permissions
				pak.WriteByte(0x00); // ?
				pak.WriteShort((ushort)house.HouseNumber); // house number

				foreach (var entry in house.HousePermissions)
				{
					// grab permission
					var perm = entry.Value;

					pak.WriteByte((byte)entry.Key); // Slot
					pak.WriteByte(0x00); // ?
					pak.WriteByte(0x00); // ?
					pak.WriteByte((byte)perm.PermissionType); // Type (Guild, Class, Race ...)
					pak.WriteByte((byte)perm.PermissionLevel); // Level (Friend, Visitor ...)
					pak.WritePascalString(perm.DisplayName);
				}

				SendTCP(pak);
			}
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:27,代码来源:PacketLib168.cs

示例10: SendToggleHousePoints

		public virtual void SendToggleHousePoints(House house)
		{
			using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseTogglePoints)))
			{
				pak.WriteShort((ushort) house.HouseNumber);
				pak.WriteByte(0x04);
				pak.WriteByte(0x00);

				SendTCP(pak);
			}
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:11,代码来源:PacketLib168.cs

示例11: SendExitHouse

		public virtual void SendExitHouse(House house, ushort unknown = 0)
		{
			using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseExit)))
			{
				pak.WriteShort((ushort) house.HouseNumber);
				pak.WriteShort(unknown);
				SendTCP(pak);
			}
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:9,代码来源:PacketLib168.cs

示例12: SendEnterHouse

		public virtual void SendEnterHouse(House house)
		{
			using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseEnter)))
			{
				pak.WriteShort((ushort) house.HouseNumber);
				pak.WriteShort(25000); //constant!
				pak.WriteInt((uint) house.X);
				pak.WriteInt((uint) house.Y);
				pak.WriteShort((ushort) house.Heading); //useless/ignored by client.
				pak.WriteByte(0x00);
				pak.WriteByte((byte) house.GetGuildEmblemFlags()); //emblem style
				pak.WriteShort((ushort) house.Emblem); //emblem
				pak.WriteByte(0x00);
				pak.WriteByte(0x00);
				pak.WriteByte((byte) house.Model);
				pak.WriteByte(0x00);
				pak.WriteByte(0x00);
				pak.WriteByte(0x00);
				pak.WriteByte((byte) house.Rug1Color);
				pak.WriteByte((byte) house.Rug2Color);
				pak.WriteByte((byte) house.Rug3Color);
				pak.WriteByte((byte) house.Rug4Color);
				pak.WriteByte(0x00);

				SendTCP(pak);
			}
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:27,代码来源:PacketLib168.cs

示例13: SendHouseOccupied

		public virtual void SendHouseOccupied(House house, bool flagHouseOccuped)
		{
			using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseChangeGarden)))
			{
				pak.WriteShort((ushort) house.HouseNumber);
				pak.WriteByte(0x00);
				pak.WriteByte((byte) (flagHouseOccuped ? 1 : 0));

				SendTCP(pak);
			}
		}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:11,代码来源:PacketLib168.cs

示例14: UpgradeHouse

		public static bool UpgradeHouse(House house, InventoryItem deed)
		{
			int newModel = 0;
			switch (deed.Id_nb)
			{
				case "housing_alb_cottage_deed":
					newModel = 1;
					break;
				case "housing_alb_house_deed":
					newModel = 2;
					break;
				case "housing_alb_villa_deed":
					newModel = 3;
					break;
				case "housing_alb_mansion_deed":
					newModel = 4;
					break;
				case "housing_mid_cottage_deed":
					newModel = 5;
					break;
				case "housing_mid_house_deed":
					newModel = 6;
					break;
				case "housing_mid_villa_deed":
					newModel = 7;
					break;
				case "housing_mid_mansion_deed":
					newModel = 8;
					break;
				case "housing_hib_cottage_deed":
					newModel = 9;
					break;
				case "housing_hib_house_deed":
					newModel = 10;
					break;
				case "housing_hib_villa_deed":
					newModel = 11;
					break;
				case "housing_hib_mansion_deed":
					newModel = 12;
					break;
			}

			if (newModel == 0)
				return false;

			// remove all players from the home before we upgrade it
			foreach (GamePlayer player in house.GetAllPlayersInHouse())
			{
				player.LeaveHouse();
			}

			// if there is a consignment merchant, we have to re-initialize since we changed the house
			var merchant = GameServer.Database.SelectObject<HouseConsignmentMerchant>("HouseNumber = '" + house.HouseNumber + "'");
			long oldMerchantMoney = 0;
			if (merchant != null)
			{
				oldMerchantMoney = merchant.Money;
			}

			RemoveHouseItems(house);

			// change the model of the house
			house.Model = newModel;

			// re-add the merchant if there was one
			if (merchant != null)
			{
				house.AddConsignment(oldMerchantMoney);
			}

			// save the house, and broadcast an update
			house.SaveIntoDatabase();
			house.SendUpdate();

			return true;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:77,代码来源:HouseMgr.cs

示例15: RemoveHouse

		public static void RemoveHouse(House house)
		{
			// try and get the houses for the given region
			Dictionary<int, House> housesByRegion;
			_houseList.TryGetValue(house.RegionID, out housesByRegion);

			if (housesByRegion == null)
				return;

			// remove all players from the house
			foreach (GamePlayer player in house.GetAllPlayersInHouse())
			{
				player.LeaveHouse();
			}

			// remove the house for all nearby players
			foreach (GamePlayer player in WorldMgr.GetPlayersCloseToSpot(house, WorldMgr.OBJ_UPDATE_DISTANCE))
			{
				player.Out.SendRemoveHouse(house);
				player.Out.SendGarden(house);
			}

			if (house.Model > 0)
				log.WarnFormat("Removing house #{0} owned by {1}!", house.HouseNumber, house.DatabaseItem.Name);
			else
				log.WarnFormat("Lotmarker #{0} owned by {1} had rent due, lot now for sale!", house.HouseNumber, house.DatabaseItem.Name);

			RemoveHouseItems(house);
			RemoveHousePermissions(house);
			ResetHouseData(house);

			house.OwnerID = "";
			house.KeptMoney = 0;
			house.Name = ""; // not null !
			house.DatabaseItem.CreationTime = DateTime.Now;
			house.DatabaseItem.LastPaid = DateTime.MinValue;

			// saved the cleared house in the database
			house.SaveIntoDatabase();

			// remove the house from the list of houses in the region
			housesByRegion.Remove(house.HouseNumber);

			// spawn a lot marker for the now-empty lot
			GameLotMarker.SpawnLotMarker(house.DatabaseItem);
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:46,代码来源:HouseMgr.cs


注:本文中的DOL.GS.Housing.House类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。