NullReferenceException with GetPlaytimeForeverFixed
Web request callback raised an exception (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.SteamChecks.GetPlaytimeForever (Oxide.Plugins.SteamChecks+Games games) [0x00000] in :0
at Oxide.Plugins.SteamChecks+c__AnonStorey4.<>m__0 (System.Int32 code, System.String response) [0x0006d] in :0
at Oxide.Core.Libraries.WebRequests+WebRequest.b__42_0 () [0x00034] in <4452f821def6406d834e4149849fe7ea>:0

same here:

Web request callback raised an exception (NullReferenceException: Object reference not set to an instance of an object)

at Oxide.Plugins.SteamChecks.GetPlaytimeForever (Oxide.Plugins.SteamChecks+Games games) [0x00000] in <e7547cd1c32b44dcbe0bf39ae65bd149>:0

at Oxide.Plugins.SteamChecks+<CheckGames>c__AnonStorey4.<>m__0 (System.Int32 code, System.String response) [0x0006d] in <e7547cd1c32b44dcbe0bf39ae65bd149>:0

at Oxide.Core.Libraries.WebRequests+WebRequest.<OnComplete>b__42_0 () [0x00034] in <4452f821def6406d834e4149849fe7ea>

Does the mod appear to work despite this message? Or is it now DOA

nashslash

Does the mod appear to work despite this message? Or is it now DOA

Even though the message appears in console it works fine in removing players who are designated for removal according to the settings.

5b7d22c4ef71f.jpg pookins

Even though the message appears in console it works fine in removing players who are designated for removal according to the settings.

Many thanks buddy. I do hate that junk filling up the logs though. Wish someone could sort it ..

please fix this

Web request callback raised an exception in 'SteamChecks v3.0.5' plugin (NullReferenceException: Object reference not set to an instance of an object)

at Oxide.Plugins.SteamChecks.GetPlaytimeForever (Oxide.Plugins.SteamChecks+Games games) [0x00000] in <1eb13b7482d44edf9d04c3cf48de456c>:0

at Oxide.Plugins.SteamChecks+<CheckGames>c__AnonStorey4.<>m__0 (System.Int32 code, System.String response) [0x0006d] in <1eb13b7482d44edf9d04c3cf48de456c>:0

at Oxide.Core.Libraries.WebRequests+WebRequest.<OnComplete>b__42_0 () [0x00034] in <b0a93b504f034a0db8b1c3d2503c0987>:0

same issue here
I get the same error message. In addition, my friends are getting kicked when "GameCount: true" at the default setting at 1 game owned. My friends have like 400 games owned and were getting kicked. I changed it to "false" and they were able to join. I still had that same error message in the console.

A player on my server has 50 hours in Rust. I've set the minimum amount of hrs to (25).

He's still getting kicked out.

I'm also getting this error: http://prntscr.com/r6hl44

 

Any soluton for this Wulf?

Same error here.

Wulf any chance this great mod can get a little love and attention. Its been 10 months now and its been chucking this error out for a long time ? 

nashslash

Wulf any chance this great mod can get a little love and attention. Its been 10 months now and its been chucking this error out for a long time ? 

I'm not the original maintainer, but also haven't had time to review it. If someone else wants to submit a patch, they can.
Hi,

When a player logs in the plugin returns the following error
[5/8/2020 3:21:49 PM] Web request callback raised an exception (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.SteamChecks.GetPlaytimeForever (Oxide.Plugins.SteamChecks+Games games) [0x00000] in <61d74afd3508443a85f34d384b8e3152>:0
  at Oxide.Plugins.SteamChecks+<CheckGames>c__AnonStorey4.<>m__0 (System.Int32 code, System.String response) [0x0006d] in <61d74afd3508443a85f34d384b8e3152>:0
  at Oxide.Core.Libraries.WebRequests+WebRequest.<OnComplete>b__42_0 () [0x00034] in <ac41dd3599754d448b8c218b34645820>:0
5e13a8d5b2bc5.jpg Wulf
I'm not the original maintainer, but also haven't had time to review it. If someone else wants to submit a patch, they can.

I have a fix, if you want :

Between line 660-691 , replace this :

        private void CheckGames(IPlayer player)
        {
            if (IsSharing(player))
            {
                Puts(Lang("ErrorFamilyShare"));
                return;
            }

            if (IsPrivateProfile(player))
            {
                Puts(Lang("ErrorPrivateProfile"));
                return;
            }

            webrequest.Enqueue(string.Format(RootUrl + GamesStr, apiKey, player.Id), null, (code, response) =>
            {
                if (!IsValidRequest((ResponseCode)code)) return;

                var games = Deserialise<Games>(response);

                if (GetGameCount(games) < thresholdGameCount && kickGameCount)
                {
                    Kick(player, "KickGameCount", broadcastGameCount);
                    return;
                }

                if (GetPlaytimeForever(games) / 60 < thresholdHoursPlayed && kickHoursPlayed)
                {
                    Kick(player, "KickHoursPlayed", broadcastHoursPlayed);
                }
            }, this);
        }

By this :

       private void CheckGames(IPlayer player)
        {
            if (IsSharing(player))
            {
                Puts(Lang("ErrorFamilyShare"));
                return;
            }

            if (IsPrivateProfile(player))
            {
                Puts(Lang("ErrorPrivateProfile"));
                return;
            }

            webrequest.Enqueue(string.Format(RootUrl + GamesStr, apiKey, player.Id), null, (code, response) =>
            {
                if (!IsValidRequest((ResponseCode)code)) return;

                var games = Deserialise<Games>(response);

                if (GetGameCount(games) < thresholdGameCount && kickGameCount)
                {
                    Kick(player, "KickGameCount", broadcastGameCount);
                    return;
                }
				if (!(GetPlaytimeForever(games) == 0))
				{				
					if (GetPlaytimeForever(games) / 60 < thresholdHoursPlayed && kickHoursPlayed)
					{
                    Kick(player, "KickHoursPlayed", broadcastHoursPlayed);
					}
				}
            }, this);
        }

Regards.


Merged post

Still an error, I will look

Merged post

@Wulf
 
This is the final code, fixed all errors. if you want to put it on the official download page.

Regards.

Moderator edit: Full code removed, random versions not allowed.



Merged post

Error fixed, replace old code between line 660-691 :

 

        private void CheckGames(IPlayer player)
        {
            if (IsSharing(player))
            {
                Puts(Lang("ErrorFamilyShare"));
                return;
            }

            if (IsPrivateProfile(player))
            {
                Puts(Lang("ErrorPrivateProfile"));
                return;
            }

            webrequest.Enqueue(string.Format(RootUrl + GamesStr, apiKey, player.Id), null, (code, response) =>
            {
                if (!IsValidRequest((ResponseCode)code)) return;

                var games = Deserialise<Games>(response);

                if (GetGameCount(games) < thresholdGameCount && kickGameCount)
                {
                    Kick(player, "KickGameCount", broadcastGameCount);
                    return;
                }

                if (GetPlaytimeForever(games) / 60 < thresholdHoursPlayed && kickHoursPlayed)
                {
                    Kick(player, "KickHoursPlayed", broadcastHoursPlayed);
                }
            }, this);
        }

 

By this :

 

        private void CheckGames(IPlayer player)
        {
            if (IsSharing(player))
            {
                Puts(Lang("ErrorFamilyShare"));
                return;
            }

            if (IsPrivateProfile(player))
            {
                Puts(Lang("ErrorPrivateProfile"));
                return;
            }

            webrequest.Enqueue(string.Format(RootUrl + GamesStr, apiKey, player.Id), null, (code, response) =>
            {
                if (!IsValidRequest((ResponseCode)code)) return;
				
				var games = Deserialise<Games>(response);
				
				if (response.ToLower().Contains("game_count"))
				{					
				if (GetGameCount(games) < thresholdGameCount && kickGameCount)
                {
                    Kick(player, "KickGameCount", broadcastGameCount);
                    return;
                }
				}
				if (response.ToLower().Contains("playtime_forever"))
				{											
					if (GetPlaytimeForever(games) / 60 < thresholdHoursPlayed && kickHoursPlayed)
					{
                    Kick(player, "KickHoursPlayed", broadcastHoursPlayed);
					}
				}
            }, this);
        }

 

Regards

Locked automatically