本文整理汇总了C#中Zepheus.Zone.Networking.ZoneClient.SendPacket方法的典型用法代码示例。如果您正苦于以下问题:C# ZoneClient.SendPacket方法的具体用法?C# ZoneClient.SendPacket怎么用?C# ZoneClient.SendPacket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zepheus.Zone.Networking.ZoneClient
的用法示例。
在下文中一共展示了ZoneClient.SendPacket方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendPartyInformation
public static void SendPartyInformation(ZoneClient client)
{
if (Program.Entity.Parties.Where(c => c.CharNo == client.Character.ID).Count() == 1)
{
Party PartyNo = Program.Entity.Parties.First(c => c.CharNo == client.Character.ID);
foreach (Party party in Program.Entity.Parties.Where(c => c.PartyNo == PartyNo.PartyNo))
{
Character Pcharacter = Program.Entity.Characters.First(c => c.ID == party.CharNo);
ZoneClient otherLiveInfo = ClientManager.Instance.GetClientByName(Pcharacter.Name);
if (otherLiveInfo != null)
{
if (otherLiveInfo.Character.MapID == client.Character.MapID)
{
using (var ppacket = new Packet(SH14Type.PartyInformationShort))
{
ppacket.WriteByte(1);
ppacket.WriteString(otherLiveInfo.Character.Name, 16);
ppacket.WriteUInt(otherLiveInfo.Character.HP);
ppacket.WriteUInt(otherLiveInfo.Character.SP);
ppacket.WriteUInt(otherLiveInfo.Character.LP);
client.SendPacket(ppacket);
}
using (var ppacket = new Packet(SH14Type.PartyInformation))
{
ppacket.WriteByte(1); //unk
ppacket.WriteString(otherLiveInfo.Character.Name, 16);
ppacket.WriteByte((byte)otherLiveInfo.Character.Job);
ppacket.WriteByte(otherLiveInfo.Character.Level);
ppacket.WriteUInt(otherLiveInfo.Character.HP);
ppacket.WriteUInt(otherLiveInfo.Character.SP);
ppacket.WriteUInt(otherLiveInfo.Character.LP);
ppacket.WriteByte(1); //unk
client.SendPacket(ppacket);
}
using (var ppacket = new Packet(SH14Type.PartyLoginCord))
{
ppacket.WriteByte(1); //unk
ppacket.WriteString(otherLiveInfo.Character.Name, 16);
ppacket.WriteInt(otherLiveInfo.Character.Position.X);
ppacket.WriteInt(otherLiveInfo.Character.Position.Y);
client.SendPacket(ppacket);
}
}
}
}
}
}
示例2: SendPing
public static void SendPing(ZoneClient character)
{
using (var packet = new Packet(SH2Type.Ping))
{
character.SendPacket(packet);
}
}
示例3: SendError
public static void SendError(ZoneClient client, ServerError error)
{
using (Packet pack = new Packet(SH3Type.Error))
{
pack.WriteShort((byte)error);
client.SendPacket(pack);
}
}
示例4: UseHPStoneHandler
public static void UseHPStoneHandler(ZoneClient client, Packet packet)
{
if (client.Character.StonesHP == 0)
{
using (var p = new Packet(SH20Type.ErrorUseStone))
{
client.SendPacket(p);
}
}
else
{
client.Character.HealHP((uint)client.Character.BaseStats.SoulHP);
using (var p = new Packet(SH20Type.StartHPStoneCooldown))
{
client.SendPacket(p);
}
}
}
示例5: BuySPStonesFromNPC
public static void BuySPStonesFromNPC(ZoneClient client, Packet packet)
{
short amount;
ZoneCharacter character = client.Character;
if (!packet.TryReadShort(out amount))
{
Log.WriteLine(LogLevel.Debug, "BuySPStones :: Got unknown amount from {0}", character.Name);
}
using (var ppacket = new Packet(SH20Type.ChangeSPStones))
{
using (var pppacket = new Packet(SH4Type.MoneyChange))
{
character.BuySPStones(ppacket, pppacket, amount);
client.SendPacket(ppacket);
client.SendPacket(pppacket);
}
}
}
示例6: MasterRequestCoper
public static void MasterRequestCoper(ZoneClient client, Packet pPacket)
{
byte unk;
if (!pPacket.TryReadByte(out unk))
return;
using (var packet = new Packet(SH37Type.SendRecivveCopper))
{
packet.WriteUShort(7264);//unk
packet.WriteLong(client.Character.Character.ReviveCoper);
client.SendPacket(packet);
}
}
示例7: MasterRequestAcceptCoper
public static void MasterRequestAcceptCoper(ZoneClient client, Packet pPacket)
{
client.Character.Character.ReviveCoper = 0;
InterServer.InterHandler.SendReciveCoper(client.Character.Character.Name, client.Character.Character.ReviveCoper,true);
using(var packet = new Packet(37,65))
{
packet.WriteUShort(7272);//unk
packet.WriteLong(client.Character.RecviveCoper);
client.SendPacket(packet);
}
}
示例8: HandleTrade
public static void HandleTrade(ZoneClient client, Packet packet)
{
ushort PlayerObjID;
if (!packet.TryReadUShort(out PlayerObjID))
{
Packet ppacket = new Packet(SH19Type.TradeNotAccepted);
ppacket.WriteUShort(client.Character.MapObjectID);
client.SendPacket(ppacket);
Log.WriteLine(LogLevel.Error, "TradeRequest :: Invalid Obj ID from {0}", client.Character.Name);
}
SendTradeRequest(client, PlayerObjID);
}
示例9: BySPStoneHandler
public static void BySPStoneHandler(ZoneClient client, Packet packet)
{
short Amount;
if (packet.TryReadShort(out Amount))
{
client.Character.ChangeMoney(client.Character.Character.Money -= client.Character.BaseStats.PriceSPStone);
short Am = Amount += client.Character.StonesSP;
client.Character.StonesHP = Am;
using (var p = new Packet(SH20Type.ChangeSPStones))
{
p.WriteShort(Am);
client.SendPacket(p);
}
}
}
示例10: SendMoveIteminContaInComplet
public static void SendMoveIteminContaInComplet(ZoneClient pClient)
{
using (var packet = new Packet(SH12Type.MoveIteminContaInComplet))
{
packet.WriteUShort(577);
pClient.SendPacket(packet);
}
}
示例11: UseTeleporter
public static void UseTeleporter(ZoneClient client, Packet packet)
{
byte anwser;
if (packet.TryReadByte(out anwser))
{
using (Packet Packet = new Packet(SH6Type.TelePorter))
{
Packet.WriteShort(6593);//code for normal teleport
client.SendPacket(Packet);
}
switch (anwser)
{
case 0:
client.Character.ChangeMap(0, 4199, 4769);//Roumen
break;
case 1:
client.Character.ChangeMap(9, 11802, 10466);//Eldrine
break;
case 2:
client.Character.ChangeMap(75, 9069, 9312);//EldGbl02
break;
case 3:
client.Character.ChangeMap(5,13658,7812);//RouVal01
break;
default:
Log.WriteLine(LogLevel.Warn,"Unkown Teleport Answer {1}",anwser);
break;
}
}
}
示例12: SendTradeAgreepTo
private void SendTradeAgreepTo(ZoneClient pClient)
{
using (var packet = new Packet(SH19Type.SendTradeAgreeTo))
{
pClient.SendPacket(packet);
}
}
示例13: SendTradeAddItemMe
private void SendTradeAddItemMe(ZoneClient pClient,byte pSlot,byte TradeSlot)
{
using (var packet = new Packet(SH19Type.SendAddItemSuccefull))
{
packet.WriteByte(pSlot);
packet.WriteByte(TradeSlot);
pClient.SendPacket(packet);
}
}
示例14: SendUsablePoints
public static void SendUsablePoints(ZoneClient client)
{
using (var packet = new Packet(SH4Type.CharacterPoints))
{
packet.WriteByte(client.Character.Character.UsablePoints);
client.SendPacket(packet);
}
}
示例15: SendSetUsablePoint
public static void SendSetUsablePoint(ZoneClient client, byte stat)
{
using (var packet = new Packet(SH4Type.SetPointOnStat))
{
packet.WriteByte(stat); // amount
client.SendPacket(packet);
}
}