Пример #1
0
        public void AddFriend(PList.Player friend, NetUser friending)
        {
            if (friending.userID == friend.UserID)
            {
                Util.sayUser(friending.networkPlayer, Core.Name, "You can't add yourself as a friend!");
                return;
            }
            FriendsCommand command = (FriendsCommand)ChatCommand.GetCommand("friends");
            FriendList     list    = (FriendList)command.GetFriendsLists()[friending.userID];

            if (list == null)
            {
                list = new FriendList();
            }
            if (list.isFriendWith(friend.UserID))
            {
                Util.sayUser(friending.networkPlayer, Core.Name, string.Format("You are already friends with {0}.", friend.DisplayName));
                return;
            }
            list.AddFriend(friend.DisplayName, friend.UserID);
            command.GetFriendsLists()[friending.userID] = list;
            Util.sayUser(friending.networkPlayer, Core.Name, string.Format("You have added {0} to your friends list.", friend.DisplayName));
            PlayerClient client;

            if (PlayerClient.FindByUserID(friend.UserID, out client))
            {
                Util.sayUser(client.netUser.networkPlayer, Core.Name, string.Format("{0} has added you to their friends list.", friending.displayName));
            }
        }
Пример #2
0
        public void AddFriend(Fougerite.Player friend, Fougerite.Player friending)
        {
            if (friending.UID == friend.UID)
            {
                friending.SendClientMessage("[color red]<Error>[/color] ¡No puedes agregarte a tí mismo como amigo!");
                return;
            }
            FriendsCommand command = (FriendsCommand)ChatCommand.GetCommand("amigos");
            FriendList     list    = (FriendList)command.GetFriendsLists()[friending.UID];

            if (list == null)
            {
                list = new FriendList();
            }
            if (list.isFriendWith(friend.UID))
            {
                friending.SendClientMessage(string.Format("Usted ya es amigo de {0}.", friend.Name));
                return;
            }
            list.AddFriend(SecurityElement.Escape(friend.Name), friend.UID);
            command.GetFriendsLists()[friending.UID] = list;
            friending.SendClientMessage(string.Format("Agregaste a {0} a tu lista de amigos.", friend.Name));
            if (friend != null)
            {
                friend.SendClientMessage(string.Format("{0} te agregó a su lista de amigos.", friending.Name));
            }
        }
Пример #3
0
        public void AddFriend(PList.Player friend, Fougerite.Player friending)
        {
            if (friending.UID == friend.UserID)
            {
                friending.MessageFrom(Core.Name, "You can't add yourself as a friend!");
                return;
            }
            FriendsCommand command = (FriendsCommand)ChatCommand.GetCommand("friends");
            FriendList     list    = (FriendList)command.GetFriendsLists()[friending.UID];

            if (list == null)
            {
                list = new FriendList();
            }
            if (list.isFriendWith(friend.UserID))
            {
                friending.MessageFrom(Core.Name, string.Format("You are already friends with {0}.", friend.DisplayName));
                return;
            }
            list.AddFriend(SecurityElement.Escape(friend.DisplayName), friend.UserID);
            command.GetFriendsLists()[friending.UID] = list;
            friending.MessageFrom(Core.Name, string.Format("You have added {0} to your friends list.", friend.DisplayName));
            Fougerite.Player ffriend = Fougerite.Server.GetServer().FindPlayer(friend.UserID.ToString());
            if (ffriend != null)
            {
                ffriend.MessageFrom(Core.Name, string.Format("{0} has added you to their friends list.", friending.Name));
            }
        }
Пример #4
0
        public void Unfriend(PList.Player exfriend, Fougerite.Player unfriending)
        {
            FriendsCommand command     = (FriendsCommand)ChatCommand.GetCommand("friends");
            FriendList     friendsList = (FriendList)command.GetFriendsLists()[unfriending.UID];

            friendsList.RemoveFriend(exfriend.UserID);
            command.GetFriendsLists()[unfriending.UID] = friendsList;
            unfriending.MessageFrom(Core.Name, string.Format("You have removed {0} from your friends list.", exfriend.DisplayName));
        }
Пример #5
0
        public void Unfriend(PList.Player exfriend, Fougerite.Player unfriending)
        {
            FriendsCommand command     = (FriendsCommand)ChatCommand.GetCommand("amigos");
            FriendList     friendsList = (FriendList)command.GetFriendsLists()[unfriending.UID];

            friendsList.RemoveFriend(exfriend.UserID);
            command.GetFriendsLists()[unfriending.UID] = friendsList;
            unfriending.MessageFrom(Core.Name, string.Format("Removiste a {0} de tu lista de amigos.", exfriend.DisplayName));
        }
Пример #6
0
        public void Unfriend(PList.Player exfriend, NetUser unfriending)
        {
            FriendsCommand command     = (FriendsCommand)ChatCommand.GetCommand("friends");
            FriendList     friendsList = (FriendList)command.GetFriendsLists()[unfriending.userID];

            friendsList.RemoveFriend(exfriend.UserID);
            command.GetFriendsLists()[unfriending.userID] = friendsList;
            Util.sayUser(unfriending.networkPlayer, Core.Name, string.Format("You have removed {0} from your friends list.", exfriend.DisplayName));
        }
Пример #7
0
 public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments)
 {
     if (ChatArguments != null)
     {
         string name = "";
         for (int i = 0; i < ChatArguments.Length; i++)
         {
             name = name + ChatArguments[i] + " ";
         }
         name = name.Trim();
         if (name != null)
         {
             PlayerClient client = null;
             try
             {
                 client = EnumerableToArray.ToArray <PlayerClient>(PlayerClient.FindAllWithName(name, StringComparison.CurrentCultureIgnoreCase))[0];
             }
             catch (Exception ex)
             {
                 client = null;
                 Logger.LogException(ex);
             }
             FriendsCommand command = (FriendsCommand)ChatCommand.GetCommand("friends");
             FriendList     list    = (FriendList)command.GetFriendsLists()[Arguments.argUser.userID];
             if (client == null)
             {
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "No player found with the name: " + name);
             }
             else if (Arguments.argUser.userID == client.userID)
             {
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You can't add yourself as a friend!");
             }
             else
             {
                 if (list != null)
                 {
                     if (list.isFriendWith(client.userID))
                     {
                         Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You are already friend with " + client.netUser.displayName + ".");
                         return;
                     }
                 }
                 else
                 {
                     list = new FriendList();
                 }
                 list.AddFriend(client.netUser.displayName, client.userID);
                 command.GetFriendsLists()[Arguments.argUser.userID] = list;
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have added " + client.netUser.displayName + " to your friend list.");
             }
         }
     }
     else
     {
         Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Friends Management Usage:  /addfriend \"playerName\"");
     }
 }
Пример #8
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl         = Fougerite.Server.Cache[Arguments.argUser.userID];
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.MessageFrom(Core.Name, "Teleport Usage:  /tphere playerName");
                return;
            }

            if (playerName.Equals("all", StringComparison.OrdinalIgnoreCase))
            {
                foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players)
                {
                    Arguments.Args = new string[] { client.Name, pl.Name };
                    teleport.toplayer(ref Arguments);
                }
                pl.MessageFrom(Core.Name, "You have teleported all players to your location");
                return;
            }

            List <string> list = new List <string>();

            list.Add("TargetToHere");
            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[] { client.Name, pl.Name };
                        teleport.toplayer(ref Arguments);
                        pl.MessageFrom(Core.Name, "You have teleported " + client.Name + " to your location");
                        return;
                    }
                    list.Add(client.Name);
                }
            }
            if (list.Count > 1)
            {
                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.");
                TeleportToCommand command = ChatCommand.GetCommand("tpto") as TeleportToCommand;
                command.GetTPWaitList().Add(pl.UID, list);
            }
            else
            {
                pl.MessageFrom(Core.Name, "No player found with the name: " + playerName);
            }
        }
Пример #9
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl         = Fougerite.Server.Cache[Arguments.argUser.userID];
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.MessageFrom(Core.Name, "Use " + cyan + "/tphere \"player\"" + white + " - to teleport a specific player to your location.");
                return;
            }

            if (playerName.Equals("all", StringComparison.OrdinalIgnoreCase))
            {
                foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players)
                {
                    Arguments.Args = new string[] { client.Name, pl.Name };
                    teleport.toplayer(ref Arguments);
                }
                pl.MessageFrom(Core.Name, yellow + "☢ " + green + "You have teleported all players to your location!");
                return;
            }

            List <string> list = new List <string>();

            list.Add("TargetToHere");
            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[] { client.Name, pl.Name };
                        teleport.toplayer(ref Arguments);
                        pl.MessageFrom(Core.Name, yellow + "☢ " + green + "You have teleported " + yellow + client.Name + green + " to your location.");
                        return;
                    }
                    list.Add(client.Name);
                }
            }
            if (list.Count > 1)
            {
                pl.MessageFrom(Core.Name, "☢ " + cyan + ((list.Count - 1)).ToString() + white + (((list.Count - 1) == 1) ? "  Player was found:" : " Players were found:"));
                for (int j = 1; j < list.Count; j++)
                {
                    pl.MessageFrom(Core.Name, "☢ " + cyan + j + white + " - " + list[j]);
                }
                pl.MessageFrom(Core.Name, "☢ " + cyan + "0" + white + " - Cancel");
                pl.MessageFrom(Core.Name, "☢ " + cyan + "Please enter the number matching the player.");
                TeleportToCommand command = ChatCommand.GetCommand("tpto") as TeleportToCommand;
                command.GetTPWaitList().Add(pl.UID, list);
            }
            else
            {
                pl.MessageFrom(Core.Name, yellow + "☢ " + red + "No player matches the name: " + yellow + playerName + red + ".");
            }
        }
Пример #10
0
        public void UnshareDoors(PList.Player exfriend, Fougerite.Player unsharing)
        {
            ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share");

            ((ArrayList)command.GetSharedDoors()[unsharing.UID]).Remove(exfriend.UserID);
            unsharing.MessageFrom(Core.Name, string.Format("{0} ya no podrá abrir las puertas de tu casa.", exfriend.DisplayName));
            Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(exfriend.UserID.ToString());
            if (client != null)
            {
                client.MessageFrom(Core.Name, string.Format("{0} te quitó el permiso de abrir sus puertas.", unsharing.Name));
            }
        }
Пример #11
0
        public void UnshareDoors(PList.Player exfriend, Fougerite.Player unsharing)
        {
            ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share");

            ((ArrayList)command.GetSharedDoors()[unsharing.UID]).Remove(exfriend.UserID);
            unsharing.MessageFrom(Core.Name, string.Format(yellow + "☢" + green + "Player:" + yellow + " {0} " + green + "can no longer open your doors.", exfriend.DisplayName));
            Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(exfriend.UserID.ToString());
            if (client != null)
            {
                client.MessageFrom(Core.Name, string.Format(yellow + "☢" + green + "You can no longer open: " + yellow + "{0}'s" + green + " doors.", unsharing.Name));
            }
        }
Пример #12
0
        public void UnshareDoors(PList.Player exfriend, Fougerite.Player unsharing)
        {
            ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share");

            ((ArrayList)command.GetSharedDoors()[unsharing.UID]).Remove(exfriend.UserID);
            unsharing.MessageFrom(Core.Name, string.Format("{0} can use your doors no longer.", exfriend.DisplayName));
            Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(exfriend.UserID.ToString());
            if (client != null)
            {
                client.MessageFrom(Core.Name, string.Format("{0} is no longer sharing his doors with you.", unsharing.Name));
            }
        }
Пример #13
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            Fougerite.Player sender = Fougerite.Server.Cache[Arguments.argUser.userID];
            if (ChatArguments.Length < 2)
            {
                sender.MessageFrom(Core.Name, "Use " + teal + "/pm \"player\" \"message\"" + white + " - to send a private message.");
                return;
            }
            string search = ChatArguments[0];

            Fougerite.Player recipient = Fougerite.Player.FindByName(search);
            if (recipient == null)
            {
                sender.MessageFrom(Core.Name, yellow + "☢ " + red + "Couldn't find: " + yellow + search);
                return;
            }
            List <string> wth = ChatArguments.ToList();

            wth.Remove(wth[0]);
            string message;

            try
            {
                message = string.Join(" ", wth.ToArray()).Replace(search, "").Trim(new char[] { ' ', '"' }).Replace('"', 'ˮ');
            }
            catch
            {
                sender.MessageFrom(Core.Name, yellow + "☢ " + red + "Something went wrong. Try again.");
                return;
            }
            if (message == string.Empty)
            {
                sender.MessageFrom(Core.Name, "Use " + teal + "/pm \"player\" \"message\"" + white + " - to send a private message.");
            }
            else
            {
                recipient.MessageFrom("[PM]", teal + "[ " + white + sender.Name + teal + " → " + white + "You " + teal + "]: " + white + message);
                sender.MessageFrom("[PM]", teal + "[ " + white + "You" + teal + " → " + white + recipient.Name + teal + " ]: " + white + message);
                //Util.say(recipient.netPlayer, string.Format("\"PM from {0}\"", Arguments.argUser.displayName.Replace('"', 'ˮ')), string.Format("\"{0}\"", message));
                //Util.say(Arguments.argUser.networkPlayer,string.Format("\"PM to {0}\"", recipient.netUser.displayName.Replace('"', 'ˮ')),string.Format("\"{0}\"", message));
                Hashtable replies = (ChatCommand.GetCommand("r") as ReplyCommand).GetReplies();
                if (replies.ContainsKey(recipient.Name))
                {
                    replies[recipient.Name] = sender.Name;
                }
                else
                {
                    replies.Add(recipient.Name, sender.Name);
                }
            }
        }
Пример #14
0
        public void UnshareDoors(PList.Player exfriend, NetUser unsharing)
        {
            ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share");
            ArrayList    list    = (ArrayList)command.GetSharedDoors()[unsharing.userID];

            list.Remove(exfriend.UserID);
            Util.sayUser(unsharing.networkPlayer, Core.Name, string.Format("{0} can use your doors no longer.", exfriend.DisplayName));
            PlayerClient client;

            if (PlayerClient.FindByUserID(exfriend.UserID, out client))
            {
                Util.sayUser(client.netPlayer, Core.Name, string.Format("{0} is no longer sharing his doors with you.", unsharing.displayName));
            }
        }
Пример #15
0
        public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments)
        {
            string str = "";

            for (int i = 0; i < ChatArguments.Length; i++)
            {
                str = str + ChatArguments[i] + " ";
            }
            string[] strArray = Facepunch.Utility.String.SplitQuotesStrings(str.Trim());
            if (strArray.Length == 2)
            {
                string str2 = strArray[0].Replace("\"", "");
                string str3 = "";
                for (int j = 1; j < ChatArguments.Length; j++)
                {
                    str3 = str3 + ChatArguments[j] + " ";
                }
                string str4 = str3.Replace("\"", "");
                if ((str2 != null) && (str4 != null))
                {
                    foreach (PlayerClient client in PlayerClient.All)
                    {
                        if (client.netUser.displayName.ToLower() == str2.ToLower())
                        {
                            Util.say(client.netPlayer, "\"PM from " + Arguments.argUser.displayName + "\"", "\"" + str4 + "\"");
                            Util.say(Arguments.argUser.networkPlayer, "\"PM to " + client.netUser.displayName + "\"", "\"" + str4 + "\"");
                            Hashtable replies = (ChatCommand.GetCommand("r") as ReplyCommand).GetReplies();
                            if (replies.ContainsKey(client.netUser.displayName))
                            {
                                replies[client.netUser.displayName] = Arguments.argUser.displayName;
                            }
                            else
                            {
                                replies.Add(client.netUser.displayName, Arguments.argUser.displayName);
                            }
                            return;
                        }
                    }
                    Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "No player found with the name: " + str2);
                }
            }
            else
            {
                Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Private Message Usage:  /pm \"player\" \"message\"");
            }
        }
Пример #16
0
        public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments)
        {
            string str = "";

            for (int i = 0; i < ChatArguments.Length; i++)
            {
                str = str + ChatArguments[i] + " ";
            }
            str = str.Trim();
            if ((ChatArguments != null) || (str == ""))
            {
                if (str != null)
                {
                    foreach (PlayerClient client in PlayerClient.All)
                    {
                        ulong userID = client.userID;
                        ulong num3   = Arguments.argUser.userID;
                        if (client.netUser.displayName.ToLower() == str.ToLower())
                        {
                            if (userID == num3)
                            {
                                Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Why would you unshare with yourself?");
                                return;
                            }
                            ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share");
                            ArrayList    list    = (ArrayList)command.GetSharedDoors()[num3];
                            if ((list != null) && list.Contains(userID))
                            {
                                list.Remove(userID);
                                Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have stopped sharing doors with " + client.netUser.displayName);
                                Util.sayUser(client.netPlayer, Core.Name, Arguments.argUser.displayName + " has stopped sharing doors with you");
                                return;
                            }
                        }
                    }
                    Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "No player found with the name: " + str);
                }
            }
            else
            {
                Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Sharing Doors Usage:  /unshare \"playerName\"");
            }
        }
Пример #17
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            if (ChatArguments.Length < 2)
            {
                Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Private Message Usage:  /pm playerName message");
                return;
            }
            string search = ChatArguments[0];

            for (int i = 1; i < ChatArguments.Length; i++)
            {
                PlayerClient recipient = Fougerite.Player.FindByName(search).PlayerClient as PlayerClient;
                if (recipient == null)
                {
                    search += string.Format(" {0}", ChatArguments[i]);
                    continue;
                }

                string message = Arguments.ArgsStr.Replace(search, "").Trim(new char[] { ' ', '"' }).Replace('"', 'ˮ');
                if (message == string.Empty)
                {
                    Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Private Message Usage:  /pm playerName message");
                }
                else
                {
                    Util.say(recipient.netPlayer, string.Format("\"PM from {0}\"", Arguments.argUser.displayName.Replace('"', 'ˮ')), string.Format("\"{0}\"", message));
                    Util.say(Arguments.argUser.networkPlayer, string.Format("\"PM to {0}\"", recipient.netUser.displayName.Replace('"', 'ˮ')), string.Format("\"{0}\"", message));
                    Hashtable replies = (ChatCommand.GetCommand("r") as ReplyCommand).GetReplies();
                    if (replies.ContainsKey(recipient.netUser.displayName))
                    {
                        replies[recipient.netUser.displayName] = Arguments.argUser.displayName;
                    }
                    else
                    {
                        replies.Add(recipient.netUser.displayName, Arguments.argUser.displayName);
                    }
                }
                return;
            }
            Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, string.Format("No player found matching the name: {0}", search.Replace('"', 'ˮ')));
        }
Пример #18
0
        public void DeleteDoors(ulong UID, Fougerite.Player player)
        {
            ShareCommand command = (ShareCommand)ChatCommand.GetCommand("share");

            ((ArrayList)command.GetSharedDoors()[UID]).Remove(player.UID);
        }
Пример #19
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;
            }
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

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

            if (playerName.Equals("todos", StringComparison.OrdinalIgnoreCase))
            {
                foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players)
                {
                    Arguments.Args = new string[] { client.Name, pl.Name };
                    teleport.toplayer(ref Arguments);
                }
                pl.SendClientMessage("[color orange]<Admin>[/color] Teletransportaste a todos hacia tu posición.");
                return;
            }

            List <string> list = new List <string>();

            list.Add("TargetToHere");
            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[] { client.Name, pl.Name };
                        teleport.toplayer(ref Arguments);
                        pl.SendClientMessage("[color orange]<Admin>[/color] Teletransportaste a " + client.Name + " hacia tu posición.");
                        return;
                    }
                    list.Add(client.Name);
                }
            }
            if (list.Count > 1)
            {
                pl.SendClientMessage("[color orange]<Admin>[/color] Se encontraron " + ((list.Count - 1)).ToString() + " Jugador" + (((list.Count - 1) > 1) ? "es" : "") + ": ");
                for (int j = 1; j < list.Count; j++)
                {
                    pl.SendClientMessage(j + " - " + list[j]);
                }
                pl.SendClientMessage("0 - Cancelar");
                pl.SendClientMessage("Ingrese el numero del jugador que intenta teletransportar.");
                TeleportToCommand command = ChatCommand.GetCommand("ir") as TeleportToCommand;
                command.GetTPWaitList().Add(pl.UID, list);
            }
            else
            {
                pl.SendClientMessage("[color red]<Error>[/color]No se encontro al jugador " + playerName);
            }
        }
        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 < 2)
            {
                sender.SendClientMessage("[color red]<Sintaxis>[/color] /w <NombreJugador> <Mensaje>");
                return;
            }
            string search = ChatArguments[0];

            Fougerite.Player recipient = Fougerite.Player.FindByName(search);
            if (recipient == null)
            {
                sender.SendClientMessage($"[color red]<Error>[/color] No se encontró al usuario {search}");
                return;
            }
            if (!RustPP.Data.Globals.UserIsLogged(recipient))
            {
                sender.SendClientMessage($"[color red]<Error>[/color] {search} no esta logueado.");
                return;
            }
            List <string> wth = ChatArguments.ToList();

            wth.Remove(wth[0]);
            string message;

            try
            {
                message = string.Join(" ", wth.ToArray()).Replace(search, "").Trim(new char[] { ' ', '"' }).Replace('"', 'ˮ');
            }
            catch
            {
                sender.SendClientMessage("[color red]<Error>[/color] Algo salio mal, intentalo nuevamente más tarde");
                return;
            }
            if (message == string.Empty)
            {
                sender.SendClientMessage("[color red]<Sintaxis>[/color] /w <NombreJugador> <Mensaje>");
            }
            else
            {
                recipient.SendClientMessage($"[color #e8c92d]((MP de {sender.Name}: {message}))");
                sender.SendClientMessage($"[color #e8c92d]((MP para {recipient.Name}: {message}))");

                Hashtable replies = (ChatCommand.GetCommand("r") as ReplyCommand).GetReplies();
                if (replies.ContainsKey(recipient.Name))
                {
                    replies[recipient.Name] = sender.Name;
                }
                else
                {
                    replies.Add(recipient.Name, sender.Name);
                }
            }
        }
Пример #21
0
 public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments)
 {
     if (ChatArguments != null)
     {
         string name = "";
         for (int i = 0; i < ChatArguments.Length; i++)
         {
             name = name + ChatArguments[i] + " ";
         }
         name = name.Trim();
         if (name != null)
         {
             PlayerClient client = null;
             try
             {
                 client = EnumerableToArray.ToArray <PlayerClient>(PlayerClient.FindAllWithName(name, StringComparison.CurrentCultureIgnoreCase))[0];
             }
             catch (Exception ex)
             {
                 client = null;
                 Logger.LogException(ex);
             }
             FriendsCommand command = (FriendsCommand)ChatCommand.GetCommand("friends");
             FriendList     list    = (FriendList)command.GetFriendsLists()[Arguments.argUser.userID];
             if (list != null)
             {
                 string realName;
                 if (client == null)
                 {
                     if (!list.isFriendWith(name))
                     {
                         Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You are not friends with " + name);
                         return;
                     }
                     list.RemoveFriend(name);
                     realName = list.GetRealName(name);
                 }
                 else
                 {
                     if (!list.isFriendWith(client.userID))
                     {
                         Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You are not friends with " + name);
                         return;
                     }
                     list.RemoveFriend(client.userID);
                     realName = client.netUser.displayName;
                 }
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have removed " + realName + " from your friends list.");
                 if (list.HasFriends())
                 {
                     command.GetFriendsLists()[Arguments.argUser.userID] = list;
                 }
                 else
                 {
                     command.GetFriendsLists().Remove(Arguments.argUser.userID);
                 }
             }
             else
             {
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You currently have no friends.");
             }
         }
     }
     else
     {
         Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Friends Management Usage:  /unfriend \"playerName\"");
     }
 }
Пример #22
0
 public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments)
 {
     if (ChatArguments == null)
     {
         Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Teleport Usage:  /tphere \"playerName\"");
     }
     else
     {
         string str = "";
         for (int i = 0; i < ChatArguments.Length; i++)
         {
             str = str + ChatArguments[i] + " ";
         }
         str = str.Trim();
         if (!(str != ""))
         {
             Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Teleport Usage:  /tphere \"playerName\"");
         }
         else
         {
             if (str.ToLower() == "all")
             {
                 foreach (PlayerClient client in PlayerClient.All)
                 {
                     Arguments.Args = new string[] { client.netUser.displayName, Arguments.argUser.displayName };
                     teleport.toplayer(ref Arguments);
                 }
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have teleported all players to your location");
             }
             System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
             list.Add("TargetToHere");
             foreach (PlayerClient client2 in PlayerClient.All)
             {
                 if (client2.netUser.displayName.ToLower().Contains(str.ToLower()))
                 {
                     if (client2.netUser.displayName.ToLower() == str.ToLower())
                     {
                         Arguments.Args = new string[] { client2.netUser.displayName, Arguments.argUser.displayName };
                         teleport.toplayer(ref Arguments);
                         Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have teleported " + client2.netUser.displayName + " to your location");
                         return;
                     }
                     list.Add(client2.netUser.displayName);
                 }
             }
             if (list.Count > 1)
             {
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, ((list.Count - 1)).ToString() + " Player" + (((list.Count - 1) > 1) ? "s" : "") + " were found: ");
                 for (int j = 1; j < list.Count; j++)
                 {
                     Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, j + " - " + list[j]);
                 }
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "0 - Cancel");
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Please enter the number matching the player you were looking for.");
                 TeleportToCommand command = ChatCommand.GetCommand("tpto") as TeleportToCommand;
                 command.GetTPWaitList().Add(Arguments.argUser.userID, list);
             }
             else
             {
                 Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "No player found with the name: " + str);
             }
         }
     }
 }
Пример #23
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl         = Fougerite.Server.Cache[Arguments.argUser.userID];
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.MessageFrom(Core.Name, "Friends Management Usage:  /unfriend playerName");
                return;
            }
            FriendsCommand command     = (FriendsCommand)ChatCommand.GetCommand("friends");
            FriendList     friendsList = (FriendList)command.GetFriendsLists()[pl.UID];

            if (friendsList == null)
            {
                pl.MessageFrom(Core.Name, "You currently have no friends.");
                return;
            }
            if (friendsList.isFriendWith(playerName))
            {
                friendsList.RemoveFriend(playerName);
                pl.MessageFrom(Core.Name, "You have removed " + playerName + " from your friends list.");
                if (friendsList.HasFriends())
                {
                    command.GetFriendsLists()[pl.UID] = friendsList;
                }
                else
                {
                    command.GetFriendsLists().Remove(pl.UID);
                }
            }
            else
            {
                PList list = new PList();
                list.Add(0, "Cancel");
                foreach (KeyValuePair <ulong, string> entry in Core.userCache)
                {
                    if (friendsList.isFriendWith(entry.Key) && 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 (friendsList.isFriendWith(client.UID) && client.Name.ToUpperInvariant().Contains(playerName.ToUpperInvariant()))
                        {
                            list.Add(client.UID, client.Name);
                        }
                    }
                }
                if (list.Count == 1)
                {
                    pl.MessageFrom(Core.Name, string.Format("You are not friends with {0}.", playerName));
                    return;
                }

                pl.MessageFrom(Core.Name, string.Format("{0}  friend{1} {2}: ", ((list.Count - 1)).ToString(), (((list.Count - 1) > 1) ? "s match" : " matches"), playerName));
                for (int i = 1; i < list.Count; i++)
                {
                    pl.MessageFrom(Core.Name, string.Format("{0} - {1}", i, list.PlayerList[i].DisplayName));
                }
                pl.MessageFrom(Core.Name, "0 - Cancel");
                pl.MessageFrom(Core.Name, "Please enter the number matching the friend to remove.");
                Core.unfriendWaitList[pl.UID] = list;
            }
        }
Пример #24
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl         = Fougerite.Server.Cache[Arguments.argUser.userID];
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.MessageFrom(Core.Name, "[color red]<Sintaxis> /unfriend <NombreJugador>");
                return;
            }
            FriendsCommand command     = (FriendsCommand)ChatCommand.GetCommand("amigos");
            FriendList     friendsList = (FriendList)command.GetFriendsLists()[pl.UID];

            if (friendsList == null)
            {
                pl.MessageFrom(Core.Name, "Actualmente no tienes amigos (Pvta ke sad).");
                return;
            }
            if (friendsList.isFriendWith(playerName))
            {
                friendsList.RemoveFriend(playerName);
                pl.MessageFrom(Core.Name, "Removiste a " + playerName + " de tu lista de amigos.");
                if (friendsList.HasFriends())
                {
                    command.GetFriendsLists()[pl.UID] = friendsList;
                }
                else
                {
                    command.GetFriendsLists().Remove(pl.UID);
                }
            }
            else
            {
                PList list = new PList();
                list.Add(0, "Cancel");
                foreach (KeyValuePair <ulong, string> entry in Core.userCache)
                {
                    if (friendsList.isFriendWith(entry.Key) && 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 (friendsList.isFriendWith(client.UID) && client.Name.ToUpperInvariant().Contains(playerName.ToUpperInvariant()))
                        {
                            list.Add(client.UID, client.Name);
                        }
                    }
                }
                if (list.Count == 1)
                {
                    pl.MessageFrom(Core.Name, string.Format("No eres amigo de {0}.", playerName));
                    return;
                }

                pl.MessageFrom(Core.Name, string.Format("{0}  amigo{1} {2}: ", ((list.Count - 1)).ToString(), (((list.Count - 1) > 1) ? "s encontrados" : " encontrado"), playerName));
                for (int i = 1; i < list.Count; i++)
                {
                    pl.MessageFrom(Core.Name, string.Format("{0} - {1}", i, list.PlayerList[i].DisplayName));
                }
                pl.MessageFrom(Core.Name, "0 - Cancelar");
                pl.MessageFrom(Core.Name, "Selecciona el amigo al que quieres eliminar.");
                Core.unfriendWaitList[pl.UID] = list;
            }
        }
Пример #25
0
        public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments)
        {
            var    pl         = Fougerite.Server.Cache[Arguments.argUser.userID];
            string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' });

            if (playerName == string.Empty)
            {
                pl.MessageFrom(Core.Name, "Sharing Doors Usage:  /unshare playerName");
                return;
            }
            ShareCommand command   = (ShareCommand)ChatCommand.GetCommand("share");
            ArrayList    shareList = (ArrayList)command.GetSharedDoors()[Arguments.argUser.userID];

            if (shareList == null)
            {
                pl.MessageFrom(Core.Name, "You aren't sharing doors with anyone.");
                return;
            }
            PList list = new PList();

            list.Add(0, "Cancel");
            foreach (ulong id in shareList)
            {
                if (Core.userCache.ContainsKey(id))
                {
                    if (Core.userCache[id].Equals(playerName, StringComparison.OrdinalIgnoreCase))
                    {
                        UnshareDoors(new PList.Player(id, Core.userCache[id]), pl);
                    }
                    else if (Core.userCache[id].ToUpperInvariant().Contains(playerName.ToUpperInvariant()))
                    {
                        list.Add(id, Core.userCache[id]);
                    }
                }
                else
                {
                    Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(id.ToString());
                    if (client != null)
                    {
                        if (client.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase))
                        {
                            UnshareDoors(new PList.Player(id, client.Name), pl);
                        }
                        else if (Core.userCache[id].ToUpperInvariant().Contains(playerName.ToUpperInvariant()))
                        {
                            list.Add(id, Core.userCache[id]);
                        }
                    }
                }
            }
            if (list.Count == 1)
            {
                pl.MessageFrom(Core.Name, string.Format("You aren't sharing doors with {0}.", playerName));
                return;
            }
            pl.MessageFrom(Core.Name, string.Format("{0}  players{1} {2}: ", ((list.Count - 1)).ToString(), (((list.Count - 1) > 1) ? "s match" : " matches"), playerName));
            for (int i = 1; i < list.Count; i++)
            {
                pl.MessageFrom(Core.Name, string.Format("{0} - {1}", i, list.PlayerList[i].DisplayName));
            }
            pl.MessageFrom(Core.Name, "0 - Cancel");
            pl.MessageFrom(Core.Name, "Please enter the number matching the player you won't share doors with.");
            Core.unshareWaitList[pl.UID] = list;
        }