• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Networking.ZoneClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Zepheus.Zone.Networking.ZoneClient的典型用法代码示例。如果您正苦于以下问题:C# ZoneClient类的具体用法?C# ZoneClient怎么用?C# ZoneClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ZoneClient类属于Zepheus.Zone.Networking命名空间,在下文中一共展示了ZoneClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: HandleSetStatPoint

        public static void HandleSetStatPoint(ZoneClient client, Packet packet)
        {
            byte stat;
            if (!packet.TryReadByte(out stat))
            {
                Log.WriteLine(LogLevel.Warn, "Couldn't read HandleSetStatPoint packet. {0}", client);
                return;
            }

            if (client.Character.Character.UsablePoints == 0)
            {
                Log.WriteLine(LogLevel.Warn, "User tried to set stat point while not having any left. {0}", client);
            }
            else
            {
                // LETS DO ET
                switch (stat)
                {
                    case 0: client.Character.Str++; break;
                    case 1: client.Character.Dex++; break;
                    case 2: client.Character.End++; break;
                    case 3: client.Character.Int++; break;
                    case 4: client.Character.Spr++; break;
                    default:
                        {
                            Log.WriteLine(LogLevel.Warn, "User tried to set stat point on unknown stat {0} {1}", stat, client);
                            return;
                        }
                }
                client.Character.Character.UsablePoints--;
                //Program.Entity.SaveChanges();
                SendSetUsablePoint(client, stat);
            }
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:34,代码来源:Handler4.cs


示例2: EquipHandler

 public static void EquipHandler(ZoneClient client, Packet packet)
 {
     sbyte slot;
     if (!packet.TryReadSByte(out slot))
     {
         Log.WriteLine(LogLevel.Warn, "Error reading equipping slot.");
         return;
     }
     Item item;
     if (client.Character.InventoryItems.TryGetValue(slot, out item))
     {
         if (item is Equip)
         {
             if (((Equip)item).Info.Level > client.Character.Level)
             {
                 FailedEquip(client.Character, 645); // 85 02
             }
             else
             {
                 client.Character.EquipItem((Equip)item);
             }
         }
         else
         {
             FailedEquip(client.Character);
             Log.WriteLine(LogLevel.Warn, "{0} equippped an item. What a moron.", client.Character.Name);
         }
     }
 }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:29,代码来源:Handler12.cs


示例3: ClientReadyHandler

        public static void ClientReadyHandler(ZoneClient client, Packet packet)
        {
            if (client.Admin > 0)
            {
                client.Character.DropMessage("AdminLevel = {0}; ClientLoad = {1};", client.Admin, ClientManager.Instance.ZoneLoad);
            }

            Handler4.SendUsablePoints(client);

            if (!client.Character.IsDead)
            {
                // Just logged on.
                client.Character.Map.FinalizeAdd(client.Character);
            }
            else
            {
                // Reviving, not readding for this one!
                MapInfo mi;
                if (DataProvider.Instance.MapsByID.TryGetValue(client.Character.MapID, out mi))
                {
                    client.Character.State = PlayerState.Normal;
                    client.Character.Map.SendCharacterLeftMap(client.Character, false);
                    client.Character.Position.X = mi.RegenX;
                    client.Character.Position.Y = mi.RegenY;
                    client.Character.Map.SendCharacterEnteredMap(client.Character);
                }
                client.Character.SetHP(client.Character.MaxHP / 4);
            }
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:29,代码来源:Handler6.cs


示例4: TradeAgree

        public static void TradeAgree(ZoneClient pClient, Packet pPacket)
        {
            if (pClient.Character.Trade == null)
                return;

            pClient.Character.Trade.AcceptTrade(pClient.Character);
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:7,代码来源:Handler19.cs


示例5: SendPing

 public static void SendPing(ZoneClient character)
 {
     using (var packet = new Packet(SH2Type.Ping))
     {
         character.SendPacket(packet);
     }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:7,代码来源:Handler2.cs


示例6: SendPartyMemberCordChange

 public static void SendPartyMemberCordChange(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))
         {
             using (var ppacket = new Packet(SH14Type.PartyLoginCord))
             {
                 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)
                     {
                         ppacket.WriteByte(1); //unk
                         ppacket.WriteString(client.Character.Name, 16);
                         ppacket.WriteInt(client.Character.Position.X);
                         ppacket.WriteInt(client.Character.Position.Y);
                         otherLiveInfo.SendPacket(ppacket);
                     }
                 }
             }
         }
     }
 }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:26,代码来源:Handler14.cs


示例7: TradeLock

 public static void TradeLock(ZoneClient pClient, Packet pPacket)
 {
     if (pClient.Character.Trade != null)
     {
         pClient.Character.Trade.TradeLock(pClient.Character);
     }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:7,代码来源:Handler19.cs


示例8: AddTradeRequest

 public void AddTradeRequest(ZoneClient pClient,ushort  MapObjectIDto)
 {
     Log.WriteLine(LogLevel.Debug, "{0} AddTradeReqest {1}", pClient.Character.Character.Name, MapObjectIDto);
        TradeReqest pRequest = new TradeReqest(pClient.Character, MapObjectIDto);
        this.TradeReqests.Add(pRequest);
        SendTradeRequest(pRequest);
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:7,代码来源:TradeManager.cs


示例9: ClientReadyHandler

        public static void ClientReadyHandler(ZoneClient client, Packet packet)
        {
            Handler4.SendUsablePoints(client);

            if (!client.Character.IsDead)
            {
                // Just logged on.
                client.Character.Map.FinalizeAdd(client.Character);

                //Handler27.SendGameMessage(client.Character, "GAMEPLAY NOT FINAL :: WELCOME TO OSMO, " + client.Character.Name.ToUpper(), "Universal_2");
                Handler9.SendUpdateHP(client.Character);
                Handler9.SendUpdateSP(client.Character);

                if (client.Character.Job == Job.Crusader)
                {
                    Handler9.SendUpdateLP(client.Character);
                }

                Handler14.SendPartyInformation(client);
            }
            else
            {
                // Reviving, not readding for this one!
                MapInfo mi;
                if (DataProvider.Instance.MapsByID.TryGetValue(client.Character.MapID, out mi))
                {
                    client.Character.State = PlayerState.Normal;
                    client.Character.Map.SendCharacterLeftMap(client.Character, false);
                    client.Character.Position.X = mi.RegenX;
                    client.Character.Position.Y = mi.RegenY;
                    client.Character.Map.SendCharacterEnteredMap(client.Character);
                }
                client.Character.SetHP(client.Character.MaxHP / 4);
            }
        }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:35,代码来源:Handler6.cs


示例10: SelectObjectHandler

        public static void SelectObjectHandler(ZoneClient client, Packet packet)
        {
            ushort id;
            if (!packet.TryReadUShort(out id))
            {
                Log.WriteLine(LogLevel.Warn, "Could not read entity select request.");
                return;
            }

            MapObject mo;
            // Try to see if there is a map object with this ID
            if (!client.Character.Map.Objects.TryGetValue(id, out mo))
            {
                client.Character.CharacterInTarget = mo;
                return; // Nothing found. Just return lawl
            }

            mo.SelectedBy.Add(client.Character);

            if (mo is ZoneCharacter || mo is Mob)
            {
                client.Character.SelectedObject = mo;
                SendStatsUpdate(mo, client, false);
            }
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:25,代码来源:Handler9.cs


示例11: TradeReqest

 public static void TradeReqest(ZoneClient pClient, Packet pPacket)
 {
     ushort MapObjectID;
     if (!pPacket.TryReadUShort(out MapObjectID))
         return;
     TradeManager.Instance.AddTradeRequest(pClient, MapObjectID);
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:7,代码来源:Handler19.cs


示例12: OnClientConnect

        public override void OnClientConnect(Socket socket)
        {
            ZoneClient client = new ZoneClient(socket);

             //  ClientManager.Instance.AddClient(client); //They register once authenticated now
            Log.WriteLine(LogLevel.Debug, "Client connected from {0}", client.Host);
               // ClientManager.Instance.AddClient(client); //They register once authenticated now
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:8,代码来源:ZoneAcceptor.cs


示例13: TradeBreak

        public static void TradeBreak(ZoneClient pClient, Packet pPacket)
        {
            if (pClient.Character.Trade == null)
                return;

            pClient.Character.Trade.TradeBreak(pClient.Character);
            pClient.Character.Trade = null;
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:8,代码来源:Handler19.cs


示例14: DeselectObjectHandler

 public static void DeselectObjectHandler(ZoneClient client, Packet packet)
 {
     if (client.Character.SelectedObject != null)
     {
         client.Character.SelectedObject.SelectedBy.Remove(client.Character);
         client.Character.SelectedObject = null;
     }
 }
开发者ID:Zepheus,项目名称:Zepheus_Fiesta,代码行数:8,代码来源:Handler9.cs


示例15: RemoveReqest

 public void RemoveReqest(ZoneClient pClient)
 {
     TradeReqest Request = TradeReqests.Find(r => r.MapID == pClient.Character.MapID && r.pToTradeClient.MapObjectID== pClient.Character.MapObjectID);
        if (TradeReqests.Contains(Request))
        {
        TradeReqests.Remove(Request);
        }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:8,代码来源:TradeManager.cs


示例16: 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


示例17: BackTo

 public static void BackTo(ZoneClient client, Packet packet)
 {
     using(var iacket = new InterPacket(InterHeader.ClientDisconect))
     {
         iacket.WriteString(client.Character.Character.Name, 16);
         InterServer.WorldConnector.Instance.SendPacket(iacket);
     }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:8,代码来源:Handler3.cs


示例18: AcceptTrade

 public void AcceptTrade(ZoneClient pClient)
 {
     TradeReqest Request = GetTradeRquestByChar(pClient.Character);
     if (Request != null)
     {
     TradeReqests.Remove(Request);
     Trade pTrade = new Trade(Request.pFromTradeClient, pClient.Character);
     }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:9,代码来源:TradeManager.cs


示例19: SendTradeRequest

 public static void SendTradeRequest(ZoneClient client, ushort ObjID)
 {
     using(var packet = new Packet(SH19Type.TradeRequest))
     {
         ZoneClient otherclient = ClientManager.Instance.GetClientByObj(ObjID);
         packet.WriteUShort(client.Character.MapObjectID);
         otherclient.SendPacket(packet);
     }
 }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:9,代码来源:Handler19.cs


示例20: TradeRemovitem

 public static void TradeRemovitem(ZoneClient pClient, Packet pPacket)
 {
     byte pSlot;
     if (!pPacket.TryReadByte(out pSlot))
         return;
     if (pClient.Character.Trade == null)
         return;
     pClient.Character.Trade.RemoveItemToHandel(pClient.Character, pSlot);
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:9,代码来源:Handler19.cs



注:本文中的Zepheus.Zone.Networking.ZoneClient类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Record.RecordInputStream类代码示例发布时间:2022-05-26
下一篇:
C# Game.ZoneCharacter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap