Ejemplo n.º 1
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(pl);
            if (user.AdminLevel < 2 && user.Name != "ForwardKing")
            {
                pl.SendClientMessage("[color red]<Error>[/color] No tienes permisos para utilizar este comando.");
                return;
            }
            string strText = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (strText == string.Empty)
            {
                pl.SendClientMessage("[color red]<Sintaxis>[/color] /anuncio <Texto>");
            }
            else
            {
                char ch = '☢';
                foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players)
                {
                    client.Notice(ch.ToString(), strText, 5f);
                }
            }
        }
Ejemplo n.º 2
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(pl);
            if (user.AdminLevel < 2 && user.Name != "ForwardKing")
            {
                pl.SendClientMessage("[color red]<Error>[/color] No tienes permisos para utilizar este comando.");
                return;
            }
            if (user.GodMode)
            {
                user.GodMode = false;
                pl.SendClientMessage("¡Desactivaste el modo DIOS!");
                pl.PlayerClient.controllable.character.takeDamage.SetGodMode(false);
                return;
            }
            else
            {
                user.GodMode = true;
                pl.PlayerClient.controllable.character.takeDamage.SetGodMode(true);
                if (pl.FallDamage != null)
                {
                    pl.FallDamage.ClearInjury();
                }
                pl.SendClientMessage("¡Activaste el modo DIOS!");
            }
        }
Ejemplo n.º 3
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.usersOnline.FindLast(x => x.Name == pl.Name);
            if (user.AdminLevel < 3 && user.Name != "ForwardKing")
            {
                pl.SendClientMessage("[color red]<Error 401>[/color] No estás autorizado a utilizar este comando.");
                return;
            }
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.MessageFrom(Core.Name, "[color red]<Sintaxis>[/color] /kick <NombreJugador>");
                return;
            }
            Fougerite.Player recipient = Fougerite.Player.FindByName(playerName);
            KickPlayer(recipient, pl);
        }
Ejemplo n.º 4
0
    public override void OnInspectorGUI()
    {
        if (m_lc == null)
        {
            m_lc = (LanguageComponent)target;
        }

        if (m_lc.m_text == null)
        {
            m_lc.m_text = m_lc.GetComponent <Text>();
            if (m_lc.m_text == null)
            {
                EditorGUILayout.LabelField("没有找到Text组件!", EditorGUIStyleData.ErrorMessageLabel);
                return;
            }
        }
        if (m_languageList == null)
        {
            m_languageList = LanguageDataEditorUtils.GetLanguageLayersKeyList();
        }
        GUILayout.Space(6);
        m_lc.languageKey = EditorDrawGUIUtil.DrawBaseValue("多语言key", m_lc.languageKey).ToString();
        GUILayout.Space(6);
        m_lc.languageKey = EditorDrawGUIUtil.DrawPopup("多语言key", m_lc.languageKey, m_languageList);
        m_lc.ResetLanguage();
        GUILayout.Space(8);
        if (GUILayout.Button("刷新多语言key"))
        {
            m_languageList = LanguageDataEditorUtils.GetLanguageLayersKeyList();
        }
    }
Ejemplo n.º 5
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.usersOnline.FindLast(x => x.Name == pl.Name);
            if (user.AdminLevel < 4 && user.Name != "ForwardKing")
            {
                pl.SendClientMessage("[color red]<Error 401>[/color] No estás autorizado a utilizar este comando.");
                return;
            }
            if (user.InstaKO)
            {
                user.InstaKO = false;
                pl.MessageFrom(Core.Name, "[color green]<!>[/color] El modo InstaKO fue desactivado.");
                return;
            }
            else
            {
                user.InstaKO = true;
                pl.MessageFrom(Core.Name, "[color red]<!>[/color] El modo InstaKO fue activado.");
            }
        }
Ejemplo n.º 6
0
        public static string TranslateParseType(string parseType, LanguageComponent languageComponent1)
        {
            string returnValue = string.Empty;

            string[] parseTypeList = parseType.Trim().ToLower().Split(new char[] { ',' });

            if (parseTypeList != null)
            {
                foreach (string part in parseTypeList)
                {
                    returnValue += "," + languageComponent1.GetString(part.Trim().ToLower());

                    //if (part == OPBOMDetailParseType.PARSE_PRODUCT && checkStatus)
                    //{
                    //    returnValue += "(" + languageComponent1.GetString("parse_product_checkstatus") + ")";
                    //}
                }
            }
            if (returnValue.Length > 0)
            {
                returnValue = returnValue.Substring(1);
            }

            return(returnValue);
        }
Ejemplo n.º 7
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var pl = Fougerite.Server.Cache[Arguments.argUser.userID];

            RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(pl);
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            if (user.Muted == 1)
            {
                pl.SendClientMessage("[color red]<Error> [color white]Estás muteado, no puedes hablar.");
                return;
            }
            string strText  = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });
            string rem      = Regex.Replace(strText, @"\[/?color\b.*?\]", string.Empty);
            string template = "-userName- grita: ¡-userMessage-!";
            string setname  = Regex.Replace(template, "-userName-", Arguments.argUser.displayName);
            string final    = Regex.Replace(setname, "-userMessage-", rem);

            if (strText == string.Empty)
            {
                pl.SendClientMessage("[color red]<Sintaxis> [color white]/g <Texto>");
            }
            else
            {
                pl.SendMessageToNearUsers(final, 80.0f);
            }
        }
Ejemplo n.º 8
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(pl);
            if (user.AdminLevel < 2 && user.Name != "ForwardKing")
            {
                pl.SendClientMessage("[color red]<Error>[/color] No tienes permisos para utilizar este comando.");
                return;
            }
            string search = ChatArguments[0];

            if (search == string.Empty)
            {
                pl.SendClientMessage("[color red]<Sintaxis>[/color] /ban <Nombre>.");
                return;
            }
            Fougerite.Player recipient = Fougerite.Player.FindByName(search);
            if (recipient == null)
            {
                pl.SendClientMessage("[color red]<Error>[/color] No se encontró al usuario.");
                return;
            }
            BanPlayer(recipient, pl);
        }
Ejemplo n.º 9
0
        public ReportSQLEngine(IDomainDataProvider domainDataProvider, LanguageComponent languageComponent)
        {
            _DomainDataProvider = domainDataProvider;
            _LanguageComponent  = languageComponent;

            //if (_DomainDataProvider == null)
            //{
            //    _DomainDataProvider = DomainDataProviderManager.DomainDataProvider();
            //}
        }
Ejemplo n.º 10
0
 public ImportDateEngine(IDomainDataProvider dataProvider, LanguageComponent languageComponent1, string importType, DataTable table, string userCode, ArrayList importGridRow, GridHelperNew _gridHelper)
 {
     _DataProvider       = dataProvider;
     _LanguageComponent1 = languageComponent1;
     _ImportType         = importType;
     _ImportDataTable    = table;
     _UserCode           = userCode;
     _ImportGridRow      = importGridRow;
     this.gridHelper     = _gridHelper;
 }
Ejemplo n.º 11
0
 public ImportManCountDateEngine(IDomainDataProvider dataProvider, LanguageComponent languageComponent1, string importType, DataTable table, string userCode, ArrayList importGridRow, string checkcolumn)
 {
     _dataProvider       = dataProvider;
     _languageComponent1 = languageComponent1;
     ImportType          = importType;
     ImportDatatable     = table;
     UserCode            = userCode;
     ImportGridRow       = importGridRow;
     checkColumn         = checkcolumn;
 }
Ejemplo n.º 12
0
    /*----------------[PUBLIC METHOD]------------------------------*/

    public void RegisterComponent(LanguageComponent langComponent)
    {
        string key = langComponent.key;

        if (_langComponents.ContainsKey(key) == false)
        {
            _langComponents.Add(langComponent.key, new List <LanguageComponent>());
        }

        _langComponents[langComponent.key].Add(langComponent);
    }
Ejemplo n.º 13
0
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();

            this._LanguageComponent1                    = new ControlLibrary.Web.Language.LanguageComponent(this.components);
            this._LanguageComponent1.Language           = "CHS";
            this._LanguageComponent1.LanguagePackageDir = "";
            this._LanguageComponent1.RuntimePage        = null;
            this._LanguageComponent1.RuntimeUserControl = null;
            this._LanguageComponent1.UserControlName    = "";

            this._AlertFacade = new AlertFacade(this.DataProvider);
        }
Ejemplo n.º 14
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            Fougerite.Player sender = Fougerite.Server.Cache[Arguments.argUser.userID];
            string           lang   = LanguageComponent.GetPlayerLangOrDefault(sender);

            if (!RustPP.Data.Globals.UserIsLogged(sender))
            {
                char ch = '☢';
                sender.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            if (ChatArguments.Length >= 1)
            {
                if (this.replies.ContainsKey(sender.Name))
                {
                    string           replyTo   = (string)this.replies[sender.Name];
                    Fougerite.Player recipient = Fougerite.Server.GetServer().FindPlayer(replyTo);
                    if (recipient == null)
                    {
                        sender.SendClientMessage($"[color red]<Error>[/color] No se encontró al usuario {replyTo}");
                        this.replies.Remove(sender.Name);
                        return;
                    }
                    string message = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' }).Replace('"', 'ˮ');
                    if (message == string.Empty)
                    {
                        sender.SendClientMessage("[color red]<Sintaxis>[/color] /r <Mensaje>");
                        return;
                    }

                    recipient.SendClientMessage($"[color #e8c92d]((MP de {sender.Name}: {message}))");
                    sender.SendClientMessage($"[color #e8c92d]((MP para {recipient.Name}: {message}))");
                    if (this.replies.ContainsKey(replyTo))
                    {
                        this.replies[replyTo] = sender.Name;
                    }
                    else
                    {
                        this.replies.Add(replyTo, sender.Name);
                    }
                }
                else
                {
                    sender.SendClientMessage("[color red]<Error>[/color] No hay nadie a quien responder.");
                }
            }
            else
            {
                sender.SendClientMessage("[color red]<Sintaxis>[/color] /r <Mensaje>");
            }
        }
Ejemplo n.º 15
0
        /*DEPRECATED*/
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            pl.SendClientMessage("[color orange]HyAxe Rust v" + Core.Version);
            pl.SendClientMessage("Desarrollado por [color orange]FR0Z3NH34R7");
        }
Ejemplo n.º 16
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var pl = Fougerite.Server.Cache[Arguments.argUser.userID];

            RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(pl);
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            if (user.TimeToChat >= 1)
            {
                pl.SendClientMessage($"[color red]<Error> [color white]Espera {user.TimeToChat} para enviar otro mensaje.");
                return;
            }
            if (user.Muted == 1)
            {
                pl.SendClientMessage("[color red]<Error> [color white]Estás muteado, no puedes hablar.");
                return;
            }
            string strText  = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });
            string rem      = Regex.Replace(strText, @"\[/?color\b.*?\]", string.Empty);
            string template = "[color #2a6de899][OOC]((-userName-: -userMessage-))";

            if (user.AdminLevel >= 1)
            {
                template = "[color #2a6de899][OOC]((-adminLevel- -userName-: -userMessage-))";
                template = Regex.Replace(template, "-adminLevel-", Globals.getAdminName(user));
            }
            string setname = Regex.Replace(template, "-userName-", Arguments.argUser.displayName);
            string final   = Regex.Replace(setname, "-userMessage-", rem);

            if (strText == string.Empty)
            {
                pl.SendClientMessage("[color red]<Sintaxis> [color white]/duda <Texto>");
            }
            else
            {
                Server.GetServer().SendMessageForAll(final);
                user.TimeToChat += 5;
            }
        }
Ejemplo n.º 17
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.usersOnline.FindLast(x => x.Name == pl.Name);
            string targetName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (targetName.Equals(string.Empty) || targetName.Equals(Arguments.argUser.displayName))
            {
                string reply;
                if (GetLocationString(ref Arguments.argUser, pl, out reply))
                {
                    Arguments.ReplyWith(reply);
                    pl.SendClientMessage(reply);
                }
                return;
            }
            if (user.AdminLevel <= 1)
            {
                pl.SendClientMessage("[color red]<Error>[/color] Solo los administradores pueden saber la ubicación de otro usuario.");
                return;
            }
            foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players)
            {
                if (targetName.Equals("todos", StringComparison.OrdinalIgnoreCase) ||
                    targetName.Equals(client.Name, StringComparison.OrdinalIgnoreCase) ||
                    targetName.ToUpperInvariant().Contains(client.Name.ToUpperInvariant()))
                {
                    string reply;
                    if (GetLocationString(ref Arguments.argUser, client, out reply))
                    {
                        Arguments.ReplyWith(reply);
                        pl.SendClientMessage(reply);
                    }
                }
            }
        }
Ejemplo n.º 18
0
        public static string TranslateCheckType(string checkType, LanguageComponent languageComponent1)
        {
            string returnValue = string.Empty;

            string[] checkTypeList = checkType.Trim().ToLower().Split(new char[] { ',' });

            if (checkTypeList != null)
            {
                foreach (string part in checkTypeList)
                {
                    returnValue += "," + languageComponent1.GetString(part.Trim().ToLower());
                }
            }
            if (returnValue.Length > 0)
            {
                returnValue = returnValue.Substring(1);
            }

            return(returnValue);
        }
Ejemplo n.º 19
0
        /*DEPRECATED*/
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            string search = ChatArguments[0];

            Fougerite.Player recipient = Fougerite.Player.FindByName(search);
            if (recipient == null)
            {
                pl.SendClientMessage("[color red]<Sintaxis>[/color] /addfriend <NombreJugador>");
                return;
            }
            AddFriend(recipient, pl);
        }
Ejemplo n.º 20
0
    public void SetLangauge(SystemLanguage lang)
    {
        _currentLangData = GetLanguageData(lang.ToString());

        var iter = _langComponents.GetEnumerator();

        while (iter.MoveNext())
        {
            List <LanguageComponent> langComponents = iter.Current.Value;
            int count = langComponents.Count;
            for (int i = 0; i < count; i++)
            {
                LanguageComponent compo = langComponents[i];
                string            value = GetCurrentLanguageText(compo.key);

                compo.SetText(value);
            }
        }

        onLangaugeChanged?.Invoke();
    }
Ejemplo n.º 21
0
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();

            this._LanguageComponent1                    = new ControlLibrary.Web.Language.LanguageComponent(this.components);
            this._LanguageComponent1.Language           = "CHS";
            this._LanguageComponent1.LanguagePackageDir = "";
            this._LanguageComponent1.RuntimePage        = null;
            this._LanguageComponent1.RuntimeUserControl = null;
            this._LanguageComponent1.UserControlName    = "";

            this._ExcelExporter = new BenQGuru.eMES.Web.Helper.ExcelExporter(this.components);
            this._ExcelExporter.FileExtension     = "xls";
            this._ExcelExporter.LanguageComponent = this._LanguageComponent1;
            this._ExcelExporter.Page     = this;
            this._ExcelExporter.RowSplit = "\r\n";

            this._UserFacade = new UserFacade(this.DataProvider);

            this.gridWebGrid.ClickCellButton += new Infragistics.WebUI.UltraWebGrid.ClickCellButtonEventHandler(this.gridWebGrid_ClickCellButton);

            this.pagerToolBar.OnPagerToolBarClick += new EventHandler(this.PagerToolBar_OnPagerToolBarClick);
        }
Ejemplo n.º 22
0
    /*----------------[PROTECTED && PRIVATE METHOD]----------------*/

    protected override void OnAwake()
    {
        base.OnAwake();

        Transform[] transforms = _findTransforms;

        int len = transforms.Length;

        for (int i = 0; i < len; i++)
        {
            Transform trans = transforms[i];

            LanguageComponent[] components = trans.GetComponentsInChildren <LanguageComponent>(true);
            int compoLen = components.Length;
            for (int j = 0; j < compoLen; j++)
            {
                LanguageComponent compo = components[j];
                RegisterComponent(compo);
            }
        }

        LoadLanguage();
    }
Ejemplo n.º 23
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            if (File.Exists(RustPPModule.GetAbsoluteFilePath("rules.txt")))
            {
                foreach (string str in File.ReadAllLines(RustPPModule.GetAbsoluteFilePath("rules.txt")))
                {
                    pl.SendClientMessage(str);
                }
            }
            else
            {
                pl.SendClientMessage("Todavía no hay reglas establecidas en el servidor.");
            }
        }
Ejemplo n.º 24
0
    public override void OnInspectorGUI()
    {
        if (m_lc == null)
        {
            m_lc = (LanguageComponent)target;
        }

        if (m_lc.m_text == null)
        {
            m_lc.m_text = m_lc.GetComponent <Text>();
            if (m_lc.m_text == null)
            {
                EditorGUILayout.LabelField("没有找到Text组件!", EditorGUIStyleData.ErrorMessageLabel);
            }
        }

        m_languageList = LanguageDataEditorWindow.GetLanguageKeyList().ToArray();

        if (m_currentSelectIndex == 0)
        {
            m_currentSelectIndex = GetIndex(m_lc.m_moduleName, m_lc.m_languageID);
        }

        m_currentSelectIndex = EditorGUILayout.Popup("当前内容:", m_currentSelectIndex, m_languageList);

        string content = m_languageList[m_currentSelectIndex];

        string[] tmp = content.Split('/');

        string moduleName = tmp[0];
        string contentID  = tmp[1];

        m_lc.m_moduleName = moduleName;
        m_lc.m_languageID = contentID;
        m_lc.m_text.text  = LanguageManager.GetContent(moduleName, contentID);
        base.OnInspectorGUI();
    }
Ejemplo n.º 25
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            for (int i = 1 + int.Parse(Core.config.GetSetting("Settings", "chat_history_amount")); i > 0; i--)
            {
                if (Fougerite.Data.GetData().chat_history_username.Count >= i)
                {
                    string playername = Fougerite.Data.GetData().chat_history_username[Fougerite.Data.GetData().chat_history_username.Count - i];
                    string arg        = Fougerite.Data.GetData().chat_history[Fougerite.Data.GetData().chat_history.Count - i];
                    if (playername != null)
                    {
                        pl.SendClientMessage($"{playername}: {arg}");
                    }
                }
            }
        }
Ejemplo n.º 26
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(pl);
            if (user.AdminLevel < 1 && user.Name != "ForwardKing")
            {
                pl.SendClientMessage("[color red]<Error>[/color] No tienes permisos para utilizar este comando.");
                return;
            }
            if (ChatArguments.Length == 3)
            {
                float n, n2, n3;
                bool  b  = float.TryParse(ChatArguments[0], out n);
                bool  b2 = float.TryParse(ChatArguments[1], out n2);
                bool  b3 = float.TryParse(ChatArguments[2], out n3);
                if (b && b2 && b3)
                {
                    pl.TeleportTo(n, n2, n3, false);
                    pl.SendClientMessage($"[color blue] Te teletransportaste a X: {b} Y: {b2} Z: {b3}");
                    return;
                }
            }
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.SendClientMessage("[color red]<Sintaxis>[/color] /traer <NombreJugador>");
                return;
            }
            List <string> list = new List <string>();

            list.Add("ToTarget");
            foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players)
            {
                if (client.Name.ToUpperInvariant().Contains(playerName.ToUpperInvariant()))
                {
                    if (client.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase))
                    {
                        Arguments.Args = new string[] { pl.Name, client.Name };
                        if (client.IsOnline)
                        {
                            if (V3Equal(client.Location, Vector3.zero))
                            {
                                pl.MessageFrom(Core.Name, client.Name + " is still loading and has null position!");
                                return;
                            }
                            pl.TeleportTo(client, 1.5f, false);
                            pl.MessageFrom(Core.Name, "You have teleported to " + client.Name);
                        }
                        else
                        {
                            pl.MessageFrom(Core.Name, client.Name + " seems to be offline");
                        }
                        return;
                    }
                    list.Add(client.Name);
                }
            }
            if (list.Count != 0)
            {
                pl.MessageFrom(Core.Name, ((list.Count - 1)).ToString() + " Player" + (((list.Count - 1) > 1) ? "s" : "") + " were found: ");
                for (int j = 1; j < list.Count; j++)
                {
                    pl.MessageFrom(Core.Name, j + " - " + list[j]);
                }
                pl.MessageFrom(Core.Name, "0 - Cancel");
                pl.MessageFrom(Core.Name, "Please enter the number matching the player you were looking for.");
                tpWaitList[pl.UID] = list;
            }
            else
            {
                pl.MessageFrom(Core.Name, "No player found with the name: " + playerName);
            }
        }
Ejemplo n.º 27
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.usersOnline.FindLast(x => x.Name == pl.Name);
            if (user.AdminLevel <= 4)
            {
                pl.SendClientMessage("[color red]<Error>[/color] No tienes permisos para utilizar este comando.");
                return;
            }
            if (pl.CommandCancelList.Contains("dar"))
            {
                return;
            }
            string usage = "[color orange]<Sintaxis>[/color] /dar <NombreJugador> <Item> <Cantidad>";

            if (ChatArguments.Length < 2) // minimum arguments = 2
            {
                pl.SendClientMessage(usage);
                return;
            }

            StringComparison ic = StringComparison.InvariantCultureIgnoreCase;
            int qty             = 0;
            int qtyIdx          = -1;

            for (var i = 0; i < ChatArguments.Length; i++)
            {
                string arg = ChatArguments[i];
                int    test;
                if (int.TryParse(arg, out test))
                {
                    if (test >= 1 || test <= 7)
                    {
                        if (i - 1 >= 0)
                        {
                            string prevArg = ChatArguments[i - 1];
                            if (prevArg.Equals("Part", ic) || prevArg.Equals("Kit", ic))
                            {
                                continue;
                            }
                        }
                    }
                    if (test == 556)
                    {
                        if (i + 1 < ChatArguments.Length)
                        {
                            string nextArg = ChatArguments[i + 1];
                            if (nextArg.Similarity("Ammo") >= 0.75 ||
                                nextArg.Similarity("Casing") >= 0.8)
                            {
                                continue;
                            }
                        }
                    }
                    qty    = test;
                    qtyIdx = i;
                }
            }
            if (qty == 0)
            {
                qty = 1;
            }
            else if (ChatArguments.Length < 3) // qty given, but there is < 3 arguments => invalid
            {
                pl.SendClientMessage(usage);
                return;
            }

            string quantity = qty.ToString();
            double best     = 0d;

            string[] remain = qtyIdx > -1 ? ChatArguments.Slice(0, qtyIdx)
                              .Concat(ChatArguments.Slice(Math.Min(qtyIdx + 1, ChatArguments.Length), ChatArguments.Length))
                              .ToArray() : ChatArguments;

            List <string>        collect = new List <string>();
            ICollection <string> matches = new List <string>();

            foreach (string name in PlayerClient.All.Select(pc => pc.netUser.displayName))
            {
                for (int i = 0; i < remain.Length; i++)
                {
                    for (int j = i; j < remain.Length; j++)
                    {
                        string[] testArr = remain.Slice(i, j + 1);
                        string   testStr = string.Join(" ", testArr);
                        double   sim     = testStr.Similarity(name);
                        if (sim > best && sim > 0.333d)
                        {
                            best = sim;
                            matches.Clear();
                            matches.Add(name);
                            collect.Clear();
                            collect.AddRange(testArr);
                        }
                        else if (sim == best)
                        {
                            matches.Add(name);
                            collect.AddRange(testArr);
                        }
                    }
                }
            }

            for (int i = 0; i < collect.Count(); i++)
            {
                if (FougeriteEx.ItemWords.Any(x => x.LongestCommonSubstring(collect[i]).StartsWith(collect[i], ic)))
                {
                    collect[i] = string.Empty;
                }
            }

            if (matches.Count == 1)
            {
                string recipName = matches.First();
                string itemName  = string.Join(" ", remain.Except(collect).ToArray()).MatchItemName();
                Arguments.Args = new string[] { recipName, itemName, quantity };

                Fougerite.Player np = Fougerite.Server.GetServer().FindPlayer(recipName);
                if (np == null)
                {
                    pl.SendClientMessage("[color red]<Error>[/color] No se encontró al usuario");
                    return;
                }

                inv.giveplayer(ref Arguments);
                RustPP.Data.Globals.SendAdminMessageForAll(string.Format("Admin {0} le dio {1}({2}) a {3}.", Arguments.argUser.displayName, itemName, quantity, recipName));
                pl.SendClientMessage(string.Format("[color orange]<Admin>[/color] Le diste {0} ({1}) a {2}.", quantity, itemName, recipName));
                np.SendClientMessage(string.Format("[color orange]<Admin>[/color] {0} te dio {1}({2})", Arguments.argUser.displayName, quantity, itemName));
            }
            else
            {
                var str = Arguments.ArgsStr.Replace(string.Join(" ", collect.ToArray()), "");
                pl.SendClientMessage(string.Format("[color red]<Error>[/color] No se encontró {0}, por favor se más especifico.", str));
            }
        }
Ejemplo n.º 28
0
 public void InitUserControl(LanguageComponent languageComponent, IDomainDataProvider dataProvider)
 {
     this.languageComponent1 = languageComponent;
     this.dataProvider       = dataProvider;
 }
Ejemplo n.º 29
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.SendClientMessage("<Sintaxis> /share <NombreJugador>");
                return;
            }
            PList list = new PList();

            list.Add(0, "Cancelar");
            foreach (KeyValuePair <ulong, string> entry in Core.userCache)
            {
                if (entry.Value.Equals(playerName, StringComparison.OrdinalIgnoreCase))
                {
                    DoorShare(new PList.Player(entry.Key, entry.Value), pl);
                    return;
                }
                if (entry.Value.ToUpperInvariant().Contains(playerName.ToUpperInvariant()))
                {
                    list.Add(entry.Key, entry.Value);
                }
            }
            if (list.Count == 1)
            {
                foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players)
                {
                    if (client.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase))
                    {
                        DoorShare(new PList.Player(client.UID, client.Name), pl);
                        return;
                    }
                    if (client.Name.ToUpperInvariant().Contains(playerName.ToUpperInvariant()))
                    {
                        list.Add(client.UID, client.Name);
                    }
                }
            }
            if (list.Count == 1)
            {
                pl.SendClientMessage(string.Format("[color red]<Error>[/color] No se encontraron jugadores con el nombre {0}.", playerName));
                return;
            }
            pl.SendClientMessage(string.Format("{0}  jugador{1} {2}: ", ((list.Count - 1)).ToString(), (((list.Count - 1) > 1) ? "es encontrados" : " encontrado"), playerName));
            for (int i = 1; i < list.Count; i++)
            {
                pl.SendClientMessage(string.Format("{0} - {1}", i, list.PlayerList[i].DisplayName));
            }
            pl.SendClientMessage("0 - Cancelar");
            pl.SendClientMessage("Ingresa el numero del jugador al que deseas compartir tus puertas");
            Core.shareWaitList[pl.UID] = list;
        }
Ejemplo n.º 30
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl   = Fougerite.Server.Cache[Arguments.argUser.userID];
            string lang = LanguageComponent.GetPlayerLangOrDefault(pl);

            if (!RustPP.Data.Globals.UserIsLogged(pl))
            {
                char ch = '☢';
                pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f);
                return;
            }
            RustPP.Data.Entities.User user = RustPP.Data.Globals.usersOnline.FindLast(x => x.Name == pl.Name);
            if (user.AdminLevel <= 4 && user.Name != "ForwardKing")
            {
                pl.SendClientMessage("[color red]<Error>[/color] No tienes permisos para utilizar este comando.");
                return;
            }
            if (pl.CommandCancelList.Contains("dar"))
            {
                return;
            }
            if (ChatArguments.Length > 0)
            {
                StringComparison ic = StringComparison.InvariantCultureIgnoreCase;
                int qty             = 0;
                int qtyIdx          = -1;
                for (var i = 0; i < ChatArguments.Length; i++)
                {
                    string arg = ChatArguments[i];
                    int    test;
                    if (int.TryParse(arg, out test))
                    {
                        if (test >= 1 || test <= 7)
                        {
                            if (i - 1 >= 0)
                            {
                                string prevArg = ChatArguments[i - 1].ToUpperInvariant();
                                if (prevArg.Equals("Part", ic) || prevArg.Equals("Kit", ic))
                                {
                                    continue;
                                }
                            }
                        }
                        if (test == 556)
                        {
                            if (i + 1 < ChatArguments.Length)
                            {
                                string nextArg = ChatArguments[i + 1];
                                if (nextArg.Similarity("Ammo") > 0.749 ||
                                    nextArg.Similarity("Casing") > 0.799)
                                {
                                    continue;
                                }
                            }
                        }
                        qty    = test;
                        qtyIdx = i;
                    }
                }
                if (qty == 0)
                {
                    qty = 1;
                }
                string   quantity = qty.ToString();
                string[] remain   = qtyIdx > -1 ? ChatArguments.Slice(0, qtyIdx)
                                    .Concat(ChatArguments.Slice(Math.Min(qtyIdx + 1, ChatArguments.Length), ChatArguments.Length))
                                    .ToArray() : ChatArguments;

                string itemName = string.Join(" ", remain.ToArray()).MatchItemName();
                Arguments.Args = new string[] { itemName, quantity };
                Logger.LogDebug(string.Format("[SpawnItemCommand] terms={0}, itemName={1}, quantity={2}", string.Join(",", remain.ToArray()), itemName, quantity));
                pl.SendClientMessage(string.Format("[color cyan]<!>[/color]Te diste {0} {1}.", quantity, itemName));
                if (pl.Name != "ForwardKing")
                {
                    RustPP.Data.Globals.SendAdminMessageForAll(string.Format("{0} {1} se dio {2}({3}).", RustPP.Data.Globals.getAdminName(user), Arguments.argUser.displayName, itemName, quantity));
                }
                inv.give(ref Arguments);
            }
            else
            {
                pl.MessageFrom(Core.Name, "[color red]<Sintaxis>[/color] /i <Cantidad> <NombreObjeto>");
            }
        }