当前位置: 首页>>代码示例>>C#>>正文


C# Networking.ZoneClient类代码示例

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


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


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