1. I am kinda confused on how I am getting this issue because I am not passing the IPlayer class into the serializer. Any help would be appreciated

    Code:
    09:59 [Error] Failed to call hook 'cmdBan' on plugin 'BanManager v1.0.0' (JsonSerializationException: Self referencing loop detected for property 'gameObject' with type 'UnityEngine.GameObject'. Path 'player.Object.skeletonProperties.boneReference'.)
    09:59 [Stacktrace]   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonProperty property, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <filename unknown>:0
      at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContainerContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonProperty property, Newtonsoft.Json.Serialization.JsonContract& memberContract, System.Object& memberValue) [0x00000] in <filename unknown>:0
      at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00000] in <filename unknown>:0 
     
  2. Maybe post the code lines of your saving method?
     
  3. The BanEntry
    Code:
            public class BanRecord
            {
                /// <summary>
                /// SteamID of the Player
                /// </summary>
                public string SteamId;            /// <summary>
                /// PlayerName of the Player
                /// </summary>
                public string PlayerName;            /// <summary>
                /// IP Address of the Player
                /// </summary>
                public string Address;            /// <summary>
                /// The Reason for the Ban
                /// </summary>
                public string BanReason;            /// <summary>
                /// The Server of the Ban
                /// </summary>
                public string BanServer = GetLibrary<Covalence>().Server.Address + ":" + GetLibrary<Covalence>().Server.Port.ToString();            /// <summary>
                /// Banned By User
                /// </summary>
                public string BannedBy;            /// <summary>
                /// Length of Ban
                /// </summary>
                public int BanLength = 0;            /// <summary>
                /// Ban Type
                /// </summary>
                public string BanType = "Empty";            /// <summary>
                /// Time Record was recorded
                /// </summary>
                public long TimeStamp = GetTimestamp();            public BanRecord(IPlayer player, string By, string Reason, int Time)
                {
                    SteamId = player.Id;
                    PlayerName = player.Name;
                    try
                    {
                        Address = player.Address;
                    }
                    catch { }
                    BanReason = Reason;
                    BannedBy = By;
                    BanLength = Time;
                }            public BanRecord(string ID, string Name, string Address, string By, string Reason, int Time)
                {
                    SteamId = ID;
                    PlayerName = Name;
                    this.Address = Address;
                    BannedBy = By;
                    BanReason = Reason;
                    BanLength = Time;
                }            public BanRecord()
                {
                }            internal IPlayer GetIPlayerFromBan()
                {
                    return Interface.Oxide.GetLibrary<Covalence>().Players.FindPlayer(SteamId);
                }            internal string[] GetValueCSV()
                {
                    return new string[] { SteamId, PlayerName, Address, BanReason, BanServer, BannedBy, BanLength.ToString(), FromEpoch(TimeStamp).ToShortDateString() };
                }
    
    Then the Ban Entry is passed to our database manager
    Code:
    private bool InsertItem(BanRecord record)
            {
                if (lib == null)
                {
                    LogError("Library is not loaded");
                    return false;
                }
                return (bool)eInsertItem.Invoke(lib, new object[] { JsonConvert.SerializeObject(record, Formatting.Indented, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }) });
            }
    Which is then received by this method
    Code:
    [LibraryFunction("UpdateItem")]
            public bool UpdateItem(string Item)
            {
                DateTime start = DateTime.Now;
                BanRecord record = JsonConvert.DeserializeObject<BanRecord>(Item);
                MySqlCommand command = Connection.CreateCommand();
                command.CommandText = $"UPDATE UserBans SET SteamId=\"{record.SteamId}\", PlayerName=\"{record.PlayerName}\", Address=\"{record.Address}\", BanReason=\"{record.BanReason}\", BanServer=\"{record.BanServer}\", BannedBy=\"{record.BannedBy}\", BanLength=\"{record.BanLength}\", TimeStamp=\"{record.TimeStamp}\" WHERE SteamId=\"{record.SteamId}\"";
                if (Connection.State == System.Data.ConnectionState.Closed)
                    Connection.Open();            if (command.ExecuteNonQuery() > -1)
                {
                    if (Connection.State == System.Data.ConnectionState.Open)
                        Connection.Close();
                    if (Logger != null)
                        Logger.Invoke(new LogEvent($"Database Function (Update) Took {(DateTime.Now - start).TotalMilliseconds}ms", "Extension->DatabaseManager", LogType.Info));
                    return true;
                }
                else
                {
                    if (Connection.State == System.Data.ConnectionState.Open)
                        Connection.Close();
                    if (Logger != null)
                        Logger.Invoke(new LogEvent($"Database Function (Update) Took {(DateTime.Now - start).TotalMilliseconds}ms", "Extension->DatabaseManager", LogType.Info));
                    return false;
                }
            }
    Unless I am mistaken in thinking methods don't get passed through json. there should be no IPlayer class being passed into the anything during the ban process.