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


C# Player.PrintMessage方法代码示例

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


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

示例1: Run

 public override void Run(Player sender, string cmd, string args)
 {
     args = args.ToLower();
     if (args == "")
     {
         if (sender.placing)
         {
             sender.placing = false;
             sender.PrintMessage(Color.CommandResult + "No longer placing");
         }
         else
         {
             sender.PrintMessage(Color.CommandError + "No block specified");
         }
     }
     else
     {
         string b = args;
         if (BlockInfo.NameExists(b))
         {
             sender.placing = true;
             sender.placeType = BlockInfo.names[b];
             sender.PrintMessage(Color.CommandResult + "Placing " + b + " in place of Obsidian. Use /place to cancel");
         }
         else
         {
             sender.PrintMessage(Color.CommandError + "Unknown block " + b);
         }
     }
 }
开发者ID:welterde,项目名称:Spacecraft,代码行数:30,代码来源:Building.cs

示例2: Run

            public override void Run(Player sender, string cmd, string arg)
            {
                if(arg == "") {
                    sender.PrintMessage(Color.CommandError + "No player specified");
                } else {
                    string name = arg.Trim();
                    Player P = Server.theServ.GetPlayer(arg);
                    if(P != null) {
                        name = P.name;
                    }

                    Rank current = Player.RankOf(name);
                    if(current >= sender.rank) {
                        sender.PrintMessage(Color.CommandError + "You can't change the rank of someone of an equal or greater rank!");
                        return;
                    }

                    if(P == null) {
                        // just set their rank
                        Player.SetRankOf(name, Rank.Banned);
                    } else {
                        // they're online, so we inform them
                        // this calls SetRankOf as well
                        P.UpdateRank(Rank.Banned);

                        // and of course they're now banned
                        P.Kick("You were banned by " + sender.name);
                    }

                    sender.PrintMessage(Color.CommandResult + name + " banned");
                    Spacecraft.Log(sender.name + " banned " + name);

                    Player.SaveRanks();
                }
            }
开发者ID:welterde,项目名称:Spacecraft,代码行数:35,代码来源:Ranks.cs

示例3: Run

 public override void Run(Player sender, string cmd, string args)
 {
     /* /me /me Easter egg. */
     if (args == "/me")
     {
         sender.PrintMessage(Color.CommandResult + "Red alert, /me /me found, PMing all players!");
         sender.PrintMessage(Color.CommandResult + "Easter egg get!");
     }
     else if (args == "")
     {
         sender.PrintMessage(Color.CommandError + "No /me message specified");
     }
     else
     {
         Server.theServ.MessageAll(" * " + sender.name + " " + args);
     }
 }
开发者ID:welterde,项目名称:Spacecraft,代码行数:17,代码来源:Basics.cs

示例4: Run

 public override void Run(Player sender, string cmd, string args)
 {
     if (args == "")
     {
         sender.PrintMessage(Color.CommandError + "No player specified");
     }
     else
     {
         Player p = Server.theServ.GetPlayer(args);
         if (p == null) {
             sender.PrintMessage(Color.CommandError + "No such player " + args);
         } else {
             Server.theServ.MovePlayer(p, sender.pos, sender.heading, sender.pitch);
             p.PrintMessage(Color.PrivateMsg + sender.name + " summoned you!");
             Spacecraft.Log(sender.name + " summon " + p.name);
         }
     }
 }
开发者ID:welterde,项目名称:Spacecraft,代码行数:18,代码来源:Misc.cs

示例5: Run

            public override void Run(Player sender, string cmd, string args)
            {
                char[] denied = new char[] { '{', '[', ']', '}', ' ', '|', '!', '?' };

                args = args.Trim().ToLower();
                Map map = Server.theServ.map;
                if (args == "") {
                    string marks = "Landmarks: " + String.Join(", ", map.GetLandmarkList());
                    ChatCommandHandling.WrapMessage(sender, marks);
                } else if (args.IndexOfAny(denied) >= 0) {
                    sender.PrintMessage(Color.CommandError + "Landmark name contains invalid characters");
                } else if (map.landmarks.ContainsKey(args)) {
                    sender.PrintMessage(Color.CommandError + "Landmark " + args + " already exists");
                } else {
                    byte heading = sender.heading;
                    map.landmarks.Add(args, new Pair<Position, byte>(sender.pos, heading));
                    Server.theServ.MessageAll(Color.Announce + sender.name + " created landmark " + args);
                }
            }
开发者ID:welterde,项目名称:Spacecraft,代码行数:19,代码来源:Landmarks.cs

示例6: Run

 public override void Run(Player sender, string cmd, string args)
 {
     if (args == "")
     {
         sender.PrintMessage(Color.CommandError + "No message specified");
     }
     else
     {
         Spacecraft.Log("{" + sender.name + "} " + args);
         Server.theServ.MessageAll(Color.Announce + args);
     }
 }
开发者ID:welterde,项目名称:Spacecraft,代码行数:12,代码来源:Management.cs


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