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


C# Client.TellSystem方法代码示例

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


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

示例1: ShowHelp

 public static void ShowHelp(Client player, string path, string command)
 {
     player.TellSystem(Chat.DarkGreen, "///////// " + Chat.Green + "help: /" + command);
     if (FindShowHelp(player, path, command) == false)
         player.TellSystem(Chat.Red, "Help/command not found");
     player.TellSystem(Chat.DarkGreen, "/////////");
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:7,代码来源:Help.cs

示例2: Firehose

 static void Firehose(Client player, string[] cmd, int iarg)
 {
     player.Settings.Firehose = !player.Settings.Firehose;
     if (player.Settings.Firehose)
         player.TellSystem(Chat.Green, "Firehose is on" + Chat.Gray + " - you now hear everything");
     else
         player.TellSystem(Chat.Red, "Firehose is off" + Chat.Gray + "(default) - you hear within 500 blocks");
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:8,代码来源:ChatCommands.cs

示例3: ParseCommandChatHelp

        static void ParseCommandChatHelp(Client player, string[] cmd, int iarg)
        {
            player.Settings.Help = !player.Settings.Help;

            if (player.Settings.Help)
                player.TellSystem(Chat.Green, "Chat guide will show");
            else
                player.TellSystem(Chat.Green, "Chat guide is now hidden");
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:9,代码来源:Help.cs

示例4: Join

 public override WorldSession Join(Client player)
 {			
     ConstructSession cs = new GreenSession(player);
     Join(cs, player);
     player.TellSystem(Chat.DarkGreen, "Welcome to the Green Room");
     player.TellSystem(Chat.White, "Type: " + Chat.Blue + "/return" + Chat.White + " when you are ready to return");
     //player.SendToClient (new NewState (NewState.State.BeginRaining));
     return cs;
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:9,代码来源:GreenRoom.cs

示例5: Load

        static void Load(Client player, string[] cmd, int iarg)
        {

            player.TellSystem(Chat.Pink + "CPU: ", Chat.White + Lag.ServerLoad(true));
            var mu = Lag.ServerMemoryUsage();
            if (mu == null)
                player.TellSystem(Chat.Pink, "Error getting memory status");
            else
                player.TellSystem(Chat.Pink + "Memory: ", Chat.White + mu.Quota.ToString("0.0%") + " " + mu.UsedGB.ToString("0.000") + " / " + mu.TotalGB.ToString("0.000") + " GB");
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:10,代码来源:Players.cs

示例6: Join

 public override WorldSession Join(Client player)
 {
     ConstructSession cs = new TheConstructSession(player);
     Join(cs, player);
     player.Queue.Queue(new TimeUpdate(6000));
     player.TellSystem(Chat.White, "Welcome to the Construct");
     player.TellSystem(Chat.White, "Type: " + Chat.Blue + "/blue" + Chat.White + " to return");
     player.Queue.Queue(new PlayerAbilitiesServer());
     player.Queue.Queue(ChangeGameState.ChangeGameMode(GameMode.Creative));
     return cs;
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:11,代码来源:TheConstruct.cs

示例7: GetTexture

        static void GetTexture(Client player, string[] cmd, int iarg)
        {
            if (MinecraftServer.TexturePack == null || MinecraftServer.TexturePack == "")
                throw new ErrorException("We currenlty don't have any texturepack");

            var tp = new TexturePackMessage(MinecraftServer.TexturePack);
            player.Queue.Queue(tp);
            player.TellSystem(Chat.Blue, "Texturepack sent... If you did not get a prompt you already have it installed");

            player.TellSystem(Chat.Blue, "You can also download it from " + tp.Url);
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:11,代码来源:TexturePackSetter.cs

示例8: Spawner

        static void Spawner(Client player, string[] cmd, int iarg)
        {
            if (!player.Admin())
                throw new ErrorException("Spawn does no longer work");

            VanillaSession rs = player.Session as VanillaSession;
            if (rs.Spawners.Count == 0)
            {
                player.TellSystem(Chat.Purple, "No spawners yet detected");
                return;
            }
            CoordInt nearby = rs.Spawners [0];
            double dist = nearby.DistanceTo(rs.Position);
            foreach (CoordInt c in rs.Spawners)
            {
                double cdist = c.DistanceTo(rs.Position);
                if (cdist < 10)
                    continue;
                if (cdist < dist)
                {
                    dist = cdist;
                    nearby = c;
                }
            }   
            player.Warp(nearby.CloneDouble(), rs.Dimension, player.Session.World);
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:26,代码来源:VanillaWorldCommands.cs

示例9: Stat

 static void Stat(Client player, string[] cmd, int iarg)
 {
     if (cmd.Length == 1)
     {
         Chat.TellStatTo(player, player.Settings, player);
         player.TellSystem(Chat.Yellow + " ", Chat.Gold + Donors.Status(player.MinecraftUsername));
     }
     for (int n = 1; n < cmd.Length; n++)
     {
         ClientSettings s = null;
         Client p = PlayerList.GetPlayerByName(cmd [n]);
         if (p != null)
             s = p.Settings;
         if (s == null || s.Cloaked != null)
         {
             s = Client.LoadProxyPlayer(cmd [n]);
             p = null;
         }
         if (s == null)
             player.TellSystem(Chat.Red, cmd [n] + " is not found");
         else
         {
             Chat.TellStatTo(p, s, player);
             BadPlayer b = Banned.GetBanHistory(cmd [n]);
             if (b != null)
                 player.TellSystem(Chat.Yellow + cmd [n] + " ", Chat.Red + b.ToString());
         }
     }
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:29,代码来源:Players.cs

示例10: TabMessage

 void TabMessage(Client player, string[] cmd, int iarg, TabComplete tab)
 {
     var r = player.Session.CurrentRegion;
     if (r == null)
         player.TellSystem(Chat.Red, "No region here");
     else
         tab.Alternatives.Add(player.Session.CurrentRegion.Message);
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:8,代码来源:RegionCommands.cs

示例11: Prod

 static void Prod(Client player, string[] cmd, int iarg)
 {
     if (Banned.CheckBanned(player) != null)
         return;
             
     if (cmd.Length != 2)
     {
         player.TellSystem(Chat.Purple, "Who?");
         return;
     }
     Client p = PlayerList.GetPlayerByName(cmd [1]);
     if (p == null)
     {
         player.TellSystem(Chat.Red, "Player not found");
         return;
     }
     PlayerInteraction.Prod(player, p);
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:18,代码来源:ChatCommands.cs

示例12: TellAdmin

 static void TellAdmin(Client player, string[] cmd, int iarg)
 {
     string msg = cmd.JoinFrom(1).Trim();
     if (msg == "")
         throw new ShowHelpException();
             
     Chatting.Parser.TellAdmin(player.Name + ": " + msg);
     bool admin = false;
     foreach (Client a in PlayerList.List)
     {
         if (a.Admin() && a.Settings.Cloaked == null)
         {
             admin = true;
             break;
         }
     }
     if (admin)
         player.TellSystem(Chat.Purple, ">Admin: " + msg);
     else
         player.TellSystem(Chat.Purple, "No admin online");
 }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:21,代码来源:ChatCommands.cs

示例13: ParseClientCommand

        public static void ParseClientCommand(Client player, string message)
        {
            string [] cmd = null;
            try
            {
                cmd = message.Replace("  ", " ").Split(' ');
                cmd [0] = cmd [0].Trim().Trim('/').ToLowerInvariant();
                string command = cmd [0];
                
                if (command == "")
                    return;

                CommandManager cm = player.Session.World.Commands;
                if (cm != null && cm.ParseCommand(player, cmd, 1))
                    return;
                
                if (Instance.ParseCommand(player, cmd, 1))
                    return;
                
                Help.ShowHelp(player, "help", cmd.JoinFrom(0));
                
            } catch (FormatException fe)
            {
                player.TellSystem(Chat.Red, fe.Message);
                return;
            } catch (ErrorException ee)
            {
                player.TellSystem(Chat.Red + "Error: ", ee.Message);
                return;
            } catch (UsageException ue)
            {
                player.TellSystem(Chat.Yellow + "Usage: ", ue.Message);
                return;
            } catch (ShowHelpException)
            {
                Help.ShowHelp(player, "help", cmd.JoinFrom(0));
            }
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:38,代码来源:MainCommands.cs

示例14: Translate

        static void Translate(Client p, string[] cmd, int offset)
        {
            if (!p.Donor && !p.Admin())
                throw new ErrorException("Only for donors, /donate");

            if (cmd.Length == offset)
            {
                lock (senderTranslate)
                {
                    if (senderTranslate.Remove(p.MinecraftUsername))
                        p.TellSystem(Chat.Aqua, "Removed translation");
                }
                throw new ShowHelpException();
            }

            if (cmd.Length == offset + 1)
            {
                if (cmd [offset].Length == 2)
                    TranslateNext(p, new Languages(cmd [offset]));
                else
                    TranslatePrev(p, new Languages(p.Language), cmd [offset]);
                return;
            }


            Languages lang;
            if (cmd [offset].Length == 2 && cmd [offset + 1].Length == 2)
            {
                lang = new Languages(cmd [offset], cmd [offset + 1]);
                offset += 2;
            } else
            {
                lang = new Languages(cmd [offset]);
                offset += 1;
            }

            if (cmd.Length == offset)
            {
                TranslateNext(p, lang);
                return;
            }
            
            if (cmd.Length == offset + 1)
            {
                TranslatePrev(p, lang, cmd [offset]);
                return;
            }

            TranslateText(p, lang, cmd.JoinFrom(offset));
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:50,代码来源:Translate.cs

示例15: RegionCommand

        void RegionCommand(Client player, string[] cmd, int iarg)
        {
            if (cmd.Length == iarg)
            {
                //Single /reg, no arguments
                WorldRegion region = player.Session.CurrentRegion;
                if (region == null)
                    throw new ErrorException("No region here");

                    
                player.TellSystem(Chat.Aqua, "Region: " + region.ColorName);
                if (player.Admin())
                {
                    player.TellSystem(Chat.Gray, region.Type + ": " + region);
                }   
                player.TellSystem(Chat.DarkAqua + "Residents: ", region.GetResidents());
                player.TellSystem(Chat.DarkAqua + "Last visited by resident: ", (DateTime.UtcNow - region.Stats.LastVisitResident).TotalDays.ToString("0.0") + " days ago");
                return;
            }

            if (base.ParseCommand(player, cmd, iarg + 1) == false)
                throw new ShowHelpException();
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:23,代码来源:RegionCommands.cs


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