20:51 [Error] Failed to call hook 'GetPlayTime' on plugin 'PlaytimeTracker v0.2.1' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.PlaytimeTracker.GetPlayTime (System.String id) [0x00000] in <6f21e0765f2242609d6392ccf7d079a3>:0
at Oxide.Plugins.PlaytimeTracker.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00309] in <6f21e0765f2242609d6392ccf7d079a3>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <0fbce81d88d64454b3e7abb24df7026b>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <0fbce81d88d64454b3e7abb24df7026b>:0
20:51 [Error] Failed to call hook 'GetPlayTime' on plugin 'PlaytimeTracker v0.2.1' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.PlaytimeTracker.GetPlayTime (System.String id) [0x00000] in <6f21e0765f2242609d6392ccf7d079a3>:0
at Oxide.Plugins.PlaytimeTracker.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00309] in <6f21e0765f2242609d6392ccf7d079a3>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <0fbce81d88d64454b3e7abb24df7026b>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <0fbce81d88d64454b3e7abb24df7026b>:0
Merged postplugin using GetPlaytime: ServerRewards:
if (configData.UIOptions.ShowPlaytime)
{
object time = Interface.CallHook("GetPlayTime", player.UserIDString);
if (time is double)
{
string playTime = FormatTime((double)time);
if (!string.IsNullOrEmpty(playTime))
message = $"{color1}{msg("storePlaytime", player.UserIDString)}: {playTime}</color> {color2}||</color> " + message;
}
}
and PlayerRanks:
public void UpdateOfflinePlayer(ulong userID)
{
var path = data.PlayerRankData[userID];
bool gotClan = (Clans?.CallHook("GetClanOf", userID) != null);
var time = PlaytimeTracker?.Call("GetPlayTime", userID.ToString());
path["Status"] = "offline";
path["Economics"] = Economics ? Economics?.Call("Balance", userID) : path["Economics"];
path["ServerRewards"] = ServerRewards ? ServerRewards?.Call("CheckPoints", userID) : path["ServerRewards"];
path["Clan"] = gotClan ? (string)Clans?.CallHook("GetClanOf", userID) : "None";
path["TimePlayed"] = (time == null) ? "0" : time;
}
public void UpdatePlayer(BasePlayer player, bool titles)
{
var path = data.PlayerRankData[player.userID];
bool gotClan = (Clans?.CallHook("GetClanOf", player.userID) != null);
var time = PlaytimeTracker?.Call("GetPlayTime", player.UserIDString);
path["UserID"] = player.userID;
path["Admin"] = IsAuth(player);
path["Changed"] = true;
path["Name"] = CleanString(player.displayName, "");
path["Status"] = "online";
path["ActiveDate"] = DateTime.UtcNow;
path["Economics"] = Economics ? Economics?.Call("Balance", player.userID) : path["Economics"];
path["ServerRewards"] = ServerRewards ? ServerRewards?.Call("CheckPoints", player.userID) : path["ServerRewards"];
path["Clan"] = gotClan ? (string)Clans?.CallHook("GetClanOf", player.userID) : "None";
path["TimePlayed"] = (time == null) ? "0" : time;
data.PlayerRankData[player.userID]["OptOut"] = HasPermission(player.UserIDString, permOptOut);
if (titles)
LoadTitles();
}
PlayerRanks use GetPlayTimeClock, not same so not this?
Could someone tell if the plugin is the cause or the others?Thank you