本文整理汇总了C#中DOL.GS.Housing.House类的典型用法代码示例。如果您正苦于以下问题:C# House类的具体用法?C# House怎么用?C# House使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
House类属于DOL.GS.Housing命名空间,在下文中一共展示了House类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: SendRentReminder
public virtual void SendRentReminder(House house)
{
//0:00:58.047 S=>C 0xF7 show help window (topicIndex:106 houseLot?:4281)
using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HelpWindow)))
{
pak.WriteShort(106); //short index
pak.WriteShort((ushort) house.HouseNumber); //short lot
SendTCP(pak);
}
}
开发者ID:SkyFire,项目名称:Dawn-of-Light-core,代码行数:10,代码来源:PacketLib168.cs
示例17: RemoveHousePermissions
public static void RemoveHousePermissions(House house)
{
// clear the house number for the guild if this is a guild house
if (house.DatabaseItem.GuildHouse)
{
Guild guild = GuildMgr.GetGuildByName(house.DatabaseItem.GuildName);
if (guild != null)
{
guild.GuildHouseNumber = 0;
}
}
house.DatabaseItem.GuildHouse = false;
house.DatabaseItem.GuildName = null;
IList<DBHousePermissions> pobjs = GameServer.Database.SelectObjects<DBHousePermissions>("HouseNumber = " + house.HouseNumber);
foreach (DBHousePermissions item in pobjs)
{
GameServer.Database.DeleteObject(item);
}
house.PermissionLevels.Clear();
IList<DBHouseCharsXPerms> cpobjs = GameServer.Database.SelectObjects<DBHouseCharsXPerms>("HouseNumber = " + house.HouseNumber);
foreach (DBHouseCharsXPerms item in cpobjs)
{
GameServer.Database.DeleteObject(item);
}
house.CharXPermissions.Clear();
}
开发者ID:mynew4,项目名称:DAoC,代码行数:29,代码来源:HouseMgr.cs
示例18: SendHouse
public override void SendHouse(House house)
{
using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseCreate)))
{
pak.WriteShort((ushort)house.HouseNumber);
pak.WriteShort((ushort)house.Z);
pak.WriteInt((uint)house.X);
pak.WriteInt((uint)house.Y);
pak.WriteShort((ushort)house.Heading);
pak.WriteShort((ushort)house.PorchRoofColor);
int flagPorchAndGuildEmblem = (house.Emblem & 0x010000) >> 13;//new Guild Emblem
if (house.Porch)
flagPorchAndGuildEmblem |= 1;
if (house.OutdoorGuildBanner)
flagPorchAndGuildEmblem |= 2;
if (house.OutdoorGuildShield)
flagPorchAndGuildEmblem |= 4;
pak.WriteShort((ushort)flagPorchAndGuildEmblem);
pak.WriteShort((ushort)house.Emblem);
pak.WriteShort(0); // new in 1.89b+ (scheduled for resposession XXX hourses ago)
pak.WriteByte((byte)house.Model);
pak.WriteByte((byte)house.RoofMaterial);
pak.WriteByte((byte)house.WallMaterial);
pak.WriteByte((byte)house.DoorMaterial);
pak.WriteByte((byte)house.TrussMaterial);
pak.WriteByte((byte)house.PorchMaterial);
pak.WriteByte((byte)house.WindowMaterial);
pak.WriteByte(0);
pak.WriteShort(0); // new in 1.89b+
pak.WritePascalString(house.Name);
SendTCP(pak);
}
// Update cache
m_gameClient.HouseUpdateArray[new Tuple<ushort, ushort>(house.RegionID, (ushort)house.HouseNumber)] = GameTimer.GetTickCount();
}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:37,代码来源:PacketLib189.cs
示例19: HouseTransferToGuild
/// <summary>
/// Transfer a house to a guild house
/// </summary>
/// <param name="player"></param>
/// <param name="house"></param>
/// <returns></returns>
public static bool HouseTransferToGuild(GamePlayer player, House house)
{
// player must be in a guild
if (player.Guild == null)
return false;
// player's guild can't already have a guild house
if (player.Guild.GuildOwnsHouse)
return false;
// player needs to own the house to be able to xfer it
if (house.HasOwnerPermissions(player) == false)
{
ChatUtil.SendSystemMessage(player, "You do not own this house!");
return false;
}
// player needs to be a GM in the guild to xfer his personal house to the guild
if (player.Guild.HasRank(player, Guild.eRank.Leader) == false)
{
ChatUtil.SendSystemMessage(player, "You are not the leader of a guild!");
return false;
}
// Demand any consignment merchant inventory is removed before allowing a transfer
var consignmentMerchant = house.ConsignmentMerchant;
if (consignmentMerchant != null && (consignmentMerchant.DBItems().Count > 0 || consignmentMerchant.TotalMoney > 0))
{
ChatUtil.SendSystemMessage(player, "All items and money must be removed from your consigmment merchant in order to transfer this house!");
return false;
}
// send house xfer prompt to player
player.Out.SendCustomDialog(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Player.Housing.TransferToGuild", player.Guild.Name), MakeGuildLot);
return true;
}
开发者ID:mynew4,项目名称:DAoC,代码行数:43,代码来源:HouseMgr.cs
示例20: SendGarden
public override void SendGarden(House house)
{
using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.HouseChangeGarden)))
{
pak.WriteShort((ushort)house.HouseNumber);
pak.WriteShort(0); // sheduled for repossession (in hours) new in 1.89b+
pak.WriteByte((byte)house.OutdoorItems.Count);
pak.WriteByte(0x80);
foreach (var entry in house.OutdoorItems.OrderBy(entry => entry.Key))
{
OutdoorItem item = entry.Value;
pak.WriteByte((byte)entry.Key);
pak.WriteShort((ushort)item.Model);
pak.WriteByte((byte)item.Position);
pak.WriteByte((byte)item.Rotation);
}
SendTCP(pak);
}
// Update cache
m_gameClient.HouseUpdateArray.UpdateIfExists(new Tuple<ushort, ushort>(house.RegionID, (ushort)house.HouseNumber), GameTimer.GetTickCount());
}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:24,代码来源:PacketLib189.cs
注:本文中的DOL.GS.Housing.House类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论