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


C# World.SendImPacket方法代码示例

本文整理汇总了C#中World.SendImPacket方法的典型用法代码示例。如果您正苦于以下问题:C# World.SendImPacket方法的具体用法?C# World.SendImPacket怎么用?C# World.SendImPacket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在World的用法示例。


在下文中一共展示了World.SendImPacket方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SavePosition

 public static void SavePosition(World.Network.WorldClient client, int mapid)
 {
     Database.Records.ZaapRecord zaap = Helper.ZaapHelper.GetZaap(mapid);
     if (zaap != null)
     {
         if (client.Character.SaveMap == mapid)
             return;
         client.Character.SaveMap = mapid;
         client.Character.SaveCell = zaap.CellID;
         client.SendImPacket("06");
         client.Character.SaveAndFlush();
     }
 }
开发者ID:nightwolf93,项目名称:Crystal,代码行数:13,代码来源:ZaapHandler.cs

示例2: ChatMessage

        public static void ChatMessage(World.Network.WorldClient client, string packet)
        {
            string[] data = packet.Substring(2).Split('|');
            string channel = data[0];
            string message = data[1];
            if (message.Length > 300)
                return;
            if (client.Action.LastGlobalMessage > Environment.TickCount)
                return;
            client.Action.LastGlobalMessage = Environment.TickCount + 3000;
            if (World.Manager.WorldManager.MutedAccount.Contains(client.Account.Username))
            {
                client.Action.SystemMessage("Impossible de parler ! Veuilliez contacter un administrateur via le site !");
                return;
            }
            switch (channel)
            {
                case Enums.ChannelEnum.Default:
                    if (message.StartsWith("."))
                    {
                        string[] command = message.Split(' ');
                        PlayerCommandExecute(command[0].Substring(1), command, client);
                    }
                    else if (message.StartsWith("!"))
                    {
                        if (client.Account.AdminLevel > 0)
                        {
                            string[] command = message.Split(' ');
                            AdminCommand(client, "BA" + message.Substring(1));
                        }
                        else
                        {
                            client.Action.SystemMessage("Vous n'avez pas les permissions pour executer les commandes Admin !");
                        }
                    }
                    else
                    {
                        if (client.Action.LastMessage != message)
                        {
                            if (client.Character.Fighter != null)
                            {
                                client.Character.Fighter.Team.Fight.Send("cMK|" + client.Character.ID + "|" + client.Character.Nickname + "|" + message);
                            }
                            else
                            {
                                client.Character.Map.Engine.Send("cMK|" + client.Character.ID + "|" + client.Character.Nickname + "|" + message);
                            }
                            client.Action.LastMessage = message;
                        }
                        else
                        {
                            client.SendImPacket("184");
                        }
                    }
                    break;

                case Enums.ChannelEnum.Trade:
                    if (client.Action.LastMessage != message)
                    {
                        if (client.Character.Level >= Utilities.ConfigurationManager.GetIntValue("MinLevelToSpeakInWorldChannel"))
                        {

                            if (Environment.TickCount > client.Action.LastTradeMessage)
                            {
                                SendChatMessageToAll(World.Helper.WorldHelper.GetClientsArray.ToList(), Enums.ChannelEnum.Trade,
                                    "cMK" + Enums.ChannelEnum.Trade + "|" + client.Character.ID + "|" + client.Character.Nickname + "|" + message);
                                client.Action.LastMessage = message;
                                client.Action.LastTradeMessage = Environment.TickCount + Utilities.ConfigurationManager.GetIntValue("TradeMessageInterval");
                            }
                            else
                            {
                                client.Action.SystemMessage("Veuilliez attendre encore un peu avant de pouvoir parler !");
                            }

                        }
                        else
                        {
                            client.SendImPacket("0157", Utilities.ConfigurationManager.GetIntValue("MinLevelToSpeakInWorldChannel").ToString());
                        }
                    }
                    else
                    {
                        client.SendImPacket("184");
                    }
                    break;

                case Enums.ChannelEnum.Recruitment:
                    if (client.Action.LastMessage != message)
                    {
                        if (client.Character.Level >= Utilities.ConfigurationManager.GetIntValue("MinLevelToSpeakInWorldChannel"))
                        {

                            if (Environment.TickCount > client.Action.LastRecruitementMessage)
                            {
                                SendChatMessageToAll(World.Helper.WorldHelper.GetClientsArray.ToList(), Enums.ChannelEnum.Recruitment,
                                    "cMK" + Enums.ChannelEnum.Recruitment + "|" + client.Character.ID + "|" + client.Character.Nickname + "|" + message);
                                client.Action.LastMessage = message;
                                client.Action.LastRecruitementMessage = Environment.TickCount + Utilities.ConfigurationManager.GetIntValue("RecruitementMessageInterval");
                            }
                            else
//.........这里部分代码省略.........
开发者ID:nightwolf93,项目名称:Crystal,代码行数:101,代码来源:BasicHandler.cs

示例3: WantAwayMode

 public static void WantAwayMode(World.Network.WorldClient client, string packet)
 {
     if (!client.Action.Away)
     {
         client.Action.Away = true;
         client.SendImPacket("037");
     }
     else
     {
         client.Action.Away = false;
         client.SendImPacket("038");
     }
 }
开发者ID:nightwolf93,项目名称:Crystal,代码行数:13,代码来源:BasicHandler.cs

示例4: UseZaap

 public static void UseZaap(World.Network.WorldClient client, string packet)
 {
     int map = int.Parse(packet.Substring(2));
     Database.Records.ZaapRecord zaap = Helper.ZaapHelper.GetZaap(map);
     if (zaap != null)
     {
         int price = GetPriceOfTravel(map, client.Character.MapID);
         if (price <= client.Character.Kamas)
         {
             client.Action.RemoveKamas(price);
             Network.World.GoToMap(client, zaap.MapID, zaap.CellID);
             CloseZaapPanel(client);
         }
         else
         {
             client.SendImPacket("1128");
         }
     }
     else
     {
         client.Action.SystemMessage("Le zaap demander est inexistant !");
     }
 }
开发者ID:nightwolf93,项目名称:Crystal,代码行数:23,代码来源:ZaapHandler.cs


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