本文整理汇总了C#中GameLiving.IsVisibleTo方法的典型用法代码示例。如果您正苦于以下问题:C# GameLiving.IsVisibleTo方法的具体用法?C# GameLiving.IsVisibleTo怎么用?C# GameLiving.IsVisibleTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameLiving
的用法示例。
在下文中一共展示了GameLiving.IsVisibleTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendLivingEquipmentUpdate
public override void SendLivingEquipmentUpdate(GameLiving living)
{
if (m_gameClient.Player == null || living.IsVisibleTo(m_gameClient.Player) == false)
return;
GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.EquipmentUpdate));
ICollection<InventoryItem> items = null;
if (living.Inventory != null)
items = living.Inventory.VisibleItems;
pak.WriteShort((ushort)living.ObjectID);
pak.WriteByte((byte)((living.IsCloakHoodUp ? 0x01 : 0x00) | (int)living.ActiveQuiverSlot)); //bit0 is hood up bit4 to 7 is active quiver
pak.WriteByte((byte)living.VisibleActiveWeaponSlots);
if (items != null)
{
pak.WriteByte((byte)items.Count);
foreach (InventoryItem item in items)
{
ushort model = (ushort)(item.Model & 0x1FFF);
int slot = item.SlotPosition;
int texture = (item.Emblem != 0) ? item.Emblem : item.Color;
if (item.SlotPosition == Slot.LEFTHAND || item.SlotPosition == Slot.CLOAK) // for test only cloack and shield
slot = slot | ((texture & 0x010000) >> 9); // slot & 0x80 if new emblem
pak.WriteByte((byte)slot);
if ((texture & ~0xFF) != 0)
model |= 0x8000;
else if ((texture & 0xFF) != 0)
model |= 0x4000;
if (item.Effect != 0)
model |= 0x2000;
pak.WriteShort(model);
if (item.SlotPosition > Slot.RANGED || item.SlotPosition < Slot.RIGHTHAND)
pak.WriteByte((byte)item.Extension);
if ((texture & ~0xFF) != 0)
pak.WriteShort((ushort)texture);
else if ((texture & 0xFF) != 0)
pak.WriteByte((byte)texture);
if (item.Effect != 0)
pak.WriteByte((byte)item.Effect);
}
}
else
{
pak.WriteByte(0x00);
}
SendTCP(pak);
}
示例2: SendLivingEquipmentUpdate
public virtual void SendLivingEquipmentUpdate(GameLiving living)
{
if (m_gameClient.Player == null || living.IsVisibleTo(m_gameClient.Player) == false)
return;
using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.EquipmentUpdate)))
{
pak.WriteShort((ushort) living.ObjectID);
pak.WriteByte((byte) ((living.IsCloakHoodUp ? 0x01 : 0x00) | (int) living.ActiveQuiverSlot));
//bit0 is hood up bit4 to 7 is active quiver
pak.WriteByte(living.VisibleActiveWeaponSlots);
if (living.Inventory != null)
{
var items = living.Inventory.VisibleItems;
pak.WriteByte((byte) items.Count);
foreach (InventoryItem item in items)
{
pak.WriteByte((byte) item.SlotPosition);
var model = (ushort) (item.Model & 0x1FFF);
int texture = (item.Emblem != 0) ? item.Emblem : item.Color;
if ((texture & ~0xFF) != 0)
model |= 0x8000;
else if ((texture & 0xFF) != 0)
model |= 0x4000;
if (item.Effect != 0)
model |= 0x2000;
pak.WriteShort(model);
if ((texture & ~0xFF) != 0)
pak.WriteShort((ushort) texture);
else if ((texture & 0xFF) != 0)
pak.WriteByte((byte) texture);
if (item.Effect != 0)
pak.WriteShort((ushort) item.Effect);
}
}
else
{
pak.WriteByte(0x00);
}
SendTCP(pak);
}
}