Rust:IO Friends List API

A simple API designed to interact with RustIOs friend list

Total Downloads: 3,849 - First Release: Apr 1, 2016 - Last Update: May 9, 2016

5/5, 6 likes
  1. Just a question. I had originaly left offline players out as bigger servers would have issues with many players sharing similar names, This happened on my own server, a friend has the name hunter126 (not exact), and a person had logged on that had the hunter in thier name.
    So I want to know if you want to have offline check by default or would prefer it to be a setting, I am happy to make SteamID online offline as it will never conflict (well full steam ids wont).
     
  2. Otherwise, add a configuration option to let the server choice :)

    Code:
            private static List<BasePlayer> FindPlayers(string NameOrID)
            {
                var players = new List<BasePlayer>();
                foreach (var activePlayer in BasePlayer.activePlayerList)
                {
                    if (activePlayer.UserIDString.Equals(NameOrID)) players.Add(activePlayer);
                    else if (activePlayer.displayName.Contains(NameOrID, CompareOptions.OrdinalIgnoreCase)) players.Add(activePlayer);
                }
                foreach (var sleepingPlayer in BasePlayer.sleepingPlayerList)
                {
                    if (sleepingPlayer.UserIDString.Equals(NameOrID)) players.Add(sleepingPlayer);
                    else if (OfflineNameSearch && sleepingPlayer.displayName.Contains(NameOrID, CompareOptions.OrdinalIgnoreCase)) players.Add(sleepingPlayer);
                }
                return players;
            }
     
  3. I have already worked on adding it as a config, have been testing it, the only thing I need to work on now is adjusting the chat.
    Code:
    if ((isSteamID == false) && (NamesIncludeSleepers == false)) return players;
     
  4. Alphawar updated Rust:IO Friends List API with a new update entry:

    1.2.2

     
  5. Sugestion :

    - Move "isSteamID = IsDigitsOnly()" directly in FindNameOrID.
    - Add a "/friend checkplayer player1 player2" for admins ( for checking when a player cries because he can not "/sethome " or /remove" ).

    => Move the isSteamID check in FindNameOrID makes adding the command "checkplayer" easier. ( personally :p )

    ( I do not understand why you check if steamid, "Equals(NameOrID)" no risk )

    Plugin joint is not tested.

    => add "/friend checkplayer player1 player2" for admins
    => changing the order (id/name) in FindPlayers
     

    Attached Files:

    Last edited by a moderator: Apr 19, 2016
  6. I did that to allow the config setting to work.
    Code:
                if ((isSteamID == false) && (NamesIncludeSleepers == false)) return players;
                foreach (var sleepingPlayer in BasePlayer.sleepingPlayerList)
                {
                    if (sleepingPlayer.UserIDString.Equals(NameOrID)) players.Add(sleepingPlayer);
                    else if (sleepingPlayer.displayName.Contains(NameOrID, CompareOptions.OrdinalIgnoreCase)) players.Add(sleepingPlayer);
                }
                return players;
    I did not have time to clean the code, I took what you did, altered it to my liking and added it in.
    This mod was only basic as I was only using it for personal use but decided to make it available to others so they could also go to a full RustIO system rather than RustIO and FriendAPI.

    For adding other features people only need to request it and I will look at adding it in, expect delays though as I am in New Zealand so im asleep when most are awake. (unless I post an update at like 1 in the morning).
     
  7. My idea request still remains. DoorShare between friends. Would be awesome :)
     
  8. Alphawar updated Rust:IO Friends List API with a new update entry:

    1.3.1

     
  9. /friend add name

    I use that and it said my friend does not exist?
     
  10. What is this name of your friend that you are adding?
    Please type exactly what it is you have typed.
    And has he been on that server before?
     
  11. DELETED
     
  12. Did you fix the issue?
     
  13. PLS add the command - /friend accept !!! Because i can add all players on the server in friends and i can see all players on the map! Map plugin is - LustyMap ! Pls add! Thank you :)
    [DOUBLEPOST=1462370124][/DOUBLEPOST]This team will confirm that other player want you in friend list
    [DOUBLEPOST=1462370208][/DOUBLEPOST][DOUBLEPOST=1462370124][/DOUBLEPOST]This team will confirm that other player want you in friend list[/QUOTE]

    This command will confirm that other player want you in friend list

    Sorry for my English
     
  14. This mod does not affect the other persons friend list, when you add a player as a friend it will only allow them to view you.
    Please confirm the following:
    Are you using FriendAPI and RustIO?: If so please look at only using RustIO.
    If you are admin have you checked to see if admin mod is enabled?: If so disable it as admin mode displays all player.
    /map admin off
    /map rustiofriends true
    /map friendsapifriends false

    I do not know if this will fix your issue, If you do this and it still shows all players you can use the /friend check (name), this will tell you if and the other person are friends. after all of this if you are still seeing everyone even when they havent added you then please check with Lustymap incase you have something incorrectly set up.
     
  15. I am confused with this plugin versus friendsapi. they both use the /friends command
    Mainly because I do use rustio and homes,doorshare,homes etc.
     
  16. Friends API is its own standalone friend mod, it has its own storage system that stores players and there friends.
    RustIO is commonly installed with many servers that run Oxide and it also has its own friends list that is stored on the server.

    A few months back the FriendsAPI mod and the Friendly Fire mod for FriendAPI went from LUA to C#, This means I could no longer suppot friendly fire for FriendAPI and RustIO, this lead to issues for example if I used FriendAPI but used RustIO clan then friendly Fire would not automaticly cancel damage to Clans as RustIO is separate from FriendAPI.

    So I started modifying mods such as the older version of m-Teleportation (no longer availalbe) to use RustIO, but then players could only add friends using a clan as RustIO does not have any chat command, this meants players have to go to www.playrust.io and use the live map to control friends.

    I did not like this, so after I modified all my FriendAPI mods to use RustIO instead I then created a mod that allowed players to control there RustIO friends list in game instead of though the web.

    IF you would like to test this open a webpage and browse to the live map of your server, when you are logged in as your steam account (make sure admin mode is off) you will then be able to see your friends, but in game you can not change them or check. So this mod adds that function.

    So this mod is specificly designed to servers who want to go 100% RustIO and not have FriendAPI, This is good as most mods are now supporting RustIO.
     
  17. Alphawar updated Rust:IO Friends List API with a new update entry:

    1.4.0

     
  18. Code:
    [Oxide] 16:13 [Info] [RustIOFriendListAPI] Character Detected Returning false
    [Oxide] 16:13 [Info] [RustIOFriendListAPI] Skipping sleepers(Add Debug message)
    [Oxide] 16:13 [Info] [RustIOFriendListAPI] Character Detected Returning false
    [Oxide] 16:13 [Info] [RustIOFriendListAPI] Skipping sleepers(Add Debug message)
     
  19. Hi there. Can you please provide more detail like:
    • Is it causing errors?
    • are you just wanting to know what those codes are????
     
  20. My mistake.. It's only info message. :) sorry.
    But why skipping sleepers?