1. The record is not deleted, nothing has changed in the code.
    Problem with call OnPlayerDisconnected
    Code:
            void OnPlayerDisconnected(BasePlayer player)
            {
            Sql.Insert(Core.Database.Sql.Builder.Append("DELETE FROM stats_player_online WHERE id = @0", player.UserIDString), _mySqlConnection);
            }
    Also a problem with OnPlayerInit()
    Code:
           void OnPlayerInit(BasePlayer player)
            {
                string normalName = player.displayName;
                int ping = Network.Net.sv.GetAveragePing(player.net.connection);
                Sql.Insert(Core.Database.Sql.Builder.Append(
        "INSERT IGNORE INTO stats_player_online (id, name, ip, ping, time) VALUES (@0, @1, @2, @3, @4) ON DUPLICATE KEY UPDATE name = @1, ip = @2, ping = @3",
        player.userID, normalName, player.net.connection.ipaddress, ping, ConvertToUnixTime(DateTime.Now)), _mySqlConnection);            if (loginTime.ContainsKey(player))
                    OnPlayerDisconnected(player);            loginTime.Add(player, (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds);
            }
    I to work through CanClientLogin(), which is very inconvenient

    The question is why something is constantly changing ?????!
     
    Last edited by a moderator: Oct 2, 2017
  2. Which Oxide version are you on?
     
  3. Those hooks works fine, so problem is in your code.
     
  4. Wulf

    Wulf Community Admin

    It sounds like you're on build 3505 which was promptly replaced with 3508 and higher builds where the issue was resolved.
     
  5. alternatively you could try:
    void OnUserDisconnected(IPlayer player)
    void OnUserConnected(IPlayer player)


    They are not documented on Oxide API for Rust, but seem to be working in a plugin I am developing.

    I convert the IPlayer to baseplayer with:
    BasePlayer Bplayer = player.Object as BasePlayer;

    I do wish there was a decomposition document that showed what each of these objects contained. The lack of documentation leads to a lot of hunting for the right object and/or function to do a task.
     
  6. Wulf

    Wulf Community Admin

    Those are part of the Covalence API which is not documented yet. The issue in this thread was already fixed and involved the game-specific hook, which incidentally also is used to trigger the hook you mentioned.