本文整理汇总了C#中GamePlayer.IsVisibleTo方法的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer.IsVisibleTo方法的具体用法?C# GamePlayer.IsVisibleTo怎么用?C# GamePlayer.IsVisibleTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GamePlayer
的用法示例。
在下文中一共展示了GamePlayer.IsVisibleTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendPlayerCreate
public override void SendPlayerCreate(GamePlayer playerToCreate)
{
Region playerRegion = playerToCreate.CurrentRegion;
if (playerRegion == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerRegion == null");
return;
}
Zone playerZone = playerToCreate.CurrentZone;
if (playerZone == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerZone == null");
return;
}
if (m_gameClient.Player == null || playerToCreate.IsVisibleTo(m_gameClient.Player) == false)
return;
GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.PlayerCreate172));
pak.WriteShort((ushort)playerToCreate.Client.SessionID);
pak.WriteShort((ushort)playerToCreate.ObjectID);
pak.WriteShort(playerToCreate.Model);
pak.WriteShort((ushort)playerToCreate.Z);
//Dinberg:Instances - Zoneskin ID for clientside positioning 'bluff'.
pak.WriteShort(playerZone.ZoneSkinID);
pak.WriteShort((ushort)playerRegion.GetXOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort((ushort)playerRegion.GetYOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort(playerToCreate.Heading);
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeSize)); //1-4 = Eye Size / 5-8 = Nose Size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.LipSize)); //1-4 = Ear size / 5-8 = Kin size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeColor)); //1-4 = Skin Color / 5-8 = Eye Color
pak.WriteByte(playerToCreate.GetDisplayLevel(m_gameClient.Player));
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairColor)); //Hair: 1-4 = Color / 5-8 = unknown
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.FaceType)); //1-4 = Unknown / 5-8 = Face type
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairStyle)); //1-4 = Unknown / 5-8 = Hair Style
int flags = (GameServer.ServerRules.GetLivingRealm(m_gameClient.Player, playerToCreate) & 0x03) << 2;
if (playerToCreate.IsAlive == false)
flags |= 0x01;
if (playerToCreate.IsUnderwater)
flags |= 0x02; //swimming
if (playerToCreate.IsStealthed)
flags |= 0x10;
if (playerToCreate.IsWireframe)
flags |= 0x20;
pak.WriteByte((byte)flags);
pak.WritePascalString(GameServer.ServerRules.GetPlayerName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerGuildName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerLastName(m_gameClient.Player, playerToCreate));
pak.WriteByte(0x00); //Trialing 0 ... needed!
SendTCP(pak);
//if (GameServer.ServerRules.GetColorHandling(m_gameClient) == 1) // PvP
SendObjectGuildID(playerToCreate, playerToCreate.Guild); //used for nearest friendly/enemy object buttons and name colors on PvP server
}
示例2: SendPlayerCreate
public override void SendPlayerCreate(GamePlayer playerToCreate)
{
Region playerRegion = playerToCreate.CurrentRegion;
if (playerRegion == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerRegion == null");
return;
}
Zone playerZone = playerToCreate.CurrentZone;
if (playerZone == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerZone == null");
return;
}
if (m_gameClient.Player == null || playerToCreate.IsVisibleTo(m_gameClient.Player) == false)
return;
using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.PlayerCreate172)))
{
pak.WriteShort((ushort)playerToCreate.Client.SessionID);
pak.WriteShort((ushort)playerToCreate.ObjectID);
pak.WriteShort(playerToCreate.Model);
pak.WriteShort((ushort)playerToCreate.Z);
//Dinberg:Instances - as with all objects, we need to use a zoneSkinID for clientside positioning.
pak.WriteShort(playerZone.ZoneSkinID);
pak.WriteShort((ushort)playerRegion.GetXOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort((ushort)playerRegion.GetYOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort(playerToCreate.Heading);
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeSize)); //1-4 = Eye Size / 5-8 = Nose Size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.LipSize)); //1-4 = Ear size / 5-8 = Kin size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.MoodType)); //1-4 = Ear size / 5-8 = Kin size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeColor)); //1-4 = Skin Color / 5-8 = Eye Color
pak.WriteByte(playerToCreate.GetDisplayLevel(m_gameClient.Player));
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairColor)); //Hair: 1-4 = Color / 5-8 = unknown
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.FaceType)); //1-4 = Unknown / 5-8 = Face type
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairStyle)); //1-4 = Unknown / 5-8 = Hair Style
int flags = (GameServer.ServerRules.GetLivingRealm(m_gameClient.Player, playerToCreate) & 0x03) << 2;
if (playerToCreate.IsAlive == false) flags |= 0x01;
if (playerToCreate.IsUnderwater) flags |= 0x02; //swimming
if (playerToCreate.IsStealthed) flags |= 0x10;
if (playerToCreate.IsWireframe) flags |= 0x20;
if (playerToCreate.CharacterClass.ID == (int)eCharacterClass.Vampiir) flags |= 0x40; //Vamp fly
pak.WriteByte((byte)flags);
pak.WriteByte(0x00); // new in 1.74
pak.WritePascalString(GameServer.ServerRules.GetPlayerName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerGuildName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerLastName(m_gameClient.Player, playerToCreate));
//RR 12 / 13
pak.WritePascalString(GameServer.ServerRules.GetPlayerPrefixName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerTitle(m_gameClient.Player, playerToCreate)); // new in 1.74, NewTitle
pak.WriteByte(0x00); // new in 1.75
SendTCP(pak);
}
// Update Cache
m_gameClient.GameObjectUpdateArray[new Tuple<ushort, ushort>(playerToCreate.CurrentRegionID, (ushort)playerToCreate.ObjectID)] = GameTimer.GetTickCount();
SendObjectGuildID(playerToCreate, playerToCreate.Guild); //used for nearest friendly/enemy object buttons and name colors on PvP server
}
示例3: SendPlayerCreate
public virtual void SendPlayerCreate(GamePlayer playerToCreate)
{
if (playerToCreate == null)
return;
Region playerRegion = playerToCreate.CurrentRegion;
if (playerRegion == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerRegion == null");
return;
}
Zone playerZone = playerToCreate.CurrentZone;
if (playerZone == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerZone == null");
return;
}
if (playerToCreate.IsVisibleTo(m_gameClient.Player) == false)
return;
using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.PlayerCreate)))
{
pak.WriteShort((ushort) playerToCreate.Client.SessionID);
pak.WriteShort((ushort) playerToCreate.ObjectID);
//pak.WriteInt(playerToCreate.X);
//pak.WriteInt(playerToCreate.Y);
pak.WriteShort((ushort) playerRegion.GetXOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort((ushort) playerRegion.GetYOffInZone(playerToCreate.X, playerToCreate.Y));
//Dinberg:Instances - changing to ZoneSkinID for instance zones.
pak.WriteByte((byte) playerZone.ZoneSkinID);
pak.WriteByte(0);
pak.WriteShort((ushort) playerToCreate.Z);
pak.WriteShort(playerToCreate.Heading);
pak.WriteShort(playerToCreate.Model);
//DOLConsole.WriteLine("send created player "+target.Player.Name+" to "+client.Player.Name+" alive="+target.Player.Alive);
pak.WriteByte((byte) (playerToCreate.IsAlive ? 0x1 : 0x0));
pak.WriteByte(0x00);
pak.WriteByte(GameServer.ServerRules.GetLivingRealm(m_gameClient.Player, playerToCreate));
pak.WriteByte(playerToCreate.GetDisplayLevel(m_gameClient.Player));
pak.WriteByte((byte) (playerToCreate.IsStealthed ? 0x01 : 0x00));
pak.WriteByte(0x00); //Unused (??)
pak.WritePascalString(GameServer.ServerRules.GetPlayerName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerGuildName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerLastName(m_gameClient.Player, playerToCreate));
pak.WriteByte(0x00); //Trialing 0 ... needed!
SendTCP(pak);
}
if (playerToCreate.CharacterClass.ID == (int) eCharacterClass.Warlock)
{
/*
ChamberEffect ce = (ChamberEffect)playerToCreate.EffectList.GetOfType(typeof(ChamberEffect));
if (ce != null)
{
ce.SendChamber(m_gameClient.Player);
}
*/
}
//if (GameServer.ServerRules.GetColorHandling(m_gameClient) == 1) // PvP
SendObjectGuildID(playerToCreate, playerToCreate.Guild);
//used for nearest friendly/enemy object buttons and name colors on PvP server
}
示例4: SendPlayerCreate
public override void SendPlayerCreate(GamePlayer playerToCreate)
{
if (playerToCreate == null)
{
if (log.IsErrorEnabled)
log.Error("SendPlayerCreate: playerToCreate == null");
return;
}
if (m_gameClient.Player == null)
{
if (log.IsErrorEnabled)
log.Error("SendPlayerCreate: m_gameClient.Player == null");
return;
}
Region playerRegion = playerToCreate.CurrentRegion;
if (playerRegion == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerRegion == null");
return;
}
Zone playerZone = playerToCreate.CurrentZone;
if (playerZone == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerZone == null");
return;
}
if (playerToCreate.IsVisibleTo(m_gameClient.Player) == false)
return;
using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.PlayerCreate172)))
{
pak.WriteShort((ushort)playerToCreate.Client.SessionID);
pak.WriteShort((ushort)playerToCreate.ObjectID);
pak.WriteShort(playerToCreate.Model);
pak.WriteShort((ushort)playerToCreate.Z);
//Dinberg:Instances - send out the 'fake' zone ID to the client for positioning purposes.
pak.WriteShort(playerZone.ZoneSkinID);
pak.WriteShort((ushort)playerRegion.GetXOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort((ushort)playerRegion.GetYOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort(playerToCreate.Heading);
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeSize)); //1-4 = Eye Size / 5-8 = Nose Size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.LipSize)); //1-4 = Ear size / 5-8 = Kin size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.MoodType)); //1-4 = Ear size / 5-8 = Kin size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeColor)); //1-4 = Skin Color / 5-8 = Eye Color
pak.WriteByte(playerToCreate.GetDisplayLevel(m_gameClient.Player));
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairColor)); //Hair: 1-4 = Color / 5-8 = unknown
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.FaceType)); //1-4 = Unknown / 5-8 = Face type
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairStyle)); //1-4 = Unknown / 5-8 = Hair Style
int flags = (GameServer.ServerRules.GetLivingRealm(m_gameClient.Player, playerToCreate) & 0x03) << 2;
if (playerToCreate.IsAlive == false) flags |= 0x01;
if (playerToCreate.IsUnderwater) flags |= 0x02; //swimming
if (playerToCreate.IsStealthed) flags |= 0x10;
if (playerToCreate.IsWireframe) flags |= 0x20;
if (playerToCreate.CharacterClass.ID == (int)eCharacterClass.Vampiir) flags |= 0x40; //Vamp fly
pak.WriteByte((byte)flags);
pak.WriteByte(0x00); // new in 1.74
pak.WritePascalString(GameServer.ServerRules.GetPlayerName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerGuildName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerLastName(m_gameClient.Player, playerToCreate));
//RR 12 / 13
pak.WritePascalString(GameServer.ServerRules.GetPlayerPrefixName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerTitle(m_gameClient.Player, playerToCreate)); // new in 1.74, NewTitle
if (playerToCreate.IsOnHorse)
{
pak.WriteByte(playerToCreate.ActiveHorse.ID);
if (playerToCreate.ActiveHorse.BardingColor == 0 && playerToCreate.ActiveHorse.Barding != 0 && playerToCreate.Guild != null)
{
int newGuildBitMask = (playerToCreate.Guild.Emblem & 0x010000) >> 9;
pak.WriteByte((byte)(playerToCreate.ActiveHorse.Barding | newGuildBitMask));
pak.WriteShortLowEndian((ushort)playerToCreate.Guild.Emblem);
}
else
{
pak.WriteByte(playerToCreate.ActiveHorse.Barding);
pak.WriteShort(playerToCreate.ActiveHorse.BardingColor);
}
pak.WriteByte(playerToCreate.ActiveHorse.Saddle);
pak.WriteByte(playerToCreate.ActiveHorse.SaddleColor);
}
else
{
pak.WriteByte(0); // trailing zero
}
SendTCP(pak);
}
// Update Cache
m_gameClient.GameObjectUpdateArray[new Tuple<ushort, ushort>(playerToCreate.CurrentRegionID, (ushort)playerToCreate.ObjectID)] = GameTimer.GetTickCount();
//.........这里部分代码省略.........
示例5: SendPlayerCreate
public override void SendPlayerCreate(GamePlayer playerToCreate)
{
Region playerRegion = playerToCreate.CurrentRegion;
if (playerRegion == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerRegion == null");
return;
}
Zone playerZone = playerToCreate.CurrentZone;
if (playerZone == null)
{
if (log.IsWarnEnabled)
log.Warn("SendPlayerCreate: playerZone == null");
return;
}
if (m_gameClient.Player == null || playerToCreate.IsVisibleTo(m_gameClient.Player) == false)
return;
GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.PlayerCreate172));
pak.WriteShort((ushort)playerToCreate.Client.SessionID);
pak.WriteShort((ushort)playerToCreate.ObjectID);
pak.WriteShort(playerToCreate.Model);
pak.WriteShort((ushort)playerToCreate.Z);
//Dinberg:Instances - zoneSkinID for object positioning clientside (as zones are hardcoded).
pak.WriteShort(playerZone.ZoneSkinID);
pak.WriteShort((ushort)playerRegion.GetXOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort((ushort)playerRegion.GetYOffInZone(playerToCreate.X, playerToCreate.Y));
pak.WriteShort(playerToCreate.Heading);
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeSize)); //1-4 = Eye Size / 5-8 = Nose Size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.LipSize)); //1-4 = Ear size / 5-8 = Kin size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.MoodType)); //1-4 = Ear size / 5-8 = Kin size
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.EyeColor)); //1-4 = Skin Color / 5-8 = Eye Color
pak.WriteByte(playerToCreate.GetDisplayLevel(m_gameClient.Player));
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairColor)); //Hair: 1-4 = Color / 5-8 = unknown
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.FaceType)); //1-4 = Unknown / 5-8 = Face type
pak.WriteByte(playerToCreate.GetFaceAttribute(eCharFacePart.HairStyle)); //1-4 = Unknown / 5-8 = Hair Style
int flags = (GameServer.ServerRules.GetLivingRealm(m_gameClient.Player, playerToCreate) & 0x03) << 2;
if (playerToCreate.IsAlive == false) flags |= 0x01;
if (playerToCreate.IsUnderwater) flags |= 0x02; //swimming
if (playerToCreate.IsStealthed) flags |= 0x10;
if (playerToCreate.IsWireframe) flags |= 0x20;
pak.WriteByte((byte)flags);
pak.WriteByte(0x00); // new in 1.74
if (playerToCreate.CharacterClass.ID == (int)eCharacterClass.Vampiir) flags |= 0x40; //Vamp fly
pak.WritePascalString(GameServer.ServerRules.GetPlayerName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerGuildName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(GameServer.ServerRules.GetPlayerLastName(m_gameClient.Player, playerToCreate));
//RR 12 / 13
pak.WritePascalString(GameServer.ServerRules.GetPlayerPrefixName(m_gameClient.Player, playerToCreate));
pak.WritePascalString(playerToCreate.CurrentTitle.GetValue(playerToCreate)); // new in 1.74, NewTitle
SendTCP(pak);
//if (GameServer.ServerRules.GetColorHandling(m_gameClient) == 1) // PvP
SendObjectGuildID(playerToCreate, playerToCreate.Guild); //used for nearest friendly/enemy object buttons and name colors on PvP server
if (m_gameClient.Player != null && playerToCreate.CharacterClass.ID == (int)eCharacterClass.Warlock)
{
/*
ChamberEffect ce = (ChamberEffect)playerToCreate.EffectList.GetOfType(typeof(ChamberEffect));
if (ce != null)
{
ce.SendChamber(m_gameClient.Player);
}
*/
}
}