1. Hello @Wulf! Why with latest update hook broken? OnPlayerDisconnected returning null!
     
  2. Wulf

    Wulf Community Admin

    How is it returning null? I can't really tell you what is wrong without details of what you are doing.
     
  3. For example:

    void OnPlayerDisconnected(PlayerIdentity player)
    {
    Debug.Log(player.Name)
    }

    Later it was returning PlayerIdentity, now - null.so the code in body not working and creating errors.
     
  4. Wulf

    Wulf Community Admin

    I have plugins using that just fine. Can you provide a full example of your plugin?
     
  5. Code:
    [HookMethod("OnPlayerDisconnected")]
    void OnPlayerDisconnected(PlayerIdentity player)
    {
    if (player.IsAdmin)
    {
    ulong playerID = player.SteamId.m_SteamID;
    if (!adminToggle.ContainsKey(playerID)) return;
    adminToggle[playerID] = false;
    return;
    }
    }
    Before update everything was working. Right now player returns Null.
     
  6. Wulf

    Wulf Community Admin

    Try with the upcoming snapshot.

    Also, you don't need [HookMethod("OnPlayerDisconnected")] and you can get the Steam ID with player.SteamId, you don't need m_SteamID.
     
  7. Hi, same problems

    void OnPlayerDisconnected(PlayerIdentity player)
    {
    Interface.Oxide.LogDebug(player.Name);
    }
    Code:
    10:12 PM [Debug] at Oxide.Plugins.Tested.OnPlayerDisconnected (.PlayerIdentity player) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Tested.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
     
  8. I'm using extension and without hook everything doesn't works.
     
  9. Wulf

    Wulf Community Admin

    What are you doing that needs to be in extension format? Plugins should be able to handle pretty much anything you need generally.
    [DOUBLEPOST=1450160267][/DOUBLEPOST]
    As I mentioned previously, try again with the latest Oxide snapshot, build 2.0.1639 or higher.
     
  10. I'm using extension to make my plugins private. :p
     
  11. Wulf

    Wulf Community Admin

    Plugins can be private too, just don't publish them. You're losing some useful development features such as hotloading by doing it as an extension vs. just a plugin. Is there something specific you actually need that can't be done via a plugin?
     
  12. It's my choose how to do this... :)
     
  13. Wulf

    Wulf Community Admin

    Okay, just saying you're just making things more complicated for yourself. ;)
     
  14. Just tell @dcode to make his RusIO like a plugin....

    Maybe better to fix some problems with hook? :)
     
  15. Wulf

    Wulf Community Admin

    There's a difference between his and what you've shown me so far... What his extension does is not possible via plugins, as Oxide doesn't provide a built-in web server nor does it provide web sockets. Does your extension use either of those?

    As I said previously as well, the hook should be fixed in the upcoming snapshot.
     
  16. Okay, will try. Thanks.
     
  17. Nothing changed

    Code:
      void OnPlayerDisconnected(PlayerIdentity identity, uLink.NetworkPlayer player)
            {
                Interface.Oxide.LogDebug(identity.SteamId.ToString());
            }
    [DOUBLEPOST=1450173197][/DOUBLEPOST]
    Code:
    void OnPlayerDisconnected(PlayerIdentity identity, uLink.NetworkPlayer player)
            {
                if (identity != null)
                    Debug.Log("Work!");
            }
    [DOUBLEPOST=1450191708,1450172948][/DOUBLEPOST]Ohh... same problem with OnPlayerRespawn hook
     

    Attached Files:

  18. Tried again and nothing...
     
  19. Wulf

    Wulf Community Admin

    I can't reproduce it. With my tests the identity is working 100%. All I can suggest is making sure you are using Oxide 2.0.1637+ and to do some null checks. We don't provide the identity, we just pass it along.
    Code:
    void OnPlayerConnected(PlayerIdentity identity) => Puts(identity.Name + " " + identity.SteamId);
    void OnPlayerDisconnected(PlayerIdentity identity) => Puts(identity.Name + " " + identity.SteamId);
    b409df742dd0fb8cbd06621a57fa9246.png
     
  20. I don't know...
    Code:
    void OnPlayerDisconnected(PlayerIdentity identity) => Puts(identity.Name + " " + identity.SteamId);
    [DOUBLEPOST=1450240855][/DOUBLEPOST]
    Code:
     void OnPlayerDisconnected(PlayerIdentity identity, uLink.NetworkPlayer player)
            {
                PlayerIdentity testPlayer = GameManager.GetPlayerEntity(player).GetComponent<PlayerIdentity>();
                if (testPlayer != null)
                    Debug.Log(testPlayer.Name + " " + testPlayer.SteamId);
                else
                    Debug.Log("uLink Player: " + player.ToString());        }
     

    Attached Files: