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


C# Player.SendError方法代码示例

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


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

示例1: Process

 protected override bool Process(Player player, RealmTime time, string args)
 {
     if (player.HasConditionEffect(ConditionEffects.Paused))
     {
         player.ApplyConditionEffect(new ConditionEffect()
         {
             Effect = ConditionEffectIndex.Paused,
             DurationMS = 0
         });
         player.SendInfo("Game resumed.");
         return true;
     }
     else
     {
         if (player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>().Any())
         {
             player.SendError("Not safe to pause.");
             return false;
         }
         else
         {
             player.ApplyConditionEffect(new ConditionEffect()
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = -1
             });
             player.SendInfo("Game paused.");
             return true;
         }
     }
 }
开发者ID:patrick323,项目名称:rotmg_svr,代码行数:31,代码来源:WorldCommand.cs

示例2: Execute

 public void Execute(Player player, string[] args)
 {
     if (args.Length == 0)
     {
         player.SendHelp("Usage: /addeff <effect name or effect number>");
     }
     else
     {
         try
         {
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = (ConditionEffectIndex) Enum.Parse(typeof (ConditionEffectIndex), args[0].Trim(), true),
                 DurationMS = -1
             });
             {
                 player.SendInfo("Success!");
             }
         }
         catch
         {
             player.SendError("Invalid effect!");
         }
     }
 }
开发者ID:RoxyLalonde,项目名称:Phoenix-Realms,代码行数:25,代码来源:AdminCommands.cs

示例3: Process

 protected override bool Process(Player player, RealmTime time, string[] args)
 {
     if (args.Length == 0)
     {
         player.SendHelp("Usage: /addeff <Effectname or Effectnumber>");
         return false;
     }
     try
     {
         player.ApplyConditionEffect(new ConditionEffect
         {
             Effect = (ConditionEffectIndex)Enum.Parse(typeof(ConditionEffectIndex), args[0].Trim(), true),
             DurationMS = -1
         });
         {
             player.SendInfo("Success!");
         }
     }
     catch
     {
         player.SendError("Invalid effect!");
         return false;
     }
     return true;
 }
开发者ID:SirAnuse,项目名称:fabiano-swagger-of-doom,代码行数:25,代码来源:AdminCommands.cs

示例4: Execute

        public bool Execute(Player player, RealmTime time, string args)
        {
            if (!HasPermission(player))
            {
                player.SendError("No permission!");
                return false;
            }

            try
            {
                return Process(player, time, args);
            }
            catch
            {
                player.SendError("Error when executing the command.");
                return false;
            }
        }
开发者ID:patrick323,项目名称:rotmg_svr,代码行数:18,代码来源:Command.cs

示例5: Pet

        public Pet(RealmManager manager, PetItem petData, Player playerOwner)
            : base(manager, (ushort)petData.Type, true, true)
        {
            rand = new Random();
            PlayerOwner = playerOwner;
            Info = petData;

            try
            {
                if (petData.InstanceId != -1)
                {
                    FirstPetLevel = new PetLevel(AbilityType.First,
                        Utils.GetEnumByName<Ability>(Utils.GetEnumName<Ability>(petData.Abilities[0].Type)),
                        petData.Abilities[0].Points, petData.Abilities[0].Power, this);

                    SecondPetLevel = new PetLevel(AbilityType.Second,
                        Utils.GetEnumByName<Ability>(Utils.GetEnumName<Ability>(petData.Abilities[1].Type)),
                        petData.Abilities[1].Points, petData.Abilities[1].Power, this);

                    ThirdPetLevel = new PetLevel(AbilityType.Third,
                        Utils.GetEnumByName<Ability>(Utils.GetEnumName<Ability>(petData.Abilities[2].Type)),
                        petData.Abilities[2].Points, petData.Abilities[2].Power, this);

                    Size = manager.GameData.TypeToPet[(ushort)petData.Type].Size;
                    PetRarity = (Rarity)petData.Rarity;
                    PetFamily = manager.GameData.TypeToPet[(ushort)petData.Type].PetFamily;
                    MaximumLevel = petData.MaxAbilityPower;
                    UpdateNeeded = true;
                }
                Skin = petData.SkinName;
                SkinId = petData.Skin;
                PetId = petData.InstanceId;
                IsPet = true;
            }
            catch (Exception e)
            {
                if (PlayerOwner != null)
                    PlayerOwner.SendError(
                        String.Format(
                            "An error ocurred while loading your pet data, please report this to an Admin: {0}",
                            e.Message));
            }
        }
开发者ID:OryxAwakening,项目名称:Fabiano_Swagger_of_Doom,代码行数:43,代码来源:Pet.cs

示例6: Execute

 public void Execute(Player player, string[] args)
 {
     if (player.GuildRank == 40)
     {
         foreach (var i in RealmManager.Worlds)
         {
             if (i.Key != 0)
             {
                 foreach (var e in i.Value.Players)
                 {
                     if (e.Value.Client.Account.Name.ToLower() == args[0].ToLower())
                     {
                         if (e.Value.Client.Account.Guild.Rank == 40)
                         {
                             player.SendInfo(e.Value.Client.Account.Name + " has been invited to ally with your guild!");
                             e.Value.Client.SendPacket(new GuildAllyRequestPacket
                             {
                                 Name = player.Client.Account.Name,
                                 Guild = player.Client.Account.Guild.Name
                             });
                         }
                         else
                         {
                             player.SendError(e.Value.Client.Account.Guild.Name + " is already one of your allys!");
                         }
                     }
                 }
             }
         }
     }
     else
     {
         {
             player.SendInfo("Only founders can ally with other guilds!");
         }
     }
 }
开发者ID:RoxyLalonde,项目名称:Phoenix-Realms,代码行数:37,代码来源:GuildCommands.cs

示例7: Execute

        public void Execute(Player player, string[] args)
        {
            if (args.Length == 0)
            {
                player.SendHelp("Usage: /give <Itemname>");
            }
            else
            {
                string name = string.Join(" ", args.ToArray()).Trim();
                short objType;
                //creates a new case insensitive dictionary based on the XmlDatas
                Dictionary<string, short> icdatas = new Dictionary<string, short>(XmlDatas.IdToType, StringComparer.OrdinalIgnoreCase);
                if (!icdatas.TryGetValue(name, out objType))
                {
                    player.SendError("Unknown type!");
                    return;
                }
                if (!XmlDatas.ItemDescs[objType].Secret || player.Client.Account.Rank >= 4)
                {
                    for (int i = 0; i < player.Inventory.Length; i++)
                        if (player.Inventory[i] == null)
                        {
                            player.Inventory[i] = XmlDatas.ItemDescs[objType];
                            player.UpdateCount++;

                            player.SendInfo("Success!");
                            return;
                        }
                }
                else
                {
                    player.SendError("Item cannot be given!");
                }

            }
        }
开发者ID:noob2137,项目名称:RotMGServerTest,代码行数:36,代码来源:AdminCommands.cs

示例8: Execute

 public void Execute(Player player, string[] args)
 {
     if (player.Owner.Name != "Battle Arena" && player.Owner.Name != "Free Battle Arena")
         if (player.HasConditionEffect(ConditionEffects.Paused))
         {
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = 0
             });
             player.SendInfo("Game resumed.");
         }
         else
         {
             if (
                 player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 6)
                     .OfType<Enemy>()
                     .Any(i => i.ObjectDesc.Enemy))
             {
                 player.SendInfo("Not safe to pause.");
                 return;
             }
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = -1
             });
             player.SendInfo("Game paused.");
         }
     else
         player.SendError("You cannot pause in the arena");
 }
开发者ID:BlackRayquaza,项目名称:PhoenixRealms,代码行数:32,代码来源:WorldCommand.cs


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