Jump to content

new update gave me error

Closed 2.0.6 2.0.7

Theswingingturtle

Posted

Failed to call hook 'OnServerInitialized' on plugin 'ShoppyStock v2.0.6' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.ShoppyStock.FixData () [0x002c9] in <14b660629fac40ffb98a1ce218c34f7a>:0 
  at Oxide.Plugins.ShoppyStock.OnServerInitialized () [0x0006c] in <14b660629fac40ffb98a1ce218c34f7a>:0 
  at Oxide.Plugins.ShoppyStock.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00164] in <14b660629fac40ffb98a1ce218c34f7a>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <42f9bedc659b4f4786eb778d3cd58968>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in <d59b507fd76240e5b62228d0eae39b73>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <d59b507fd76240e5b62228d0eae39b73>:0 

after uploading the new cs files. Do I need to upload all the others again too?

ThePitereq

Posted

3 minutes ago, Theswingingturtle said:

Failed to call hook 'OnServerInitialized' on plugin 'ShoppyStock v2.0.6' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.ShoppyStock.FixData () [0x002c9] in <14b660629fac40ffb98a1ce218c34f7a>:0 
  at Oxide.Plugins.ShoppyStock.OnServerInitialized () [0x0006c] in <14b660629fac40ffb98a1ce218c34f7a>:0 
  at Oxide.Plugins.ShoppyStock.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00164] in <14b660629fac40ffb98a1ce218c34f7a>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <42f9bedc659b4f4786eb778d3cd58968>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in <d59b507fd76240e5b62228d0eae39b73>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <d59b507fd76240e5b62228d0eae39b73>:0 

after uploading the new cs files. Do I need to upload all the others again too?

Oh, i know where is the issue, it doesnt came up to me in tests as i had this data part empty, will push update in few mins

ThePitereq

Posted

Should be fixed now, sorry for problems.

Theswingingturtle

Posted

can i replace like this?
 

private void FixData()
{
    foreach (var player in data.currencies.players.Values)
        player.userName = (player.userName ?? string.Empty).Replace("\"", "").Replace("\\", "");

    foreach (var stock in data.stock.Values)
    {
        foreach (var shortname in stock.listings.sellOffers.Values)
        foreach (var skin in shortname.Values)
        foreach (var item in skin)
            item.userName = (item.userName ?? string.Empty).Replace("\"", "").Replace("\\", "");

        foreach (var shortname in stock.listings.buyOffers.Values)
        foreach (var skin in shortname.Values)
        foreach (var item in skin)
            item.userName = (item.userName ?? string.Empty).Replace("\"", "").Replace("\\", "");

        foreach (var action in stock.stats.actions.Values)
        {
            action.field1 = (action.field1 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field2 = (action.field2 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field3 = (action.field3 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field4 = (action.field4 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field5 = (action.field5 ?? string.Empty).Replace("\"", "").Replace("\\", "");
        }
    }
}

Theswingingturtle

Posted

Okey, thank you for the quick reply/work man, you're a hero making this plugin!

  • Love 1
ThePitereq

Posted

2 minutes ago, Theswingingturtle said:

can i replace like this?
 

private void FixData()
{
    foreach (var player in data.currencies.players.Values)
        player.userName = (player.userName ?? string.Empty).Replace("\"", "").Replace("\\", "");

    foreach (var stock in data.stock.Values)
    {
        foreach (var shortname in stock.listings.sellOffers.Values)
        foreach (var skin in shortname.Values)
        foreach (var item in skin)
            item.userName = (item.userName ?? string.Empty).Replace("\"", "").Replace("\\", "");

        foreach (var shortname in stock.listings.buyOffers.Values)
        foreach (var skin in shortname.Values)
        foreach (var item in skin)
            item.userName = (item.userName ?? string.Empty).Replace("\"", "").Replace("\\", "");

        foreach (var action in stock.stats.actions.Values)
        {
            action.field1 = (action.field1 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field2 = (action.field2 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field3 = (action.field3 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field4 = (action.field4 ?? string.Empty).Replace("\"", "").Replace("\\", "");
            action.field5 = (action.field5 ?? string.Empty).Replace("\"", "").Replace("\\", "");
        }
    }
}

I think so, but the update is out already.

Theswingingturtle

Posted

2 minutes ago, ThePitereq said:

I think so, but the update is out already.

working like a charm! Appreciate you!

ThePitereq

Posted

Changed Status from Pending to Closed

2m

Downloads

Total number of downloads.

9.3k

Customers

Total customers served.

136.1k

Files Sold

Total number of files sold.

2.9m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.