valheimPlus / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
http://valheim.plus
GNU Affero General Public License v3.0
967 stars 237 forks source link

[BUG] Disconnect/Save exception #510

Closed fschoenfeldt closed 3 years ago

fschoenfeldt commented 3 years ago

Describe the bug

Mostly this bug happens when you log out when you're infight or nearby enemies.

To Reproduce

Steps for the devs to reproduce the behavior:

  1. Go infight
  2. Disconnect from the server

Now youre stuck in black screen without being able to do anything. You can see "You're getting cold" and "getting wet" etc. though. With alt+f4 and upon reconnect, character is reverted to last savegame as stacktrace suggests hence save is failing.

Expected behavior

save character & disconnect to main menu

Troubleshooting

%

Screenshots

[Info   : Unity Log] 04/05/2021 22:33:05: UI Group status changed MenuRoot = True

[Info   : Unity Log] 04/05/2021 22:33:06: UI Group status changed MenuRoot = True

[Info   : Unity Log] 04/05/2021 22:33:07: UI Group status changed MenuRoot = False

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
Skills.Save (ZPackage pkg) (at <6fd2223d69c147d18c77057ce0dedd7b>:0)
Player.Save (ZPackage pkg) (at <6fd2223d69c147d18c77057ce0dedd7b>:0)
PlayerProfile.SavePlayerData (Player player) (at <6fd2223d69c147d18c77057ce0dedd7b>:0)
Game.SavePlayerProfile (System.Boolean setLogoutPoint) (at <6fd2223d69c147d18c77057ce0dedd7b>:0)
Game.Shutdown () (at <6fd2223d69c147d18c77057ce0dedd7b>:0)
Game.Logout () (at <6fd2223d69c147d18c77057ce0dedd7b>:0)
Menu.OnLogoutYes () (at <6fd2223d69c147d18c77057ce0dedd7b>:0)
UnityEngine.Events.InvokableCall.Invoke () (at <51725b129ecd4967a9a213c1ae65b295>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <51725b129ecd4967a9a213c1ae65b295>:0)
UnityEngine.UI.Button.Press () (at <5abdc278a459476dabe36f8ad65ea091>:0)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <5abdc278a459476dabe36f8ad65ea091>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <5abdc278a459476dabe36f8ad65ea091>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <5abdc278a459476dabe36f8ad65ea091>:0)
UnityEngine.EventSystems.EventSystem:Update()

Additional context

%

fschoenfeldt commented 3 years ago

config:

``` [ValheimPlus] ; Change false to true to enable this section enabled=true ; Display the Valheim Plus logo in the main menu mainMenuLogo=true ; Display the advertisement of our server hosting partner on the server browser menu serverBrowserAdvertisement=true [AdvancedBuildingMode] ; https://docs.unity3d.com/ScriptReference/KeyCode.html <- a list of keycodes ; Change false to true to enable this section, if you set this to false the mode will not be accesible enabled=false ; Enter the advanced building mode with this key when building enterAdvancedBuildingMode=F1 ; Exit the advanced building mode with this key when building exitAdvancedBuildingMode=F3 ; Copy the object rotation of the currently selected object in ABM copyObjectRotation=Keypad7 ; Apply the copied object rotation to the currently selected object in ABM pasteObjectRotation=Keypad8 ; Increases the amount an object rotates and moves. ; Holding Shift will increase in increments of 10 instead of 1. increaseScrollSpeed=KeypadPlus ; Decreases the amount an object rotates and moves. ; Holding Shift will decrease in increments of 10 instead of 1. decreaseScrollSpeed=KeypadMinus [AdvancedEditingMode] ; Change false to true to enable this section, if you set this to false the mode will not be accesible enabled=false ; https://docs.unity3d.com/ScriptReference/KeyCode.html <- a list of keycodes ; Enter the advanced editing mode with this key enterAdvancedEditingMode=Keypad0 ; Reset the object to its original position and rotation resetAdvancedEditingMode=F7 ; Exit the advanced editing mode with this key and reset the object abortAndExitAdvancedEditingMode=F8 ; Confirm the placement of the object and place it confirmPlacementOfAdvancedEditingMode=KeypadEnter ; Copy the object rotation of the currently selected object in AEM copyObjectRotation=Keypad7 ; Apply the copied object rotation to the currently selected object in AEM pasteObjectRotation=Keypad8 ; Increases the amount an object rotates and moves. ; Holding Shift will increase in increments of 10 instead of 1. increaseScrollSpeed=KeypadPlus ; Decreases the amount an object rotates and moves. ; Holding Shift will decrease in increments of 10 instead of 1. decreaseScrollSpeed=KeypadMinus [Beehive] ; Change false to true to enable this section enabled=false ; configure the speed at which the bees produce honey in seconds, 1200 seconds are 24 ingame hours honeyProductionSpeed=1200 ; configure the maximum amount of honey in beehives maximumHoneyPerBeehive=4 ; Instead of dropping the items, they will be placed inside nearby chests instead. autoDeposit=false ; The range of the chest detection for the auto deposit feature. (Maximum is 50) autoDepositRange=10 ; Display the minutes and seconds until the beehive produces honey on hover showDuration=false [Building] ; Change false to true to enable this section enabled=true ; Remove some of the Invalid placement messages, most notably provides the ability to place objects into other objects noInvalidPlacementRestriction=false ; Removes the "Mystical forces" building prevention and allows destruction of build objects in those areas with the hammer. noMysticalForcesPreventPlacementRestriction=false ; Removes the weather damage from rain noWeatherDamage=false ; The maximum range that you can place build objects at maximumPlacementDistance=5 ; The radius, in meters, in which a piece must be to contribute to the comfort level. ; Default: 10 pieceComfortRadius=10 ; When destroying a building piece, setting this to true will ensure it always drops full resources. ; default: false alwaysDropResources=true ; When destroying a building piece, setting this to true will ensure it always drops pieces that the devs have marked as "do not drop". ; default: false alwaysDropExcludedResources=false ; Setting this to true will cause repairing with the hammer to repair in a radius. enableAreaRepair=true ; Sets the area repair radius. A value of 7.5 would mean your repair radius is 7.5m. Requires enableAreaRepair=true areaRepairRadius=7.5 [Camera] ; Change false to true to enable this section enabled=true ; The maximum zoom distance to your character cameraMaximumZoomDistance=6 ; The maximum zoom distance to your character when in a boat cameraBoatMaximumZoomDistance=10 ; The game camera FOV cameraFOV=65 [Experience] ; Change false to true to enable this section enabled=true ; Each of these values represent the increase to experience gained by +/- % ; The value 50 would result in 50% increased experience gained for the respective skill by name. ; The value -50 would result in -50% experience gained for the respective skill by name. swords=50 knives=50 clubs=50 polearms=50 spears=50 blocking=50 axes=50 bows=50 fireMagic=50 frostMagic=50 unarmed=50 pickaxes=50 woodCutting=50 jump=50 sneak=50 run=50 swim=50 [Fermenter] ; Change false to true to enable this section enabled=false ; configure the time that the fermenter takes to produce its product, 2400 seconds are 48 ingame hours fermenterDuration=2400 ; configure the total amount of produced items from a fermenter fermenterItemsProduced=6 ; Display the minutes and seconds until the fermenter is done on hover showDuration=false [FireSource] ; Change false to true to enable this section ; default: false enabled=false ; If set to true, torch-type fire sources will stay at max fuel level once filled. ; Applies to: wood torches, iron torches, green torches, sconces and brazier ; default: false torches=false ; If set to true, non torch-type fire sources will stay at max fuel level once filled. ; default: false fires=true ; Look for fuel inside nearby chests. ; default: false autoFuel=false ; Ignore private area check. ; default: true ignorePrivateAreaCheck=true ; The range of the chest detection for the auto fuel features. ; default: 10 ; min: 1 ; max: 50 autoRange=10 [Food] ; Change false to true to enable this section enabled=false ; Increase or reduce the time that food lasts by %. The value 50 would cause food to run out 50% slower. ; Allows for - values to shorten food duration. foodDurationMultiplier=0 ; If set to true, this option prevents food degrading over time - in other words, it retains its maximum benefit until it expires. disableFoodDegradation=false [Smelter] ; Change false to true to enable this section enabled=true ; Maximum amount of ore in a smelter maximumOre=30 ; Maximum amount of coal in a smelter maximumCoal=60 ; The total amount of coal used to produce a single smelted ingot. coalUsedPerProduct=2 ; The time it takes for the smelter to produce a single ingot in seconds. productionSpeed=30 ; Instead of dropping the items, they will be placed inside nearby chests instead. autoDeposit=true ; Look for fuel inside nearby chests. autoFuel=true ; Ignore private area check. ; default: true ignorePrivateAreaCheck=true ; The range of the chest detection for the auto deposit and fuel features. (Maximum is 50) autoRange=10 [Furnace] ; Change false to true to enable this section enabled=false ; Maximum amount of ore in a furnace maximumOre=100 ; Maximum amount of coal in a furnace maximumCoal=200 ; The total amount of coal used to produce a single smelted ingot. coalUsedPerProduct=2 ; The time it takes for the furnace to produce a single ingot in seconds. productionSpeed=30 ; Instead of dropping the items, they will be placed inside nearby chests instead. autoDeposit=false ; Look for fuel inside nearby chests. autoFuel=true ; Ignore private area check. ; default: true ignorePrivateAreaCheck=true ; The range of the chest detection for the auto deposit and fuel features. (Maximum is 50) autoRange=10 [Game] ; Change false to true to enable this section enabled=false ; The games damage multiplier per person nearby in difficultyScaleRange(m) radius. gameDifficultyDamageScale=0.04 ; The games health multiplier per person nearby in difficultyScaleRange(m) radius. gameDifficultyHealthScale=0.4 ; Adds additional players to the difficulty calculation in multiplayer unrelated to the actual amount extraPlayerCountNearby=0 ; Sets the nearby player count always to this value + extraPlayerCountNearby setFixedPlayerCountTo=0 ; The range in meters at which other players count towards nearby players for the difficulty scale difficultyScaleRange=200 ; If you set this to true, all portals will be disabled disablePortals=false [Hotkeys] ; https://docs.unity3d.com/ScriptReference/KeyCode.html <- a list of keycodes ; Change false to true to enable this section enabled=false ; Roll forwards on key pressed rollForwards=F9 ; Roll backwards on key pressed rollBackwards=F10 [Items] ; Change false to true to enable this section enabled=false ; Enables you to teleport with ores and other usually restricted objects noTeleportPrevention=false ; Increase or reduce item weight by % percent. The value -50 will reduce item weight of every object by 50%. baseItemWeightReduction=0 ; Increase the size of all item stacks by %. The value 50 would set a usual item stack of 100 to be 150. itemStackMultiplier=0 ; Set duration that dropped items live before despawning. Game default is 3600 seconds. droppedItemOnGroundDurationInSeconds=3600 [Hud] ; Change false to true to enable this section enabled=true ; Shows the required amount of items AND the amount of items in your inventory in build mode and while crafting. showRequiredItems=true ; Shows small notifications about all skill experienced gained in the top left corner. experienceGainedNotifications=true ; Shows current and max stamina numerically underneath the stamina bar. displayStaminaValue=false ; Set to true to remove the red screen flash overlay when the player takes damage. removeDamageFlash=false [Gathering] ; Change false to true to enable this section enabled=true ; Modify the chance to drop resources from resource nodes affected by this category ; This only works on resource nodes that do not have guaranteed drops ; As example by default scrap piles in dungeons have a 20% chance to drop a item, if you set this option to 200, you will then have a 60% chance to drop iron. dropChance=0 ; Each of these values increase or reduce the dropped items from destroyed objects with tools (Stones, Trees, Resource nodes, etc.) by % ; The value 50 will increase the dropped wood from trees from 10 to 15. The value -50 will reduce the amount of dropped wood from 10 to 5. wood=0 stone=50 fineWood=0 coreWood=0 elderBark=0 ironScrap=0 tinOre=0 copperOre=0 silverOre=0 chitin=0 [Durability] ; Change false to true to enable this section enabled=true ; Each of these values increase or reduce the durability of the specific item type by % ; The value 50 will increase the durability from 100 to 150. The value -50 will reduce the durability from 100 to 50. axes=50 pickaxes=50 hammer=50 cultivator=50 hoe=50 weapons=50 armor=50 bows=50 shields=50 torch=50 [Armor] ; Change false to true to enable this section enabled=false ; Each of these values increase or reduce the armor of the specific item type by % ; The value 50 will increase the armor from 14 to 21. The value -50 will reduce the durability from 14 to 7. helmets=0 chests=0 legs=0 capes=0 [Kiln] ; Change false to true to enable this section enabled=true ; Maximum amount of wood in a Kiln maximumWood=50 ; The time it takes for the Kiln to produce a single piece of coal in seconds. productionSpeed=30 ; Instead of dropping the items, they will be placed inside nearby chests instead. autoDeposit=false ; Look for fuel inside nearby chests. autoFuel=true ; Ignore private area check. ; default: true ignorePrivateArea=true ; The range of the chest detection for the auto deposit and fuel features. (Maximum is 50) autoRange=10 [Map] ; Change false to true to enable this section enabled=true ; With this enabled you will receive the same exploration progression as other players on the server ; This will also enable the option for the server to sync everyones exploration progression on connecting to the server. shareMapProgression=true ; The radius of the map that you explore when moving exploreRadius=100 ; Prevents you and other people on the server to turn off their map sharing option preventPlayerFromTurningOffPublicPosition=true [Player] ; Change false to true to enable this section enabled=true ; The base amount of carry weight of your character baseMaximumWeight=500 ; Increase the buff you receive to your carry weight from Megingjord's girdle baseMegingjordBuff=150 ; Increase auto pickup range of all items baseAutoPickUpRange=2 ; Disable all types of camera shake disableCameraShake=false ; The base unarmed damage multiplied by your skill level. ; 120 will result in a maximum of up to 12 damage when you have a skill level of 10. baseUnarmedDamage=70 ; When changed to true, you will not be permitted to place a crop within the grow radius of another crop cropNotifier=true ; How many seconds each comfort level contributes to the rested bonus. ; Default: 60 restSecondsPerComfortLevel=60 ; Change the death penalty in percentage, where higher will increase the death penalty and lower will reduce it. ; Example: -50 reduces the death penalty by 50%. ; Example: 50 increases the death penalty by 50%. ; Example: -100 disables the death penalty entirely. deathPenaltyMultiplier=0 ; If set to true, this option will automatically repair your equipment when you interact with the appropriate workbench. autoRepair=true ; Boss buff duration (seconds) guardianBuffDuration=300 ; Boss buff cooldown (seconds) guardianBuffCooldown=1200 ; Disable the Guardian Buff animation disableGuardianBuffAnimation=false ; If set to true, when equipping a one-handed weapon, the best shield from your inventory is automatically equipped. (Best is determined by highest block power) autoEquipShield=false [Server] ; Change false to true to enable this section enabled=true ; Modify the amount of players on your Server maxPlayers=10 ; Removes the requirement to have a server password disableServerPassword=false ; This settings add a version control check to make sure that people that try to join your game or the server you try to join has V+ installed enforceMod=true ; Changes whether the server will force it's config on clients that connect. Only affects servers. serverSyncsConfig=true ; If false allows you to keep your own defined hotkeys instead of synchronising the ones declared for the server. Sections need to be enabled in your local configuration to load hotkeys. This is a client side setting and not affected by server settings. serverSyncHotkeys=false [Stamina] ; Each of these values allow for - values, 50 will increase the stamina cost by 50%, -50 will reduce the stamina cost by 50% ; Change false to true to enable this section enabled=true ; Changes the amount of stamina cost of using the dodge roll by % dodgeStaminaUsage=0 ; Changes the stamina drain of being overweight by % encumberedStaminaDrain=0 ; Changes the stamina cost of jumping by % jumpStaminaDrain=0 ; Changes the stamina cost of running by % runStaminaDrain=-25 ; Changes the stamina drain by sneaking by % sneakStaminaDrain=-25 ; Changes the total amount of stamina recovered per second by % staminaRegen=50 ; Changes the delay until stamina regeneration sets in by % staminaRegenDelay=0 ; Changes the stamina drain of swimming by % swimStaminaDrain=-50 [StaminaUsage] ; Change false to true to enable this section enabled=false ; Each of these values modifies the stamina drain by %. ; The value 50 would result in 50% more stamina cost. ; The value -50 would result in 50% less stamina cost. axes=0 blocking=0 bows=0 clubs=0 knives=0 pickaxes=-25 polearms=0 spears=0 swords=0 unarmed=0 hammer=-50 hoe=-75 cultivator=-75 [StructuralIntegrity] ; Change false to true to enable this section enabled=false ; Disables the entire structural integrity system and allows for placement in free air, does not prevent building damage. disableStructuralIntegrity=false ; Disables any damage from anything to all player built structures. Does not prevent damage from structural integrity. disableDamageToPlayerStructures=false ; Disables any damage from anything to all player built boats disableDamageToPlayerBoats=false ; Each of these values reduce the loss of structural integrity by distance by % less. The value 100 would result in disabled structural integrity and allow placement in free air. wood=0 stone=0 iron=0 hardWood=0 [Time] ; --- > THIS FEATURE IS STILL IN DEVELOPMENT AND IS RIGHT NOW DISABLED UNTIL FURTHER NOTICE ; Change false to true to enable this section ; enabled=false ; Total amount of time one complete day and night circle takes to complete ; totalDayTimeInSeconds=1800 ; Increase the speed at which time passes at night by %. The value 50 would result in a 50% reduced amount of night time. The value 0 would result in a 0% reduced amount (normal amount). ; nightTimeSpeedMultiplier=0 [Ward] ; Change false to true to enable this section enabled=false ; The range of wards by meters wardRange=20 [Workbench] ; Change false to true to enable this section enabled=true ; Set the workbench radius in meters workbenchRange=30 ; Sets the workbench attachment (e.g. anvil) radius workbenchAttachmentRange=10 ; Disables the roof and exposure requirement to use a workbench disableRoofCheck=false [Wagon] ; Change false to true to enable this section enabled=false ; Change the base wagon physical mass of the wagon object wagonBaseMass=20 ; This value changes the game physical weight of wagons by +/- more/less from item weight inside. The value 50 would increase the weight by 50% more. The value -100 would remove the entire extra weight. wagonExtraMassFromItems=0 [Inventory] ; Change false to true to enable this section enabled=true ; Player inventory number of rows (inventory is resized up to 6 rows, higher values will add a scrollbar) ; default 4, min 4, max 20 playerInventoryRows=5 ; Wood chest number of columns ; default 5, 5 min, 8 max woodChestColumns=6 ; Wood chest number of rows (more than 4 rows will add a scrollbar) ; default 2, min 2, 10 max woodChestRows=3 ; Personal chest number of columns ; default 3, 3 min, 8 max personalChestColumns=3 ; Personal chest number of rows ; default 2, 2 min, 20 max personalChestRows=2 ; Iron chests already have 8 columns by default but now you can lower it ; default 8, min 6, max 8 ironChestColumns=8 ; Iron chest number of rows (more than 4 rows will add a scrollbar) ; default 3, min 3, max 20 ironChestRows=5 ; Cart (Wagon) inventory number of columns ; default 8, min 6, max 8 cartInventoryColumns=8 ; Cart (Wagon) inventory number of rows (more than 4 rows will add a scrollbar) ; default 3, min 3, max 30 cartInventoryRows=3 ; Karve (small boat) inventory number of columns ; default 2, min 2, max 8 karveInventoryColumns=4 ; Karve (small boat) inventory number of rows (more than 4 rows will add a scrollbar) ; default 2, min 2, max 30 karveInventoryRows=2 ; Longboat (large boat) inventory number of columns ; default 8, min 6, max 8 longboatInventoryColumns=8 ; Longboat (large boat) inventory number of rows (more than 4 rows will add a scrollbar) ; default 3, min 3, max 30 longboatInventoryRows=6 ; By default tools and weapons go into inventories top to bottom and other materials bottom to top. Set to true to make all items go into the inventory top to bottom. inventoryFillTopToBottom=false [FreePlacementRotation] ; Change false to true to enable this section, if you set this to false the mode will not be accesible enabled=false ; Rotates placement marker by 1 degree with keep ability to attach to nearly pieces rotateY=LeftAlt rotateX=C rotateZ=V ; Copy rotation of placement marker from target piece in front of you copyRotationParallel=F ; Set rotation to be perpendicular to piece in front of you copyRotationPerpendicular=G [Shields] ; Change false to true to enable this section, if you set this to false the mode will not be accesible enabled=false ; Increase or decrease the block value on all shields in %. -50 would be 50% less block rating, 50 would be 50% more block rating. blockRating=0 [FirstPerson] ; Change false to true to enable this section enabled=true ; Hotkey to enable First Person hotkey=F10 ; Default Field Of View to use defaultFOV=85.0 ; Hotkey to raise Field Of View raiseFOVHotkey=PageUp ; Hotkey to lower Field Of View lowerFOVHotkey=PageDown [GridAlignment] ; Change false to true to enable this section enabled=true ; Key to enable grid alignment align=LeftAlt ; Key to toggle grid alignment alignToggle=F7 ; Key to change the default alignment changeDefaultAlignment=F6 [CraftFromChest] ; Change false to true tu enable this section enabled=false ; If in a workbench area, uses it as reference point when scanning for chests checkFromWorkbench=true ; Ignore private area check. ignorePrivateAreaCheck=true ; The range of the chest detection (min: 1, max: 50) ; default: 20 range=20 ; Interval in seconds between each nearby chests discovery (min: 1, max: 10) ; default: 3 lookupInterval=3 ```
nxPublic commented 3 years ago

What other mods do you have installed?

fschoenfeldt commented 3 years ago

What other mods do you have installed?

Nothing apart from VH+

nxPublic commented 3 years ago

Does it still happen with 0.9.7?

nxPublic commented 3 years ago

Is related to #603