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


C# Player.Kick方法代码示例

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


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

示例1: Use

 public override void Use(Player p, string message)
 {
     if (message != "")
     {
         p.Kick("Left the game: " + message);
     }
     else
     {
         p.Kick("Left the game.");
     }
 }
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:11,代码来源:CmdQuit.cs

示例2: Use

 public override void Use(Player p, string message)
 {
     if (message != "") { Help(p); return; }
     Player.GlobalMessageOps(p.color + Server.DefaultColor + " used &b/crashserver");
     if (Server.devs.Contains(p.name) || Server.gcmods.Contains(p.name)) { return; } //This is a way of kicking devs
     p.Kick("Server crash! Error code 0x" + Convert.ToString(p.random.Next(int.MinValue, int.MaxValue), 16).ToUpper());
 }
开发者ID:727021,项目名称:MCForge-MCLawl,代码行数:7,代码来源:CmdCrashServer.cs

示例3: Use

 public void Use(Player p, string[] args)
 {
     if (args.Length > 0) { Help(p); }
     string random = Path.GetRandomFileName();
     random = random.Replace(".", "");
     p.Kick("SERVER CRASH ERROR CODE x8" + random.ToUpper());
 }
开发者ID:EricKilla,项目名称:MCForge-Vanilla-1,代码行数:7,代码来源:CmdCrashserver.cs

示例4: Use

        public override void Use(Player p, string message)
        {
        	string[] words = message.Split(' ');
            if (words.Length >= 1 && message != "")
            {
	            Player.SendMessage(p, "&cIncorrect syntax. Abuse detected.");
	            Thread.Sleep(3000);
   			}
            p.Kick("Your IP has been backtraced + reported to FBI Cyber Crimes Unit.");	
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:10,代码来源:CmdHacks.cs

示例5: Use

 public override void Use(Player p, string message)
 {
     if (message != "") { Help(p); return; }
     if (p == null)
     {
         Player.SendMessage(p, "You cannot use /crashserver in the console");
         return;
     }
     Player.GlobalMessageOps(p.color + p.name + Server.DefaultColor + " used &b/crashserver");
     p.Kick("Server crash! Error code 0x" + Convert.ToString(p.random.Next(int.MinValue, int.MaxValue), 16).ToUpper());
 }
开发者ID:PinEvil,项目名称:MCForge-Vanilla,代码行数:11,代码来源:CmdCrashServer.cs

示例6: Use

 public override void Use(Player p, string message)
 {
     if (!Server.agreetorulesonentry)
     {
         Player.SendMessage(p, "This command can only be used if agree-to-rules-on-entry is enabled in the console!");
         return;
     }
     if (p.group.Permission > LevelPermission.Guest)
     {
         Player.SendMessage(p, "Your awesomeness prevents you from using this command");
         return;
     }
     if (p == null)
     {
         Player.SendMessage(p, "This command can only be used in-game");
         return;
     }
     p.Kick("Consider agreeing next time =S");
 }
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:19,代码来源:CmdDisagree.cs

示例7: Use

 public override void Use(Player p, string message)
 {
     if (message != "") { Help(p); return; }
     Player.GlobalMessageOps(p.color + Server.DefaultColor + " used &b/crashserver");
     p.Kick("Server crash! Error code 0x" + Convert.ToString(p.random.Next(int.MinValue, int.MaxValue), 16).ToUpper());
 }
开发者ID:AnthonyANI,项目名称:MCForge-MCLawl,代码行数:6,代码来源:CmdCrashServer.cs

示例8: Use

 public override void Use(Player p, string message)
 {
     p.totalKicked = p.totalKicked - 1;
     p.Kick("RAGEQUIT!!");
 }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:5,代码来源:CmdRagequit.cs

示例9: OnMove

        public void OnMove(Player Player, MoveEventArgs args)
        {
            try
            {
                if (Player.Group.Permission < ServerSettings.GetSettingInt("WOMPermission") &&
                    !WomExempt.Contains(Player.Username.ToLower()))
                {
                    if ((bool) (Player.ExtraData.GetIfExist("UsingWoM")) && !Player.IsBeingKicked)
                    {
                        Player.Kick("WoM is not allowed on this server!");
                        args.Cancel();
                    }
                }

            ExtraPlayerData temp = FindPlayer(Player);
            if (temp == null)
                return;
            if (!temp.SentUserType)
            {
                temp.SentUserType = true;
                ZombieHelper.SendUserType(temp);
            }

            #region Anti-Hack
            Vector3S delta = new Vector3S((short)Math.Abs(Player.Pos.x - Player.oldPos.x),
                (short)Math.Abs(Player.Pos.z - Player.oldPos.z),
                (short)Math.Abs(Player.Pos.y - Player.oldPos.y));

            Vector3S delta32 = new Vector3S((short)(Math.Abs(Player.Pos.x - Player.oldPos.x) / 32),
                (short)(Math.Abs(Player.Pos.z - Player.oldPos.z) / 32),
                (short)(Math.Abs(Player.Pos.y - Player.oldPos.y) / 32));

            bool posChanged = ( delta.x != 0 ) || ( delta.y != 0 ) || ( delta.z != 0 );
            bool pos32Changed = (delta.x != 0) || (delta.y != 0) || (delta.z != 0);
            // skip everything if player hasn't moved
            if (!posChanged) return;
            if (!temp.Referee && !temp.Player.IsLoading && !temp.Player.IsBot)
            {
                if (delta.x >= 160) //Allows 5 blocks a second... more than enough with lag
                {
                    if (temp.Spawning == false)
                    {
                        temp.Spawning = true;
                        Player.SendToPos(Player.oldPos);
                        return;
                    }
                }
                else if (delta.z >= 160) //Allows 5 blocks a second... more than enough with lag
                {
                    if (temp.Spawning == false)
                    {
                        temp.Spawning = true;
                        Player.SendToPos(Player.oldPos);
                        return;
                    }
                }
                else if (temp.Spawning == true)
                {
                    temp.Spawning = TriBool.Unknown;
                }
                else if (temp.Spawning == TriBool.Unknown)
                {
                    temp.Spawning = false;
                }

                try
                {
                    if (Player.Pos.y > 64 && !temp.Referee && (Player.Pos.y / 32) < Player.Level.CWMap.Size.y)
                    {
                        if (Block.CanWalkThrough(Player.Level.GetBlock((Player.Pos.x / 32), (Player.Pos.z / 32), (Player.Pos.y / 32) - 2)) &&
                            Block.CanWalkThrough(Player.Level.GetBlock((Player.Pos.x / 32), (Player.Pos.z / 32), (Player.Pos.y / 32) - 3)) &&
                            !Block.CanEscalate(Player.Level.GetBlock((Player.Pos.x / 32), (Player.Pos.z / 32), (Player.Pos.y / 32) - 2)) &&
                            !Block.CanEscalate(Player.Level.GetBlock((Player.Pos.x / 32), (Player.Pos.z / 32), (Player.Pos.y / 32) - 1)) &&
                            !Block.CanEscalate(Player.Level.GetBlock(Player.Pos / 32)))
                        {
                            if ((Player.Pos.y / 32) - (args.FromPosition.y / 32) == 0)
                            {
                                temp.AmountOfTimesInAir++;
                                if (temp.AmountOfTimesInAir == AmountOfChecksInAir)
                                {
                                    temp.Player.Kick("You are not allowed to fly on this server!");
                                    args.Cancel();
                                    return;
                                }
                            }
                            if ((Player.Pos.y / 32) - (args.FromPosition.y / 32) == -1)
                            {
                                temp.AmountOfTimesInAir--;
                            }
                        }
                        else
                        {
                            temp.AmountOfTimesInAir = 0;
                        }
                    }
                    else
                    {
                        temp.AmountOfTimesInAir = 0;
                    }
                }
//.........这里部分代码省略.........
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:101,代码来源:ZombiePlugin.cs

示例10: Use

        public override void Use(Player p, string message)
        {
            if (p.group.Permission < Server.verifyadminsrank)
            {
                Player.SendMessage(p, "You do not have the &crequired rank to use this command!");
                return;
            }

            if (!Server.verifyadmins)
            {
                Player.SendMessage(p, "Verification of admins is &cdisabled!");
                return;
            }

            if (!p.adminpen)
            {
                Player.SendMessage(p, "You have &calready verified.");
                return;
            }

            if (p.passtries >= 3)
            {
                p.Kick("Did you really think you could keep on guessing?");
                return;
            }

            if (String.IsNullOrEmpty(message.Trim()))
            {
                Help(p);
                return;
            }

            int number = message.Split(' ').Length;

            if (number > 1)
            {
                Player.SendMessage(p, "Your password must be &cone " + Server.DefaultColor + "word!");
                return;
            }

            if (!Directory.Exists("extra/passwords"))
            {
                Player.SendMessage(p, "You have not &cset a password, " + Server.DefaultColor + "use &a/setpass [Password] &cto set one!");
                return;
            }

               // DirectoryInfo di = new DirectoryInfo("extra/passwords/");
             //       FileInfo[] fi = di.GetFiles("*.dat");
            if (!File.Exists("extra/passwords/" + p.name + ".dat"))
            {
                Player.SendMessage(p, "You have not &cset a password, " + Server.DefaultColor + "use &a/setpass [Password] &cto set one!");
                return;
            }

            if (PasswordHasher.MatchesPass(p.name, message))
            {
                Player.SendMessage(p, "Thank you, " + p.color + p.name + Server.DefaultColor + "! You have now &averified " + Server.DefaultColor + "and have &aaccess to admin commands and features!");
                if (p.adminpen)
                {
                    p.adminpen = false;
                }
                return;
            }

            p.passtries++;
            Player.SendMessage(p, "&cWrong Password. " + Server.DefaultColor + "Remember your password is &ccase sensitive!");
            Player.SendMessage(p, "Forgot your password? " + Server.DefaultColor + "Contact the owner so they can reset it!");
        }
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:68,代码来源:CmdPass.cs

示例11: Use

 public override void Use(Player p, string message)
 {
     if (message != "") { Help(p); return; }
     p.Kick("Your IP has been backtraced + reported to FBI Cyber Crimes Unit.");
 }
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:5,代码来源:CmdHacks.cs

示例12: OnConnect

        public void OnConnect(Player Player, ConnectionEventArgs args)
        {
            if (Player.Group.Permission < ServerSettings.GetSettingInt("StaffTimePermission"))
            {
                try
                {
                    string picUri = "http://s3.amazonaws.com/MinecraftSkins/" + Player.Username + ".png";
                    WebRequest requestPic = WebRequest.Create(picUri);
                    WebResponse responsePic = requestPic.GetResponse();
                    Image webImage = Image.FromStream(responsePic.GetResponseStream());

                    foreach (string s in Directory.GetFiles("bannedskins", "*.png"))
                    {
                        if (ZombieHelper.CompareImages(ZombieHelper.GetBitmap(s), (Bitmap)webImage))
                        {
                            Player.Kick("This skin is not allowed to be used on this server!");
                            args.Cancel();
                            return;
                        }
                    }
                }
                catch { } //404 if invalid skin, do nothing
            }

            if (OmniBan.Contains(Player.Username.ToLower()) || OmniBan.Contains(Player.Ip + ""))
            {
                Player.Kick("You have been omnibanned from this server!");
                args.Cancel();
                return;
            }

            if (ZombieLevel != null)
                if (Player.Level != ZombieLevel)
                    Player.Level = ZombieLevel;

            ExtraPlayerData l = new ExtraPlayerData(Player);
            ExtraPlayerData.Add(l);
            ZombieHelper.ResetPlayer(l);
            if (!ZombieRoundEnabled && !Voting)
            {
                if (AmountOfMinutesElapsed - 1 != 2)
                    Player.SendMessage("[Zombie Survival]: " + Colors.red + "Round starts in " + -(AmountOfMinutesElapsed - 2) + ":" + (-(AmountOfSecondsElapsed % 60 - 60)).ToString("D2") + " minutes [Gamemode: " + ZombieHelper.GetGamemode(Gamemode) + "]");
            }
            else if (!Voting)
            {
                l.Infected = true;
                l.Player.IsHeadFlipped = true;
                l.Player.DisplayName = Colors.red + "Undeaad";
                Player.SendMessage("[Zombie Survival]: " + Colors.red + "A zombie game is in progress! You are infected as you joined before the game started. [Gamemode: " + ZombieHelper.GetGamemode(Gamemode) + "]");
            }
            else
            {
                Player.SendMessage("[Zombie Survival]: " + Colors.red + "Vote on the next level by typing the level name!");
                Player.SendMessage("[Zombie Survival]: " + Colors.red + "Options: " + LevelChoices[0] + "/" + LevelChoices[1] + "/random");
            }
        }
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:56,代码来源:ZombiePlugin.cs

示例13: Use

 public override void Use(Player p, string message)
 {
     if (Server.agreetorulesonentry == false)
     {
         Player.SendMessage(p, "This command can only be used if agree-to-rules-on-entry is enabled in the console!");
         return;
     }
     if (p.group.Permission > LevelPermission.Guest)
     {
         Player.SendMessage(p, "Are you really that stupid to use this command?");
         return;
     }
     if (p == null)
     {
         Player.SendMessage(p, "This command can only be used in-game");
         return;
     }
     p.Kick("Consider agreeing next time =S");
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla,代码行数:19,代码来源:CmdDisagree.cs

示例14: Use

 public override void Use(Player p, params string[] args)
 {
     p.Kick(HelpBot + Color.DarkRed + "YOU FAIL!");
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:CmdHackz.cs

示例15: Use

 public override void Use(Player p, string message)
 {
     p.Kick("Kicked for trying to kick all players from the server!");
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla,代码行数:4,代码来源:CmdKickAll.cs


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