NullReferenceException at LoadedFixed

Hi,

I cant add this plugin to my Big Rust server because :

When I start the server, the plugin cant load - Message :

15:00 [Info] [ServerArmour] Server Armour is being initialized.
15:00 [Info] [ServerArmour] Registering groups
15:00 [Info] [ServerArmour] Checking if config groups exists.
15:00 [Info] [ServerArmour] DATA loaded
15:00 [Info] [ServerArmour] Checking all known users.
15:00 [Error] Failed to initialize plugin 'ServerArmour v0.0.66' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.ServerArmour.Loaded () [0x0001c] in <edd1ce70c6ca41bda1c869406e495acd>:0
at Oxide.Plugins.ServerArmour.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00392] in <edd1ce70c6ca41bda1c869406e495acd>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <41771c7bc8d246d0b0a34c2f0d27f2cb>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b0a93b504f034a0db8b1c3d2503c0987>:0
at Oxide.Plugins.CSharpPlugin.HandleAddedToManager (Oxide.Core.Plugins.PluginManager manager) [0x0006e] in <41771c7bc8d246d0b0a34c2f0d27f2cb>:0
15:00 [Info] Unloaded plugin ServerArmour v0.0.66 by Pho3niX90


I can start it after with the command oxide.reload

But when the plugin start, the server have big latence, and the fps drop to 10 fps, because the plugin check all users infraction like that :

[ServerArmour] Checking all user for infractions 1225 of 58757
[ServerArmour] Checking all user for infractions 1226 of 58757
[ServerArmour] Checking all user for infractions 1227 of 58757
[ServerArmour] Checking all user for infractions 1228 of 58757
[ServerArmour] Checking all user for infractions 1229 of 58757
[ServerArmour] Checking all user for infractions 1230 of 58757
[ServerArmour] Checking all user for infractions 1231 of 58757
[ServerArmour] Checking all user for infractions 1232 of 58757
[ServerArmour] Checking all user for infractions 1233 of 58757
[ServerArmour] Checking all user for infractions 1234 of 58757

Take a long, long time to do this operation, like 1 hour for 10000 user..

It will be an excellent plugin, but dont work for the moment.

If you need more info just tell me.

Regards.

i think this plugin have to check players only when he enter in server
So it is not suppose to drop any frames, this is the main reason why it's slowly going through all the users.

Main reason for this is, so that your users are cached for the next time they enter. That being said, for the time being I will disable the checking on startup.

Merged post

Please download version 0.0.70.

When loaded, it will not scan historical users, only online ones. The impact of disc is also drastically reduced. 
Wahouuuu, Many Thanks.

I make some test now.

Same error at server start

After reload with oxide.reload command, new error after checking local ban :

20:32 [Info] ServerArmour was compiled successfully in 2201ms
20:32 [Info] [ServerArmour] Server Armour is being initialized.
20:32 [Info] [ServerArmour] Registering groups
20:32 [Info] [ServerArmour] Checking if config groups exists.
20:32 [Info] [ServerArmour] Checking all known users.
20:32 [Info] [ServerArmour] Checking local user ban 1 of 149
20:32 [Info] [ServerArmour] Server Armour finished initializing.
20:32 [Info] Loaded plugin ServerArmour v0.0.70 by Pho3niX90
20:32 [Info] [ServerArmour] Checking local user ban 2 of 149
20:32 [Info] [ServerArmour] Бабы как медали had no ban data cached, now creating.
NullReferenceException: Object reference not set to an instance of an object

Stopped after this error

This is the data file after the first scan, Maybe it's the null for steamData the problem, I replace my Ip by XX.XX.....

{
  "76561198182474618": {
    "steamid": "76561198182474618",
    "username": "Бабы как медали",
    "steamData": null,
    "serverBanCount": 1,
    "serverBanData": [{
      "banId": null,
      "serverName": "Rustonia Solo/Duo",
      "serverIp": "XX.XX.XX.XX",
      "reason": "Group > 2",
      "date": "2020/01/26 20:32",
      "isAimbot": false,
      "isHack": false,
      "isEspHack": false,
      "isScript": false,
      "isCheat": false,
      "isToxic": false,
      "isInsult": false,
      "isPing": false,
      "isRacism": false
    }],
    "cacheTimestamp": 1580067153,
    "lastConnected": 1580067153,
    "arkanInfo": null,
    "arkanIRData": null,
    "arkanABData": null,
    "arkanNRData": null
  }
}
Thank you for this, it helps! I will investigate the issue and report back.

Are you using the arkan plugin as well?
You're welcome.
I tried with and without arkan.

Same issue. 
Regards

Merged post

I removed the scan for the local ban on start and It work fine. Need to do the oxide.reload to start the plugin after booting the server.

 

The scan for local ban crashed after the First User.

 

Regards

Failed to initialize plugin 'ServerArmour v0.0.70' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.ServerArmour.Loaded () [0x0001c] in <234864ffa3fe4178b28b928077f4cad8>:0
at Oxide.Plugins.ServerArmour.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00392] in <234864ffa3fe4178b28b928077f4cad8>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <41771c7bc8d246d0b0a34c2f0d27f2cb>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <b0a93b504f034a0db8b1c3d2503c0987>:0
at Oxide.Plugins.CSharpPlugin.HandleAddedToManager (Oxide.Core.Plugins.PluginManager manager) [0x0006e] in <41771c7bc8d246d0b0a34c2f0d27f2cb>:0
This should now be fixed v0.0.78
just updated, had to delete the JSON file for the regeneration of a fresh file. 

(16:59:28) | [ServerArmour] Server Armour unloading, will now save all data.
(16:59:28) | [ServerArmour] Server Armour finished unloaded.
(16:59:28) | Unloaded plugin ServerArmour v0.0.80 by Pho3niX90
(16:59:28) | [ServerArmour] DATA loaded
(16:59:28) | [ServerArmour] Server Armour is being initialized.
(16:59:28) | [ServerArmour] Registering groups
(16:59:28) | [ServerArmour] Checking if config groups exists.
(16:59:28) | [ServerArmour] Server Armour finished initializing.
(16:59:28) | Loaded plugin ServerArmour v0.0.80 by Pho3niX90
(16:59:38) | [ServerArmour] Will now inspect all online users, time etimation: 0.2 seconds
(16:59:38) | [ServerArmour] Inspection completed.
(16:59:38) | [ServerArmour] Checking local user ban 1 of 2
(16:59:38) | NullReferenceException: Object reference not set to an instance of an object​
5e3019fdde4af.jpg knoepert
just updated, had to delete the JSON file for the regeneration of a fresh file. 

(16:59:28) | [ServerArmour] Server Armour unloading, will now save all data.
(16:59:28) | [ServerArmour] Server Armour finished unloaded.
(16:59:28) | Unloaded plugin ServerArmour v0.0.80 by Pho3niX90
(16:59:28) | [ServerArmour] DATA loaded
(16:59:28) | [ServerArmour] Server Armour is being initialized.
(16:59:28) | [ServerArmour] Registering groups
(16:59:28) | [ServerArmour] Checking if config groups exists.
(16:59:28) | [ServerArmour] Server Armour finished initializing.
(16:59:28) | Loaded plugin ServerArmour v0.0.80 by Pho3niX90
(16:59:38) | [ServerArmour] Will now inspect all online users, time etimation: 0.2 seconds
(16:59:38) | [ServerArmour] Inspection completed.
(16:59:38) | [ServerArmour] Checking local user ban 1 of 2
(16:59:38) | NullReferenceException: Object reference not set to an instance of an object​

Thank you for letting me know! Will investigate now

Merged post

@knoepert this should now be fixed in ```0.0.84``` please let me know if the issue presists
Locked automatically