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. I know it works for m-Teleportation as I am running a modified version of that and it works fine with sethome. entity owner I will have to look later as I currently have a few things going on.
     
  2. New version does not work:
    (13:58:44) | [Oxide] 13:58 [Error] RustIOFriendListAPI plugin failed to compile!

    (13:58:44) | [Oxide] 13:58 [Error] RustIOFriendListAPI.cs(211,24): error CS0117: `string' does not contain a definition for `IsNullOrWhiteSpace'
     
  3. Hey @Wulf , Would you know why this doesnt work? I saw this needs most recent dotnet, but the other version "IsNullOrEmpty" also doesnt work?.
    Any recomendations?
     
  4. Wulf

    Wulf Community Admin

    That means it isn't available in the method you are using it, or not available at all with the current Mono version. Not all .NET features are available in Mono yet.
     
  5. hmm odd, if I was using Visual studio and had set the reference as per that other forum page should this not highlight that as a missing thing?
     
  6. Wulf

    Wulf Community Admin

    No, Visual Studio relies on .NET generally, not Mono.
     
  7. well that would explain it, so in that case would the best way of checking just to do "string.length || string="null" "
     
  8. Code:
    if (string.IsNullOrEmpty(stringname)){}
    would work, I use it regularly
     
  9. odd, cause im sure it was working for me before, but lastnight I tested my mod as it rejected it.
    Ill try tonight after reboot and redo updates.
     
  10. Not work. Plugin error failed to complite((
     
  11. Please provide full error.
    But in saying that I think its probably the above one, but still please paste whole error
    [DOUBLEPOST=1459985235][/DOUBLEPOST]
    @k1lly0u or @Wulf : As I am at work I can not make any fixes, are you able to change the "IsNullOrWhiteSpace" in the mod to "IsNullOrEmpty" and test it, there are only a few areas that its called and if you have something like notepad++ you can do a search and replace.

    Thanks K1ll/wulf in advance if either can help check this.
     
  12. (02:51:45) | [Oxide] 02:51 [Info] RustIOFriendListAPI was compiled successfully in 1578ms

    (02:51:45) | [Oxide] 02:51 [Info] Loaded plugin RustIO: Friends List v1.1.0 by Alphawar

    Looks likes its working ;)
    thanks!
     

    Attached Files:

  13. Cool
    I will make that alteration tonight, along with anything else I need to edit.
     
  14. Alphawar updated Rust:IO Friends List API with a new update entry:

    1.1.1

     
  15. How do you make it work with m-Teleportation?
     
  16. Wulf

    Wulf Community Admin

    That plugin would have to be updated to use it.
     
  17. if you have the ability you can alter the mod, I have a few functions in my mod for compatibility such as m-teleportation.
    If you want instructions Please check the FAQ page.
     
  18. Does not work when player is offline and displays a console error:
    Code:
    20:10 [Error] Failed to call hook 'friendFunction' on plugin 'RustIOFriendListAPI v1.1.1' (NullReferenceException: Object reference not set to an instance of an object)
    20:10 [Debug]   at Oxide.Plugins.RustIOFriendListAPI.friendFunction (.BasePlayer player, System.String cmd, System.String[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.RustIOFriendListAPI.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 
     
  19. Thanks for reporting the error.
    I will work on implimenting the debug function to this mod
    When I give an update that included the debug mode I will then get you to do the following.
    • Send me the information from testing with debug info included.
    • Include the chat command used that resulted in the NRE.
    • type oxide.show user (player name) and send result.
    I should have this up in the next hour, as I am currently doing some other work.
    Again thanks for the report.
    [DOUBLEPOST=1460946041,1460934945][/DOUBLEPOST]@Loup-des-Neiges.
    I have added a few debug messages, they put to console but can put some to chat as well, to use it just type one of the following:
    /friend debug
    0 = Disables debug mode
    1 = Shows only core locations such as when a function is being called. (only in console)
    2 = Shows above and a few extra points in the mod for better accuracy of error location. (only in console)
    3 = Shows above, any rank 1 messages are sent to chat and values of items being used. (Rank 2/3 messages in console)

    If this version works for debug let me know, I think I already know the error. looking at the getFullName function it only checks active players so when a player is offline it doesnt search for that player. This means when a player isnt found a null is returned, I currently dont check if it is a null as I didnt know it did that, so most likely that is causeing the NRE, But I want to check if that is the case before fixing.

    So let me know the infomation as requersted and I will then upload a patch to fix and include debug features.
    Thanks
     

    Attached Files:

  20. Code:
    (14:03:21) | [Oxide] 14:03 [Info] [RustIO: Friends List] RustIOFriendListAPI: friendFuntion being called.
    (14:03:21) | [Oxide] 14:03 [Info] [RustIO: Friends List] RustIOFriendListAPI: Checking request (+/-/?).
    (14:03:21) | [Oxide] 14:03 [Info] [RustIO: Friends List] RustIOFriendListAPI: getFullName is being called
    (14:03:21) | [Oxide] 14:03 [Error] Failed to call hook 'friendFunction' on plugin 'RustIOFriendListAPI v1.1.1' (NullReferenceException: Object reference not set to an instance of an object)
    ( /friend ? jerk ) offline player

    Unofficial fix :

    - Add error if FriendsNameID is null
    - Add support for multiplayerfounds
    - Add foreach for sleepingPlayerList
    [DOUBLEPOST=1460997053,1460981058][/DOUBLEPOST]Unofficial fix 2 :

    - Fix small NRE
    - Players can /friend [add/remove/check] "Name/SteamID"
    - Added display name in the messages. ( reset lang file )
    - Add config for messages color
     

    Attached Files:

    Last edited by a moderator: Apr 18, 2016