本文整理匯總了C#中Server.Network.PacketHitList.AddPacketToSurroundingPlayersBut方法的典型用法代碼示例。如果您正苦於以下問題:C# PacketHitList.AddPacketToSurroundingPlayersBut方法的具體用法?C# PacketHitList.AddPacketToSurroundingPlayersBut怎麽用?C# PacketHitList.AddPacketToSurroundingPlayersBut使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Network.PacketHitList
的用法示例。
在下文中一共展示了PacketHitList.AddPacketToSurroundingPlayersBut方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AppendPlayerData
public static void AppendPlayerData(Client client, bool sendMyPlayerData, PacketHitList packetList)
{
TcpPacket packet = TcpPacket.CreatePacket("playerdata",
client.ConnectionID.ToString(), client.Player.Name, client.Player.GetActiveRecruit().Sprite.ToString(),
client.Player.GetActiveRecruit().Form.ToString(), ((int)client.Player.GetActiveRecruit().Shiny).ToString(), ((int)client.Player.GetActiveRecruit().Sex).ToString(),
client.Player.MapID, client.Player.X.ToString(), client.Player.Y.ToString(),
((int)client.Player.Direction).ToString(), ((int)client.Player.Access).ToString(), client.Player.Hunted.ToIntString(),
client.Player.Dead.ToIntString(), client.Player.GuildName, ((int)client.Player.GuildAccess).ToString(),
client.Player.Status);
packet.AppendParameters(0, (int)client.Player.GetActiveRecruit().StatusAilment, client.Player.GetActiveRecruit().VolatileStatus.Count);
for (int j = 0; j < client.Player.GetActiveRecruit().VolatileStatus.Count; j++) {
packet.AppendParameter(client.Player.GetActiveRecruit().VolatileStatus[j].Emoticon);
}
packetList.AddPacketToSurroundingPlayersBut(client, client.Player.Map, packet);
//packetList.AddPacketToMapBut(client, client.Player.MapID, packet);
Recruit recruit = client.Player.GetActiveRecruit();
int mobility = 0;
for (int i = 15; i >= 0; i--) {
if (recruit.Mobility[i]) {
mobility += (int)System.Math.Pow(2, i);
}
}
if (sendMyPlayerData) {
TcpPacket myPacket = TcpPacket.CreatePacket("myplayerdata", client.Player.ActiveSlot.ToString(),
client.Player.Name, recruit.Sprite.ToString(), recruit.Form.ToString(), ((int)recruit.Shiny).ToString(), ((int)recruit.Sex).ToString(),
client.Player.MapID, client.Player.X.ToString(), client.Player.Y.ToString(),
((int)client.Player.Direction).ToString(), ((int)client.Player.Access).ToString(), client.Player.Hunted.ToIntString(),
client.Player.Dead.ToIntString(), client.Player.GuildName, ((int)client.Player.GuildAccess).ToString(),
client.Player.Solid.ToIntString(), client.Player.Status, client.Player.GetActiveRecruit().Confused.ToIntString(),
((int)client.Player.GetActiveRecruit().StatusAilment).ToString(), ((int)client.Player.SpeedLimit).ToString(),
mobility.ToString(), client.Player.GetActiveRecruit().TimeMultiplier.ToString(),
recruit.Darkness.ToString());
myPacket.AppendParameter(client.Player.GetActiveRecruit().VolatileStatus.Count);
for (int j = 0; j < client.Player.GetActiveRecruit().VolatileStatus.Count; j++) {
myPacket.AppendParameter(client.Player.GetActiveRecruit().VolatileStatus[j].Emoticon);
}
packetList.AddPacket(client, myPacket);
}
}