示例#1
0
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /League
            if (this.MatchRequiredParam(p,  Functions.CommandParamType.Nothing))
            {
                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    if (Player.PvP_Status == Player.PvPTypes.Lobby)
                    {
                        Player.PvP_Rules = new List<string> { Player.PvPRules.Custom_League.ToString() };
                        Player.PvP_Validatated = false;

                        Core.Player.GetPlayer(Player.PvP_OpponentID).PvP_Rules = new List<string> { Player.PvPRules.Custom_League.ToString() };
                        Core.Player.GetPlayer(Player.PvP_OpponentID).PvP_Validatated = false;

                        Player.CommandFeedback("The PvP match will now obey League rules. For more info refer:", null);
                        Player.CommandFeedback("http://www.aggressivegaming.org/pokemon/link-forums/general-league-rules.219/", null);

                        Core.Player.GetPlayer(Player.PvP_OpponentID).CommandFeedback("The PvP match will now obey League rules. For more info refer:", null);
                        Core.Player.GetPlayer(Player.PvP_OpponentID).CommandFeedback("http://www.aggressivegaming.org/pokemon/link-forums/general-league-rules.219/", null);
                    }
                }
            }
            #endregion /League
        }
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Operator.Remove [Name]
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any))
            {
                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any);

                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Player.SentToPlayer(new Package(Package.PackageTypes.ChatMessage, Core.Setting.Token("SERVER_PLAYERNOTEXIST"), p.Client));
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.IsOperator())
                        {
                            Players.RemoveOperator();

                            Player.CommandFeedback($"You have successfully remove {PlayerName} as operator.", $"have remove {PlayerName} as operator.");
                        }
                        else
                        {
                            Core.Player.SentToPlayer(new Package(Package.PackageTypes.ChatMessage, Core.Setting.Token("SERVER_NOTOPERATOR"), p.Client));
                        }
                    }
                }
                else if (Player == null)
                {
                    List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any);

                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Loggers.Logger.LogTypes.Info);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.IsOperator())
                        {
                            Players.RemoveOperator();

                            Core.Logger.Log($"You have successfully remove {PlayerName} as operator.", Loggers.Logger.LogTypes.Info);
                        }
                        else
                        {
                            Core.Logger.Log(Core.Setting.Token("SERVER_NOTOPERATOR"), Loggers.Logger.LogTypes.Info);
                        }
                    }
                }
            }
            #endregion /Operator.Remove [Name]
        }
示例#3
0
 /// <summary>
 /// Handle the Package data.
 /// </summary>
 /// <param name="p">Package data.</param>
 /// <param name="Player">Player.</param>
 public void Handle(Package p, Player Player = null)
 {
     // Start from the most inner depth Command.
     #region /About
     if (this.MatchRequiredParam(p, Functions.CommandParamType.Nothing))
     {
         if (Player != null && this.MatchRequiredPermission(Player))
         {
             Player.CommandFeedback($"This server is created by jianmingyong.", null);
             Player.CommandFeedback($"It is running v{Core.Setting.ApplicationVersion}", null);
         }
         else if (Player == null)
         {
             Core.Logger.Log("This server is created by jianmingyong.", Logger.LogTypes.Info);
             Core.Logger.Log($"It is running v{Core.Setting.ApplicationVersion}", Logger.LogTypes.Info);
         }
     }
     #endregion /About
 }
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Player.Season <id>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Integer))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Integer);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    OnlineSetting Settings = Player.GetOnlineSetting();
                    Settings.Season = Group[0].Toint().RollOver(-4, 3);
                    Settings.CurrentWorldSeason = Core.World.GenerateSeason(Settings.Season);
                    Settings.LastWorldUpdate = DateTime.Now;

                    Player.CommandFeedback(Core.World.ToString(Settings.CurrentWorldSeason, Settings.CurrentWorldWeather), $"have changed the player season.");
                }
            }
            #endregion /Player.Season <id>
        }
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Timeoffset <Duration>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Integer))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Integer);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    Core.World.TimeOffset = Group[0].ToInt();

                    Player.CommandFeedback(Core.World.ToString(), $"have changed the world time offset.");
                }
                else if (Player == null)
                {
                    Core.World.TimeOffset = Group[0].ToInt();

                    Core.Logger.Log(Core.World.ToString(), Logger.LogTypes.Info);
                }
            }
            #endregion /Timeoffset <Duration>
        }
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Global.Weather <id>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Integer))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Integer);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    Core.World.Weather = Core.World.GenerateWeather(Group[0].Toint(), Core.World.Season);
                    
                    Player.CommandFeedback(Core.World.ToString(), string.Format("have changed the global weather."));
                }
                else if (Player == null)
                {
                    Core.World.Weather = Core.World.GenerateWeather(Group[0].Toint(), Core.World.Season);

                    Core.Logger.Log(Core.World.ToString(), Logger.LogTypes.Info);
                }
            }
            #endregion /Global.Weather <id>
        }
示例#7
0
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Say <Message>
            if (this.MatchRequiredParam(p,  Functions.CommandParamType.Any))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Any);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    Core.Player.SendToAllPlayer(new Package(Package.PackageTypes.ChatMessage, Group[0], null));

                    Player.CommandFeedback(null, string.Format("have sent a server chat."));
                }
                else if (Player == null)
                {
                    Core.Player.SendToAllPlayer(new Package(Package.PackageTypes.ChatMessage, Group[0], null));

                    Core.Logger.Log(Group[0], Logger.LogTypes.Server);
                }
            }
            #endregion /Say <Message>
        }
示例#8
0
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Help <page>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Integer))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Integer);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    List<string> GetHelpContent = GenerateHelp(Group[0].ToInt());

                    for (int i = 0; i < GetHelpContent.Count; i++)
                    {
                        Player.CommandFeedback(GetHelpContent[i], null);
                    }
                }
                else if (Player == null)
                {
                    List<string> GetHelpContent = GenerateHelp(Group[0].ToInt());

                    for (int i = 0; i < GetHelpContent.Count; i++)
                    {
                        Core.Logger.Log(GetHelpContent[i], Logger.LogTypes.Info);
                    }
                }
            }
            #endregion /Help <page>

            #region /Help <name>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Any);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    for (int i = 0; i < Core.Command.Count; i++)
                    {
                        if (string.Equals(Group[0], Core.Command[i].Name, StringComparison.OrdinalIgnoreCase))
                        {
                            Core.Command[i].Help(0, Player);
                        }
                    }
                }
                else if (Player == null)
                {
                    for (int i = 0; i < Core.Command.Count; i++)
                    {
                        if (string.Equals(Group[0], Core.Command[i].Name, StringComparison.OrdinalIgnoreCase))
                        {
                            Core.Command[i].Help(0, Player);
                        }
                    }
                }
            }
            #endregion /Help <name>

            #region /Help
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Nothing))
            {
                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    List<string> GetHelpContent = GenerateHelp(0);

                    for (int i = 0; i < GetHelpContent.Count; i++)
                    {
                        Player.CommandFeedback(GetHelpContent[i], null);
                    }
                }
                else if (Player == null)
                {
                    List<string> GetHelpContent = GenerateHelp(0);

                    for (int i = 0; i < GetHelpContent.Count; i++)
                    {
                        Core.Logger.Log(GetHelpContent[i], Logger.LogTypes.Info);
                    }
                }
            }
            #endregion /Help
        }
示例#9
0
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /deop <Name>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Any);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Player.CommandFeedback(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), null);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.IsOperator())
                        {
                            if (Players.GameJoltID == 116016 || Player.GameJoltID == 222452)
                            {
                                Player.CommandFeedback($"You are not allowed to change or remove {PlayerName} operator status.", null);
                            }
                            else
                            {
                                Players.RemoveOperator();

                                Player.CommandFeedback($"You have successfully remove {PlayerName} as operator.", $"have remove {PlayerName} as operator.");
                            }
                        }
                        else
                        {
                            Player.CommandFeedback(Core.Setting.Token("SERVER_NOTOPERATOR"), null);
                        }
                    }
                }
                else if (Player == null)
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Logger.LogTypes.Info);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.IsOperator())
                        {
                            if (Players.GameJoltID == 116016 || Player.GameJoltID == 222452)
                            {
                                Core.Logger.Log($"You are not allowed to change or remove {PlayerName} operator status.", Logger.LogTypes.Info);
                            }
                            else
                            {
                                Players.RemoveOperator();

                                Core.Logger.Log($"You have successfully remove {PlayerName} as operator.", Logger.LogTypes.Info);
                            }
                        }
                        else
                        {
                            Core.Logger.Log(Core.Setting.Token("SERVER_NOTOPERATOR"), Logger.LogTypes.Info);
                        }
                    }
                }
            }
            #endregion /deop <Name>
        }
示例#10
0
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Kick <Name> [Reason]
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any, Functions.CommandParamType.Any))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Any);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Player.CommandFeedback(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), null);
                        return;
                    }
                    else if (Player != null && string.Equals(Player.Name, Group[0], StringComparison.Ordinal))
                    {
                        Player.CommandFeedback(Core.Setting.Token("SERVER_KICKSELF"), null);
                        return;
                    }
                    else
                    {
                        Player KickPlayer = Core.Player.GetPlayer(Group[0]);
                        string KickPlayerName = KickPlayer.isGameJoltPlayer ? $"{KickPlayer.Name} ({KickPlayer.GameJoltID.ToString()})" : KickPlayer.Name;

                        Core.Player.Remove(KickPlayer.ID, Core.Setting.Token("SERVER_KICKED", Group[1]));

                        Player.CommandFeedback("You have successfully kicked " + KickPlayerName, $"have kick {KickPlayerName} with the following reason: {Group[1]}");
                        return;
                    }
                }
                else if (Player == null)
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Logger.LogTypes.Info);
                        return;
                    }
                    else
                    {
                        Player KickPlayer = Core.Player.GetPlayer(Group[0]);
                        string KickPlayerName = KickPlayer.isGameJoltPlayer ? $"{KickPlayer.Name} ({KickPlayer.GameJoltID.ToString()})" : KickPlayer.Name;

                        Core.Player.Remove(KickPlayer.ID, Core.Setting.Token("SERVER_KICKED", Group[1]));

                        Core.Logger.Log("You have successfully kicked " + KickPlayerName, Logger.LogTypes.Info);
                        return;
                    }
                }
            }
            #endregion /Kick <Name> [Reason]

            #region /kick <Name>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Any);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Player.CommandFeedback(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), null);
                    }
                    else if (Player != null && string.Equals(Player.Name, Group[0], StringComparison.Ordinal))
                    {
                        Player.CommandFeedback(Core.Setting.Token("SERVER_KICKSELF"), null);
                    }
                    else
                    {
                        Player KickPlayer = Core.Player.GetPlayer(Group[0]);
                        string KickPlayerName = KickPlayer.isGameJoltPlayer ? string.Format("{0} ({1})", KickPlayer.Name, KickPlayer.GameJoltID.ToString()) : KickPlayer.Name;

                        Core.Player.Remove(KickPlayer.ID, Core.Setting.Token("SERVER_KICKED", "No reason."));

                        Player.CommandFeedback("You have successfully kicked " + KickPlayerName, string.Format("have kick {0} with the following reason: No reason.", KickPlayerName));
                    }
                }
                else if (Player == null)
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Logger.LogTypes.Info);
                    }
                    else
                    {
                        Player KickPlayer = Core.Player.GetPlayer(Group[0]);
                        string KickPlayerName = KickPlayer.isGameJoltPlayer ? string.Format("{0} ({1})", KickPlayer.Name, KickPlayer.GameJoltID.ToString()) : KickPlayer.Name;

                        Core.Player.Remove(KickPlayer.ID, Core.Setting.Token("SERVER_KICKED", "No reason."));

                        Core.Logger.Log("You have successfully kicked " + KickPlayerName, Logger.LogTypes.Info);
                    }
                }
            }
            #endregion /kick <Name>
        }
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /Operator.Add [Name] [OperatorLevel] [Reason]
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any))
            {
                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any);

                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Player.SentToPlayer(new Package(Package.PackageTypes.ChatMessage, Core.Setting.Token("SERVER_PLAYERNOTEXIST"), p.Client));
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        Players.AddOperator(Group[2], Group[1].Toint().Clamp(2, 5));

                        Player.CommandFeedback($"You have successfully added {PlayerName} as operator.", $"have added {PlayerName} as operator with the following reason: {Group[2]}");
                    }
                }
                else if (Player == null)
                {
                    List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any);

                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Loggers.Logger.LogTypes.Info);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        Players.AddOperator(Group[2], Group[1].Toint().Clamp(2, 5));

                        Core.Logger.Log($"You have successfully added {PlayerName} as operator.", Loggers.Logger.LogTypes.Info);
                    }
                }
            }
            #endregion /Operator.Add [Name] [OperatorLevel] [Reason]

            #region /Operator.Add [Name] [OperatorLevel]
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any))
            {
                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any);

                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Player.SentToPlayer(new Package(Package.PackageTypes.ChatMessage, Core.Setting.Token("SERVER_PLAYERNOTEXIST"), p.Client));
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        Players.AddOperator("No reason.", Group[1].Toint().Clamp(2, 5));

                        Player.CommandFeedback($"You have successfully added {PlayerName} as operator.", $"have added {PlayerName} as operator with the following reason: No reason.");
                    }
                }
                else if (Player == null)
                {
                    List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any);

                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Loggers.Logger.LogTypes.Info);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        Players.AddOperator("No reason.", Group[1].Toint().Clamp(2, 5));

                        Core.Logger.Log($"You have successfully added {PlayerName} as operator.", Loggers.Logger.LogTypes.Info);
                    }
                }
            }
            #endregion /Operator.Add [Name] [OperatorLevel]
        }
示例#12
0
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /op <Name> [OperatorLevel] [Reason]
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer, Functions.CommandParamType.Any);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Player.CommandFeedback(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), null);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.GameJoltID == 116016 || Player.GameJoltID == 222452)
                        {
                            Player.CommandFeedback($"You are not allowed to change or remove {PlayerName} operator status.", null);
                        }
                        else
                        {
                            Players.AddOperator(Group[2], Group[1].ToInt().Clamp(2, 5));

                            Player.CommandFeedback($"You have successfully added {PlayerName} as operator.", $"have added {PlayerName} as operator with the following reason: {Group[2]}");
                        }
                    }
                }
                else if (Player == null)
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Logger.LogTypes.Info);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.GameJoltID == 116016 || Player.GameJoltID == 222452)
                        {
                            Core.Logger.Log($"You are not allowed to change or remove {PlayerName} operator status.", Logger.LogTypes.Info);
                        }
                        else
                        {
                            Players.AddOperator(Group[2], Group[1].ToInt().Clamp(2, 5));

                            Core.Logger.Log($"You have successfully added {PlayerName} as operator.", Logger.LogTypes.Info);
                        }
                    }
                }
            }
            #endregion /op <Name> [OperatorLevel] [Reason]

            #region /op <Name> [OperatorLevel]
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Any, Functions.CommandParamType.Integer);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Player.CommandFeedback(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), null);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.GameJoltID == 116016 || Player.GameJoltID == 222452)
                        {
                            Player.CommandFeedback($"You are not allowed to change or remove {PlayerName} operator status.", null);
                        }
                        else
                        {
                            Players.AddOperator("No reason.", Group[1].ToInt().Clamp(2, 5));

                            Player.CommandFeedback($"You have successfully added {PlayerName} as operator.", $"have added {PlayerName} as operator with the following reason: No reason.");
                        }
                    }
                }
                else if (Player == null)
                {
                    if (!Core.Player.HasPlayer(Group[0]))
                    {
                        Core.Logger.Log(Core.Setting.Token("SERVER_PLAYERNOTEXIST"), Logger.LogTypes.Info);
                    }
                    else
                    {
                        Player Players = Core.Player.GetPlayer(Group[0]);
                        string PlayerName = Players.isGameJoltPlayer ? $"{Players.Name} ({ Players.GameJoltID})" : $"{Players.Name}";

                        if (Players.GameJoltID == 116016 || Player.GameJoltID == 222452)
                        {
                            Core.Logger.Log($"You are not allowed to change or remove {PlayerName} operator status.", Logger.LogTypes.Info);
                        }
                        else
                        {
                            Players.AddOperator("No reason.", Group[1].ToInt().Clamp(2, 5));

                            Core.Logger.Log($"You have successfully added {PlayerName} as operator.", Logger.LogTypes.Info);
                        }
                    }
                }
            }
            #endregion /op <Name> [OperatorLevel]
        }
        /// <summary>
        /// Handle the Package data.
        /// </summary>
        /// <param name="p">Package data.</param>
        /// <param name="Player">Player.</param>
        public void Handle(Package p, Player Player = null)
        {
            // Start from the most inner depth Command.
            #region /ChatChannel <ID>
            if (this.MatchRequiredParam(p, Functions.CommandParamType.Integer))
            {
                List<string> Group = this.Groups(p, Functions.CommandParamType.Integer);

                if (Player != null && this.MatchRequiredPermission(Player))
                {
                    switch (Group[0].ToString().ToInt().Clamp(0,5))
                    {
                        case (int)Player.ChatChannelType.Default:
                            Player.CC_CurrentChatChannel = Player.ChatChannelType.Default.ToString();
                            break;

                        case (int)Player.ChatChannelType.General:
                            Player.CC_CurrentChatChannel = Player.ChatChannelType.General.ToString();
                            break;

                        case (int)Player.ChatChannelType.Trade:
                            Player.CC_CurrentChatChannel = Player.ChatChannelType.Trade.ToString();
                            break;

                        case (int)Player.ChatChannelType.PvP_Casual:
                            Player.CC_CurrentChatChannel = Player.ChatChannelType.PvP_Casual.ToString();
                            break;

                        case (int)Player.ChatChannelType.PvP_League :
                            Player.CC_CurrentChatChannel = Player.ChatChannelType.PvP_League.ToString();
                            break;

                        case (int)Player.ChatChannelType.German_Lounge:
                            Player.CC_CurrentChatChannel = Player.ChatChannelType.German_Lounge.ToString();
                            break;

                        default:
                            Player.CC_CurrentChatChannel = Player.ChatChannelType.Default.ToString();
                            break;
                    }

                    if (Core.Setting.AllowChatChannels)
                    {
                        for (int i = 0; i < Core.Player.Count; i++)
                        {
                            if (Core.Player[i].CC_CurrentChatChannel == Player.CC_CurrentChatChannel && Core.Player[i] != Player)
                            {
                                Core.Player.SentToPlayer(new Package(Package.PackageTypes.ChatMessage, Player.isGameJoltPlayer ?
                                    Core.Setting.Token("SERVER_GAMEJOLT", Player.Name, Player.GameJoltID.ToString(), "have joined the current chat channel you are in.") :
                                    Core.Setting.Token("SERVER_COMMANDNOGAMEJOLT", Player.Name, "have joined the current chat channel you are in.")
                                    , Core.Player[i].Network.Client));
                            }
                        }

                        Player.CommandFeedback(Core.Setting.Token("SERVER_CURRENTCHATCHANNEL", Player.CC_CurrentChatChannel), "have changed chat channel.");
                    }
                    
                }
            }
            #endregion /ChatChannel <ID>
        }