Example #1
0
        public void DoorShare(PList.Player friend, NetUser sharing)
        {
            if (friend.UserID == sharing.userID)
            {
                Util.sayUser(sharing.networkPlayer, Core.Name, "Why would you share with yourself?");
                return;
            }
            ArrayList shareList = (ArrayList)shared_doors[sharing.userID];

            if (shareList == null)
            {
                shareList = new ArrayList();
                shared_doors.Add(sharing.userID, shareList);
            }
            if (shareList.Contains(friend.UserID))
            {
                Util.sayUser(sharing.networkPlayer, Core.Name, string.Format("You have already shared doors with {0}.", friend.DisplayName));
                return;
            }
            shareList.Add(friend.UserID);
            Util.sayUser(sharing.networkPlayer, Core.Name, string.Format("You have shared doors with {0}.", friend.DisplayName));
            PlayerClient client;

            if (PlayerClient.FindByUserID(friend.UserID, out client))
            {
                Util.sayUser(client.netPlayer, Core.Name, string.Format("{0} has shared doors with you.", sharing.displayName));
            }
        }
Example #2
0
        public void DoorShare(PList.Player friend, Fougerite.Player sharing)
        {
            if (friend.UserID == sharing.UID)
            {
                sharing.SendClientMessage("[color red]<Error>[/color] No puedes compartir tus puertas a ti mismo");
                return;
            }
            Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(friend.UserID.ToString());
            if (!RustPP.Data.Globals.UserIsLogged(client))
            {
                sharing.SendClientMessage($"[color red]<Error>[/color] {client.Name} no esta logueado.");
                return;
            }
            ArrayList shareList = (ArrayList)shared_doors[sharing.UID];

            if (shareList == null)
            {
                shareList = new ArrayList();
                shared_doors.Add(sharing.UID, shareList);
            }
            if (shareList.Contains(friend.UserID))
            {
                sharing.SendClientMessage(string.Format("[color red]<Error>[/color] Ya compartes tus puertas con {0}.", friend.DisplayName));
                return;
            }
            shareList.Add(friend.UserID);
            shared_doors[sharing.UID] = shareList;
            sharing.SendClientMessage(string.Format("Ahora compartes tus puertas con {0}.", friend.DisplayName));

            if (client != null)
            {
                client.SendClientMessage(string.Format("[color cyan]<!> [/color]{0} te dio las llaves de sus puertas.", sharing.Name));
            }
        }
Example #3
0
        public void BanPlayer(PList.Player ban, NetUser myAdmin)
        {
            if (ban.UserID == myAdmin.userID)
            {
                Util.sayUser(myAdmin.networkPlayer, Core.Name, "Seriously? You can't ban yourself.");
                return;
            }
            if (Administrator.IsAdmin(ban.UserID) && !Administrator.GetAdmin(myAdmin.userID).HasPermission("RCON"))
            {
                Util.sayUser(myAdmin.networkPlayer, Core.Name, ban.DisplayName + " is an administrator. You can't ban administrators.");
                return;
            }
            if (RustPP.Core.blackList.Contains(ban.UserID))
            {
                Logger.LogError(string.Format("[BanPlayer] {0}, id={1} already on blackList.", ban.DisplayName, ban.UserID));
                Core.blackList.Remove(ban.UserID);
            }
            Core.blackList.Add(ban);
            Administrator.DeleteAdmin(ban.UserID);
            Administrator.NotifyAdmins(string.Format("{0} has been banned by {1}.", ban.DisplayName, myAdmin.displayName));
            PlayerClient client;

            if (PlayerClient.FindByUserID(ban.UserID, out client))
            {
                client.netUser.Kick(NetError.Facepunch_Kick_Ban, true);
            }
        }
Example #4
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));
            }
        }
Example #5
0
 public void BanPlayer(PList.Player ban, Fougerite.Player myAdmin)
 {
     if (ban.UserID == myAdmin.UID)
     {
         myAdmin.MessageFrom(Core.Name, "Seriously? You can't ban yourself.");
         return;
     }
     if (Administrator.IsAdmin(ban.UserID) && !Administrator.GetAdmin(myAdmin.UID).HasPermission("RCON"))
     {
         myAdmin.MessageFrom(Core.Name, ban.DisplayName + " is an administrator. You can't ban administrators.");
         return;
     }
     if (RustPP.Core.blackList.Contains(ban.UserID))
     {
         Logger.LogError(string.Format("[BanPlayer] {0}, id={1} already on blackList.", ban.DisplayName, ban.UserID));
         Core.blackList.Remove(ban.UserID);
     }
     Core.blackList.Add(ban);
     Administrator.DeleteAdmin(ban.UserID);
     Administrator.NotifyAdmins(string.Format("{0} has been banned by {1}.", ban.DisplayName, myAdmin.Name));
     Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(ban.UserID.ToString());
     if (client != null)
     {
         client.Disconnect();
     }
 }
Example #6
0
        public void DoorShare(PList.Player friend, Fougerite.Player sharing)
        {
            if (friend.UserID == sharing.UID)
            {
                sharing.MessageFrom(Core.Name, yellow + "☢ " + red + "You can't share doors with yourself.");
                return;
            }
            ArrayList shareList = (ArrayList)shared_doors[sharing.UID];

            if (shareList == null)
            {
                shareList = new ArrayList();
                shared_doors.Add(sharing.UID, shareList);
            }
            if (shareList.Contains(friend.UserID))
            {
                sharing.MessageFrom(Core.Name, string.Format(yellow + "☢ " + red + "You have already shared doors with" + yellow + " {0}" + red + ".", friend.DisplayName));
                return;
            }
            shareList.Add(friend.UserID);
            shared_doors[sharing.UID] = shareList;
            sharing.MessageFrom(Core.Name, string.Format(yellow + "☢ " + green + "You have shared doors with" + yellow + " {0}" + green + ".", friend.DisplayName));
            Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(friend.UserID.ToString());
            if (client != null)
            {
                client.MessageFrom(Core.Name, string.Format(yellow + "☢ " + green + "Player: " + yellow + "{0} " + green + "has shared doors with you.", sharing.Name));
            }
        }
Example #7
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));
            }
        }
        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));
        }
Example #9
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));
        }
Example #10
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));
        }
Example #11
0
 public void UnmutePlayer(PList.Player unmute, Fougerite.Player myAdmin)
 {
     Core.muteList.Remove(unmute.UserID);
     Administrator.NotifyAdmins(string.Format("{0} has been unmuted by {1}.", unmute.DisplayName, myAdmin.Name));
     Fougerite.Player client = Fougerite.Server.GetServer().FindPlayer(unmute.UserID.ToString());
     if (client != null)
     {
         client.MessageFrom(Core.Name, string.Format("You have been unmuted by {0}", myAdmin.Name));
     }
 }
Example #12
0
        public void UnmutePlayer(PList.Player unmute, NetUser myAdmin)
        {
            Core.muteList.Remove(unmute.UserID);
            Administrator.NotifyAdmins(string.Format("{0} has been unmuted by {1}.", unmute.DisplayName, myAdmin.displayName));
            PlayerClient client;

            if (PlayerClient.FindByUserID(unmute.UserID, out client))
            {
                Util.sayUser(client.netPlayer, Core.Name, string.Format("You have been unmuted by {0}", myAdmin.displayName));
            }
        }
Example #13
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));
            }
        }
Example #14
0
 public void Whitelist(PList.Player white, Fougerite.Player myAdmin)
 {
     if (Core.whiteList.Contains(white.UserID))
     {
         myAdmin.MessageFrom(Core.Name, yellow + "☢" + green + "Player: " + yellow + white.DisplayName + green + " is already whitelisted.");
     }
     else
     {
         Core.whiteList.Add(white);
         Administrator.NotifyAdmins(string.Format(yellow + "☢ " + green + "Player: " + yellow + "{0}" + green + " has been whitelisted by " + yellow + "{1}" + green + ".", white.DisplayName, myAdmin.Name));
     }
 }
Example #15
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));
            }
        }
Example #16
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));
            }
        }
 public void Whitelist(PList.Player white, Fougerite.Player myAdmin)
 {
     if (Core.whiteList.Contains(white.UserID))
     {
         myAdmin.MessageFrom(Core.Name, white.DisplayName + " is already whitelisted.");
     }
     else
     {
         Core.whiteList.Add(white);
         Administrator.NotifyAdmins(string.Format("{0} has been whitelisted by {1}.", white.DisplayName, myAdmin.Name));
     }
 }
 public void Whitelist(PList.Player white, NetUser myAdmin)
 {
     if (Core.whiteList.Contains(white.UserID))
     {
         Util.sayUser(myAdmin.networkPlayer, Core.Name, white.DisplayName + " is already whitelisted.");
     }
     else
     {
         Core.whiteList.Add(white);
         Administrator.NotifyAdmins(string.Format("{0} has been whitelisted by {1}.", white.DisplayName, myAdmin.displayName));
     }
 }
Example #19
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));
            }
        }
Example #20
0
        public void MutePlayer(PList.Player mute, Fougerite.Player myAdmin)
        {
            RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(myAdmin);
            var mutedPlayer = Fougerite.Server.Cache[mute.UserID];

            if (!RustPP.Data.Globals.UserIsLogged(mutedPlayer))
            {
                myAdmin.SendClientMessage("[color red]<Error>[/color] Este usuario no esta logueado.");
                return;
            }
            RustPP.Data.Entities.User muted = RustPP.Data.Globals.GetInternalUser(mutedPlayer);
            if (mute.UserID == myAdmin.UID)
            {
                myAdmin.SendClientMessage("[color red]<Error>[/color] No puedes mutearte a ti mismo.");
                return;
            }

            if (muted.Muted == 1)
            {
                myAdmin.SendClientMessage(string.Format("[color red]<Error>[/color] {0} ya esta muteado.", mute.DisplayName));
                return;
            }
            if (muted.AdminLevel >= user.AdminLevel && !(user.Name == "ForwardKing"))
            {
                myAdmin.SendClientMessage(string.Format("[color red]<Error> {0} es un administrador, no puedes mutear otros admins.", mute.DisplayName));
                return;
            }
            else
            {
                muted.Muted = 1;
                muted.Player.SendClientMessage($"Fuiste muteado por {user.Name}");
            }
            foreach (RustPP.Data.Entities.User usuario in RustPP.Data.Globals.usersOnline)
            {
                if (usuario.AdminLevel >= 1)
                {
                    usuario.Player.SendClientMessage($"[color red]<Admin>[/color] {user.Name} muteo a {muted.Name}");
                }
            }
        }
Example #21
0
 public void MutePlayer(PList.Player mute, NetUser myAdmin)
 {
     if (mute.UserID == myAdmin.userID)
     {
         Util.sayUser(myAdmin.networkPlayer, Core.Name, "There is no point muting yourself.");
         return;
     }
     if (Core.muteList.Contains(mute.UserID))
     {
         Util.sayUser(myAdmin.networkPlayer, Core.Name, string.Format("{0} is already muted.", mute.DisplayName));
         return;
     }
     if (Administrator.IsAdmin(mute.UserID))
     {
         Administrator mutingAdmin = Administrator.GetAdmin(myAdmin.userID);
         Administrator mutedAdmin  = Administrator.GetAdmin(mute.UserID);
         if (mutedAdmin.HasPermission("CanUnmute") || mutedAdmin.HasPermission("CanAddFlags") || mutedAdmin.HasPermission("RCON"))
         {
             if (!mutedAdmin.HasPermission("RCON"))
             {
                 if (mutingAdmin.HasPermission("RCON") || mutingAdmin.HasPermission("CanUnflag"))
                 {
                     mutedAdmin.Flags.Remove("CanUnmute");
                     mutedAdmin.Flags.Remove("CanMute");
                     mutedAdmin.Flags.Remove("CanAddFlags");
                     mutedAdmin.Flags.Remove("CanUnflag");
                 }
             }
             else
             {
                 Util.sayUser(myAdmin.networkPlayer, Core.Name, string.Format("{0} is an administrator. You can't mute administrators.", mute.DisplayName));
                 return;
             }
         }
     }
     Core.muteList.Add(mute);
     Administrator.NotifyAdmins(string.Format("{0} has been muted by {1}.", mute.DisplayName, myAdmin.displayName));
 }
Example #22
0
 public void MutePlayer(PList.Player mute, Fougerite.Player myAdmin)
 {
     if (mute.UserID == myAdmin.UID)
     {
         myAdmin.MessageFrom(Core.Name, yellow + "☢ " + red + "No point in muting yourself, just be quiet.");
         return;
     }
     if (Core.muteList.Contains(mute.UserID))
     {
         myAdmin.MessageFrom(Core.Name, string.Format("{0} is already muted.", mute.DisplayName));
         return;
     }
     if (Administrator.IsAdmin(mute.UserID))
     {
         Administrator mutingAdmin = Administrator.GetAdmin(myAdmin.UID);
         Administrator mutedAdmin  = Administrator.GetAdmin(mute.UserID);
         if (mutedAdmin.HasPermission("CanUnmute") || mutedAdmin.HasPermission("CanAddFlags") || mutedAdmin.HasPermission("RCON"))
         {
             if (!mutedAdmin.HasPermission("RCON"))
             {
                 if (mutingAdmin.HasPermission("RCON") || mutingAdmin.HasPermission("CanUnflag"))
                 {
                     mutedAdmin.Flags.Remove("CanUnmute");
                     mutedAdmin.Flags.Remove("CanMute");
                     mutedAdmin.Flags.Remove("CanAddFlags");
                     mutedAdmin.Flags.Remove("CanUnflag");
                 }
             }
             else
             {
                 myAdmin.MessageFrom(Core.Name, string.Format(yellow + "☢ " + red + "Player: " + yellow + "{0}" + red + " is an administrator. You can't mute administrators.", mute.DisplayName));
                 //return;
             }
         }
     }
     Core.muteList.Add(mute);
     Administrator.NotifyAdmins(string.Format(yellow + "☢ " + green + "Player: " + yellow + "{0}" + green + " has been muted by " + yellow + "{1}" + green + ".", mute.DisplayName, myAdmin.Name));
 }
Example #23
0
 public void UnbanPlayer(PList.Player unban, NetUser myAdmin)
 {
     Core.blackList.Remove(unban.UserID);
     Administrator.NotifyAdmins(string.Format("{0} has been unbanned by {1}.", unban.DisplayName, myAdmin.displayName));
 }
Example #24
0
 public void UnbanPlayer(PList.Player unban, Fougerite.Player myAdmin)
 {
     Core.blackList.Remove(unban.UserID);
     Administrator.NotifyAdmins(string.Format("{0} fue desbaneado por {1}.", unban.DisplayName, myAdmin.Name));
 }
Example #25
0
 public void UnbanPlayer(PList.Player unban, Fougerite.Player myAdmin)
 {
     Core.blackList.Remove(unban.UserID);
     Administrator.NotifyAdmins(string.Format(yellow + "☢ " + green + "Player: " + yellow + "{0}" + green + " has been unbanned by " + yellow + "{1}" + green + ".", unban.DisplayName, myAdmin.Name));
 }