當前位置: 首頁>>代碼示例>>C#>>正文


C# ZoneClient.SendPacket方法代碼示例

本文整理匯總了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);
                            }
                        }
                    }
                }
            }
        }
開發者ID:Canic,項目名稱:Zepheus_2k15,代碼行數:49,代碼來源:Handler14.cs

示例2: SendPing

 public static void SendPing(ZoneClient character)
 {
     using (var packet = new Packet(SH2Type.Ping))
     {
         character.SendPacket(packet);
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:7,代碼來源:Handler2.cs

示例3: SendError

 public static void SendError(ZoneClient client, ServerError error)
 {
     using (Packet pack = new Packet(SH3Type.Error))
     {
         pack.WriteShort((byte)error);
         client.SendPacket(pack);
     }
 }
開發者ID:diamondo25,項目名稱:Zepheus_Fiesta,代碼行數:8,代碼來源:Handler3.cs

示例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);
                }
            }
        }
開發者ID:Canic,項目名稱:Zepheus_2k15,代碼行數:19,代碼來源:Handler20.cs

示例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);
                }
            }
        }
開發者ID:Canic,項目名稱:Zepheus_2k15,代碼行數:19,代碼來源:Handler20.cs

示例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);
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:12,代碼來源:Handler37.cs

示例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);
             }
        }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:12,代碼來源:Handler37.cs

示例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);
        }
開發者ID:Canic,項目名稱:Zepheus_2k15,代碼行數:13,代碼來源:Handler19.cs

示例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);
         }
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:15,代碼來源:Handler20.cs

示例10: SendMoveIteminContaInComplet

 public static void SendMoveIteminContaInComplet(ZoneClient pClient)
 {
     using (var packet = new Packet(SH12Type.MoveIteminContaInComplet))
     {
         packet.WriteUShort(577);
         pClient.SendPacket(packet);
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:8,代碼來源:Handler12.cs

示例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;
                }
            }
        }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:33,代碼來源:Handler6.cs

示例12: SendTradeAgreepTo

 private void SendTradeAgreepTo(ZoneClient pClient)
 {
     using (var packet = new Packet(SH19Type.SendTradeAgreeTo))
     {
         pClient.SendPacket(packet);
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:7,代碼來源:Trade.cs

示例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);
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:9,代碼來源:Trade.cs

示例14: SendUsablePoints

 public static void SendUsablePoints(ZoneClient client)
 {
     using (var packet = new Packet(SH4Type.CharacterPoints))
     {
         packet.WriteByte(client.Character.Character.UsablePoints);
         client.SendPacket(packet);
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:8,代碼來源:Handler4.cs

示例15: SendSetUsablePoint

 public static void SendSetUsablePoint(ZoneClient client, byte stat)
 {
     using (var packet = new Packet(SH4Type.SetPointOnStat))
     {
         packet.WriteByte(stat); // amount
         client.SendPacket(packet);
     }
 }
開發者ID:Dextan,項目名稱:Estrella,代碼行數:8,代碼來源:Handler4.cs


注:本文中的Zepheus.Zone.Networking.ZoneClient.SendPacket方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。