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


C# Player.SendHelp方法代码示例

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


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

示例1: Process

 protected override bool Process(Player player, RealmTime time, string args)
 {
     if (player.Guild != "")
         try
         {
             var saytext = string.Join(" ", args);
             if ((from w in player.Manager.Worlds let world = w.Value where w.Key != 0 from i in world.Players.Where(i => i.Value.Guild == player.Guild) select world).Any())
             {
                 if (saytext.Equals(" ") || saytext == "")
                 {
                     player.SendHelp("Usage: /guild <text>");
                     return false;
                 }
                 player.Manager.Chat.SayGuild(player, saytext.ToSafeText());
                 return true;
             }
         }
         catch(Exception e)
         {
             player.SendError(e.ToString());
             player.SendInfo("Cannot guild chat!");
             return false;
         }
     else
         player.SendInfo("You need to be in a guild to use guild chat!");
     return false;
 }
开发者ID:Club559,项目名称:Travs-Domain-Server,代码行数:27,代码来源:GuildCommands.cs

示例2: Process

        protected override bool Process(Player player, RealmTime time, string args)
        {
            Command[] cmds = player.Manager.Commands.Commands.Values
                .Where(x => x.HasPermission(player))
                .ToArray();

            int curPage = (args != "") ? Convert.ToInt32(args) : 1;
            double maxPage = Math.Floor((double) cmds.Length/10);

            if (curPage > maxPage + 1)
                curPage = (int) maxPage + 1;
            if (curPage < 1)
                curPage = 1;

            var sb = new StringBuilder(string.Format("Commands <Page {0}/{1}>: \n", curPage, maxPage + 1));

            int y = (curPage - 1) * 10;
            int z = y + 10;

            int commands = cmds.Length;
            if (z > commands)
            {
                z = commands;
            }

            for (int i = y; i < z; i++)
            {
                sb.Append(string.Format("[/{0}{1}]{2}", cmds[i].CommandName, (cmds[i].CommandUsage != "" ? " " + cmds[i].CommandUsage : null), (cmds[i].CommandDesc != "" ? ": " + cmds[i].CommandDesc : null)) + "\n");
            }
            player.SendHelp(sb.ToString());
            return true;
        }
开发者ID:Club559,项目名称:Travs-Domain-Server,代码行数:32,代码来源:WorldCommand.cs

示例3: Process

 protected override bool Process(Player player, RealmTime time, string args)
 {
     if (args.Length == 0)
     {
         player.SendHelp("Usage: /announce <saytext>");
         return false;
     }
     foreach (var client in player.Manager.Clients.Values)
         client.Player.SendText("@Announcement", args);
     return true;
 }
开发者ID:sebastianfra12,项目名称:Classic-Realm,代码行数:11,代码来源:AdminCommands.cs

示例4: Buy

 public override void Buy(Player player)
 {
     player.Manager.Data.AddPendingAction(db =>
     {
         if (db.GetGuild(db.GetGuildId(player.Guild)).GuildFame >= Price)
         {
             player.Client.SendPacket(new BuyResultPacket
             {
                 Message = "Upgrade successful! Please leave the Guild Hall to have it upgraded",
                 Result = 0
             });
         }
         else
         {
             player.SendHelp("FUCK");
             player.Client.SendPacket(new BuyResultPacket
             {
                 Message = "Not enough Guild Fame!",
                 Result = 9
             });
         }
     });
     base.Buy(player);
 }
开发者ID:Club559,项目名称:Travs-Domain-Server,代码行数:24,代码来源:GuildMerchant.cs

示例5: Process

        protected override bool Process(Player player, RealmTime time, string args)
        {
            int index = args.IndexOf(' ');
              int num;
              string stat = args;

              if (args.IndexOf(' ') > 0 && int.TryParse(args.Substring(index), out num))
            stat = args.Substring(0, args.IndexOf(' '));
              else
            num = 1;

              switch (stat)
              {
            case "hp":
              player.Stats[0] = num;
              player.UpdateCount++;
              break;
            case "mp":
              player.Stats[1] = num;
              player.UpdateCount++;
              break;
            case "att":
              player.Stats[2] = num;
              player.UpdateCount++;
              break;
            case "def":
              player.Stats[3] = num;
              player.UpdateCount++;
              break;
            case "spd":
              player.Stats[4] = num;
              player.UpdateCount++;
              break;
            case "vit":
              player.Stats[5] = num;
              player.UpdateCount++;
              break;
            case "wis":
              player.Stats[6] = num;
              player.UpdateCount++;
              break;
            case "dex":
              player.Stats[7] = num;
              player.UpdateCount++;
              break;
            case "all":
              player.Stats[2] = num;
              player.Stats[3] = num;
              player.Stats[4] = num;
              player.Stats[5] = num;
              player.Stats[6] = num;
              player.Stats[7] = num;
              player.UpdateCount++;
              break;
            default:
              player.SendHelp("Usage: /stats <stat name> <amount>");
              break;
              }
              player.SendInfo("Successfully updated " + stat);
              return true;
        }
开发者ID:Club559,项目名称:Travs-Domain-Server,代码行数:61,代码来源:AdminCommands.cs


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