SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
88 stars 18 forks source link

Object reference not set to an instance of an object. #2279

Closed MihailHavenT closed 3 years ago

MihailHavenT commented 3 years ago

1.

[12/26/2020 15:21:30] [Error] Object reference not set to an instance of an object
[12/26/2020 15:22:26] [Error]   at SDG.Unturned.PlayerEquipment.simulate (System.UInt32 simulation, System.Boolean inputPrimary, System.Boolean inputSecondary, System.Boolean inputSteady) [0x002c4] in <f84ca727c6224c6da32cb2702db0177c>:0

2.

[12/26/2020 20:35:37] [Error] Object reference not set to an instance of an object
[12/26/2020 20:35:37] [Error]   at Pathfinding.ABPath.Cleanup () [0x00027] in <f84ca727c6224c6da32cb2702db0177c>:0 
  at AstarPath.CalculatePathsThreaded (System.Object _threadInfo) [0x00177] in <f84ca727c6224c6da32cb2702db0177c>:0 
[12/26/2020 20:35:37] [Error] Unhandled exception during pathfinding. Terminating.
[12/26/2020 20:35:37] [Error] Error : This part should never be reached.
MihailHavenT commented 3 years ago

Nelson ?

SDGNelson commented 3 years ago

If you can share the full log there might be more context for the second exception.

As for the first one, I have looked into that before but do not see what is going wrong. Might split it into multiple methods to get a more useful call stack.

MihailHavenT commented 3 years ago

Server_unturned.log Done

SDGNelson commented 3 years ago

Thanks for the log. Was this a one-off thing or is it always happening?

MihailHavenT commented 3 years ago

It always happens on the Germany map, on the PEI map it rarely happens...

MihailHavenT commented 3 years ago

again :(

[01/09/2021 01:59:07] [Error] Object reference not set to an instance of an object
[01/09/2021 01:59:07] [Error]   at Pathfinding.ABPath.Cleanup () [0x00008] in <a23632a44996440884ec006f84e207aa>:0 
  at AstarPath.CalculatePathsThreaded (System.Object _threadInfo) [0x00177] in <a23632a44996440884ec006f84e207aa>:0 
[01/09/2021 01:59:07] [Error] Unhandled exception during pathfinding. Terminating.
[01/09/2021 01:59:07] [Error] Error : This part should never be reached.
SDGNelson commented 3 years ago

With yesterday's update we will hopefully get a more useful error for the equipment exception.

As for the pathfinding though... unless other hosts are running into it, I am hesitant to touch it. My hope is that one of the plugins is doing something weird with zombies. Ideally the game could update to Unity's newer built-in navmesh system, but as usual with Unity it is missing critical features. The game could update to a newer version of A* pathfinding project, but I am also hesitant because it works fine as-is.

MihailHavenT commented 3 years ago

Can you solve his problem or ?

SDGNelson commented 3 years ago

No other hosts have reported the pathfinding internal issue, so I am hesitant to mess with it. Since your server has tons of plugins installed (and in particular Avi plugins) my hope is that it might just be one of them causing the problem. If other hosts report it or it happens in vanilla then I will definitely have to do something about it.

MihailHavenT commented 3 years ago

Again, i dont know which plugin is causing this problem? :/

SDGNelson commented 3 years ago

Does it happen if you temporarily disable all plugins?

MihailHavenT commented 3 years ago

I havent tried but i will...

MihailHavenT commented 3 years ago
[01/16/2021 18:08:27] [Error] Object reference not set to an instance of an object
[01/16/2021 18:08:27] [Error]   at SDG.Unturned.PlayerEquipment.simulate_UseableInput (System.UInt32 simulation, System.Boolean inputPrimary, System.Boolean inputSecondary, System.Boolean inputSteady) [0x000cb] in <a23632a44996440884ec006f84e207aa>:0
SDGNelson commented 3 years ago

Thanks for the report. That will help narrow down the SDG.Unturned.PlayerEquipment.simulate exception.

MihailHavenT commented 3 years ago
[01/23/2021 20:09:04] [Error] Object reference not set to an instance of an object
[01/23/2021 20:09:04] [Error]   at SDG.Unturned.PlayerEquipment.simulate_UseableInput (System.UInt32 simulation, System.Boolean inputPrimary, System.Boolean inputSecondary, System.Boolean inputSteady) [0x000cb] in <b73b4a1a9dee44438a78d040cef5b999>:0

again

SDGNelson commented 3 years ago

Hmm....

MihailHavenT commented 3 years ago

so ?

SDGNelson commented 3 years ago

Ah, I think I finally realized the problem, and it was dumb on my part: if the primary attack destroyed the item on the same input tick that the secondary attack was used this happened. Will fix in the patch.

MihailHavenT commented 3 years ago

Then the next update will be resolved, right?

CyberAndrii commented 3 years ago

I have seen multiple times people say they can't enter their vehicles and recently that happened to me. The reason was that InteractableVehicle.init() doesn't have null checks in some places (for example as on the screenshot after .Find()).

image

For my vehicle, I don't need Objects GameObject so I just deleted it and then spend half of night figuring out the reason it is not working. Would be good if you fix this too.

SDGNelson commented 3 years ago

Hopefully resolved unless I was wrong.

@CyberAndrii unfortunately there are lots of places in the older code that do stupid stuff like that. I fix it as a I come across it, but it will be a while before it is all cleaned up.

MihailHavenT commented 3 years ago
[01/30/2021 04:24:10] [Error] Object reference not set to an instance of an object
[01/30/2021 04:24:10] [Error]   at Pathfinding.ABPath.Initialize () [0x00008] in <a2a7dbf0d505493a95dbc2a5f1429258>:0 
  at AstarPath.CalculatePathsThreaded (System.Object _threadInfo) [0x000d7] in <a2a7dbf0d505493a95dbc2a5f1429258>:0 
[01/30/2021 04:24:10] [Error] Unhandled exception during pathfinding. Terminating.
[01/30/2021 04:24:10] [Error] Error : This part should never be reached.

Again , even after the update 3.21.4.0 ?

SDGNelson commented 3 years ago

Only the equipment one was fixed, not the pathfinding exception. Bradler26 ran into the pathfinding exception as well so I am taking it more seriously, but I am not sure when I can address it.

MihailHavenT commented 3 years ago
[01/30/2021 14:24:33] [Info] [World] linus.isaksson2000 [Tobbe trollkarl]: "/tpa a"
[01/30/2021 14:25:00] [Error] An item with the same key has already been added. Key: 76561198001001090
[01/30/2021 14:25:08] [Error]   at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <9577ac7a62ef43179789031239ba8798>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at Essentials.Core.EssCore.PlayerConnectCallback (Steamworks.CSteamID id) [0x00018] in <5c946b1f5382450ca467a601af0ef14c>:0 
  at (wrapper delegate-invoke) <Module>.invoke_void_CSteamID(Steamworks.CSteamID)
  at SDG.Unturned.Provider.accept (SDG.Unturned.SteamPlayerID playerID, System.Boolean isPro, System.Boolean isAdmin, System.Byte face, System.Byte hair, System.Byte beard, UnityEngine.Color skin, UnityEngine.Color color, UnityEngine.Color markerColor, System.Boolean hand, System.Int32 shirtItem, System.Int32 pantsItem, System.Int32 hatItem, System.Int32 backpackItem, System.Int32 vestItem, System.Int32 maskItem, System.Int32 glassesItem, System.Int32[] skinItems, System.String[] skinTags, System.String[] skinDynamicProps, SDG.Unturned.EPlayerSkillset skillset, System.String language, Steamworks.CSteamID lobbyID) [0x00572] in <a2a7dbf0d505493a95dbc2a5f1429258>:0 
[01/30/2021 14:25:08] [Info] Connecting: PlayerID: 76561198001001090 Name: GodGamer420 Character: pvt. abdi
[01/30/2021 14:25:08] [Info] Broadcast: [ pvt. abdi ] connected to the server.
[01/30/2021 14:25:08] [Info] Kicking for inactivity: PlayerID: 76561198001001090 Name: GodGamer420 Character: pvt. abdi
[01/30/2021 14:25:33] [Info] Broadcast: [ pvt. abdi ] disconnected from the server.
[01/30/2021 14:25:33] [Info] Disconnecting: PlayerID: 76561198001001090 Name: GodGamer420 Character: pvt. abdi
[01/30/2021 14:25:33] [Error] Rocket.Unturned >> Failed to receive packet "tellWater" -> Exception in <bindDelegates>b__16_2: System.NullReferenceException: Object reference not set to an instance of an object
  at Rocket.Unturned.Events.UnturnedPlayerEvents.TriggerSend (SDG.Unturned.SteamPlayer s, System.String W, SDG.Unturned.ESteamCall X, SDG.Unturned.ESteamPacket l, System.Object[] R) [0x004df] in <f7fc3477ce904cd7b0855528282ac704>:0 
[01/30/2021 14:25:36] [Error] Rocket.Unturned >> Failed to receive packet "tellFood" -> Exception in <bindDelegates>b__16_2: System.NullReferenceException: Object reference not set to an instance of an object
  at Rocket.Unturned.Events.UnturnedPlayerEvents.TriggerSend (SDG.Unturned.SteamPlayer s, System.String W, SDG.Unturned.ESteamCall X, SDG.Unturned.ESteamPacket l, System.Object[] R) [0x003ef] in <f7fc3477ce904cd7b0855528282ac704>:0 
[01/30/2021 14:26:05] [Error] Rocket.Unturned >> Failed to receive packet "tellWater" -> Exception in <bindDelegates>b__16_2: System.NullReferenceException: Object reference not set to an instance of an object
  at Rocket.Unturned.Events.UnturnedPlayerEvents.TriggerSend (SDG.Unturned.SteamPlayer s, System.String W, SDG.Unturned.ESteamCall X, SDG.Unturned.ESteamPacket l, System.Object[] R) [0x004df] in <f7fc3477ce904cd7b0855528282ac704>:0 
[01/30/2021 14:26:28] [Info] Connecting: PlayerID: 76561198001001090 Name: GodGamer420 Character: pvt. abdi
[01/30/2021 14:26:40] [Info] Broadcast: [ pvt. abdi ] connected to the server.
[01/30/2021 14:26:40] [Info] AviAdminTools >> AdminTools InfoManager: register player pvt. abdi (76561198001001090)
[01/30/2021 14:26:40] [Info] Kicking for inactivity: PlayerID: 76561198001001090 Name: GodGamer420 Character: pvt. abdi
[01/30/2021 14:27:01] [Info] Broadcast: [ pvt. abdi ] disconnected from the server.
[01/30/2021 14:27:01] [Info] Disconnecting: PlayerID: 76561198001001090 Name: GodGamer420 Character: pvt. abdi
[01/30/2021 14:27:01] [Error] Rocket.Unturned >> Failed to receive packet "tellWater" -> Exception in <bindDelegates>b__16_2: System.NullReferenceException: Object reference not set to an instance of an object
  at Rocket.Unturned.Events.UnturnedPlayerEvents.TriggerSend (SDG.Unturned.SteamPlayer s, System.String W, SDG.Unturned.ESteamCall X, SDG.Unturned.ESteamPacket l, System.Object[] R) [0x004df] in <f7fc3477ce904cd7b0855528282ac704>:0 
[01/30/2021 14:27:04] [Error] Rocket.Unturned >> Failed to receive packet "tellFood" -> Exception in <bindDelegates>b__16_2: System.NullReferenceException: Object reference not set to an instance of an object
  at Rocket.Unturned.Events.UnturnedPlayerEvents.TriggerSend (SDG.Unturned.SteamPlayer s, System.String W, SDG.Unturned.ESteamCall X, SDG.Unturned.ESteamPacket l, System.Object[] R) [0x003ef] in <f7fc3477ce904cd7b0855528282ac704>:0 
[01/30/2021 14:27:33] [Error] Rocket.Unturned >> Failed to receive packet "tellWater" -> Exception in <bindDelegates>b__16_2: System.NullReferenceException: Object reference not set to an instance of an object
  at Rocket.Unturned.Events.UnturnedPlayerEvents.TriggerSend (SDG.Unturned.SteamPlayer s, System.String W, SDG.Unturned.ESteamCall X, SDG.Unturned.ESteamPacket l, System.Object[] R) [0x004df] in <f7fc3477ce904cd7b0855528282ac704>:0 
[01/30/2021 14:28:03] [Info] Kicking for inactivity: PlayerID: 76561198001001090 Name: GodGamer420 Character: pvt. abd

whut ?

SDGNelson commented 3 years ago

Plugin + "EssCore" exception

MihailHavenT commented 3 years ago
[2021-02-27 11:17:04 ERR][SDG.Unturned] Could not terminate pathfinding thread[3] in 50ms, trying Thread.Abort
[2021-02-27 11:17:04 ERR][SDG.Unturned] Object synchronization method was called from an unsynchronized block of code.
[2021-02-27 11:17:04 ERR][SDG.Unturned]   at (wrapper managed-to-native) System.Threading.Monitor.Exit(object)
  at Pathfinding.ThreadControlQueue.Pop () [0x0013c] in <5f4e60d760764c04ad4e24fb2269a943>:0 
  at AstarPath.CalculatePathsThreaded (System.Object _threadInfo) [0x00069] in <5f4e60d760764c04ad4e24fb2269a943>:0 
[2021-02-27 11:17:04 ERR][SDG.Unturned] Unhandled exception during pathfinding. Terminating.

Map ELVER

SDGNelson commented 3 years ago

Looks like a different exception during shutdown.

Dark5952 commented 10 months ago

NullReferenceException: Object reference not set to an instance of an object at SDG.Unturned.Assets.Update () [0x00000] in :0

GazziFX commented 10 months ago

NullReferenceException: Object reference not set to an instance of an object at SDG.Unturned.Assets.Update () [0x00000] in :0

You have different exception and this topic really old, you should open new one