Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Duplicating portal on dedicated servers when going to destroy there are 2 #27

Open
3 of 4 tasks
DrPine opened this issue Oct 17, 2022 · 5 comments
Open
3 of 4 tasks
Assignees

Comments

@DrPine
Copy link

DrPine commented Oct 17, 2022

Issue Description

Describe the bug
When destroying a portal with this mod I get double the resources back

To Reproduce
Steps to reproduce the behavior:

  1. Build a portal with your hammer
  2. Destroy the portal with your hammer - Destroy the second portal? Why?
  3. You now have duplicated the resources for the portal since it only costs the initial 1 portal to build, this should be fixed

Expected behavior
Build a portal, destroy the portal with a hammer, not have a second portal still sitting there.

Additional context
Could be solved by making the portal cost twice the amount of resources in the first place, hopefully this wouldn't then give double the resources back again. Not sure if this is how everyone experiences it or if it's just a bug for me.

Screenshots
Not really applicable for this

Game version and environment

Game client version (found in the bottom right of the Valheim main menu
v 0.211.9

After reproducing the issue, please attach the BepInEx game log from Valheim/BepInEx/LogOutput.log

Does the issue occur in single-player or multiplayer? You can also check "Both" if you've reproduced the issue in both game modes

  • [] Single-player works fine
  • Multiplayer - Happens on any hosted server I have tried 3 different computer setups - Installed AnyPortal 2.0 each time
  • [] Both

If the issue occurs in multiplayer, is the server a "local" server started through the in-game menu, or is it a headless server (like installing the "Valheim Dedicated Server" in Steam or using a server hosting service)

  • [] N/A
  • [] In-game server
  • Headless server

If you are using a headless server, please reproduce the issue and then attach the BepInEx game log from ValheimServer/BepInEx/LogOutput.log

If you are using a headless server, is it being hosted on a Windows machine or a Linux machine?

  • Windows
  • Linux
@DrPine
Copy link
Author

DrPine commented Oct 19, 2022

Here is my LogOutput.log from the Server that I accidentally forgot to include:

[Info   :   BepInEx] Running under Unity v2020.3.33.9525882
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.19.0]
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 5 plugins to load
[Info   :   BepInEx] Loading [Show Container Contents 0.3.0]
[Info   :   BepInEx] Loading [Jotunn 2.7.9]
[Info   :    Jotunn] Initializing LocalizationManager
[Info   :    Jotunn] Initializing CommandManager
[Info   :    Jotunn] Initializing InputManager
[Info   :    Jotunn] Initializing SkillManager
[Info   :    Jotunn] Initializing PrefabManager
[Info   :    Jotunn] Initializing ItemManager
[Info   :    Jotunn] Initializing PieceManager
[Info   :    Jotunn] Initializing CreatureManager
[Info   :    Jotunn] Initializing ZoneManager
[Info   :    Jotunn] Initializing MockManager
[Info   :    Jotunn] Initializing KitbashManager
[Info   :    Jotunn] Initializing GUIManager
[Info   :    Jotunn] Initializing KeyHintManager
[Info   :    Jotunn] Initializing NetworkManager
[Info   :    Jotunn] Initializing SynchronizationManager
[Info   :    Jotunn] Initializing RenderManager
[Info   :    Jotunn] Initializing MinimapManager
[Info   :    Jotunn] Initializing UndoManager
[Info   :    Jotunn] Jötunn v2.7.9 loaded successfully
[Info   :   BepInEx] Loading [MultiUserChest 0.2.4]
[Info   :   BepInEx] Loading [AnyPortal 2.0.0]
[Info   :   BepInEx] Loading [More Gates 1.0.10]
[Message:   BepInEx] Chainloader startup complete
[Info   : Unity Log] 10/19/2022 03:16:42: Starting to load scene:start

[Warning: Unity Log] HDR Render Texture not supported, disabling HDR on reflection probe.
[Warning: Unity Log] HDR Render Texture not supported, disabling HDR on reflection probe.
[Warning: Unity Log] Only custom filters can be played. Please add a custom filter or an audioclip to the audiosource (Amb_MainMenu).
[Warning: Unity Log] HDR Render Texture not supported, disabling HDR on reflection probe.
[Info   : Unity Log] 10/19/2022 03:16:50: Setting -savedir to: E:\XboxGames\Valheim\Content\Server\Saves\

[Info   : Unity Log] 10/19/2022 03:16:50: Get create world DrPine

[Info   : Unity Log] 10/19/2022 03:16:50: Using default prefs

[Info   : Unity Log] 10/19/2022 03:16:50: Valheim version:0.211.9

[Info   :Jotunn.Managers.CommandManager] Adding 1 commands to the Console
[Info   : Unity Log] 10/19/2022 03:16:50: Render threading mode:SingleThreaded

[Warning: Unity Log] 10/19/2022 03:16:50: Missing audio clip in music respawn

[Info   : Unity Log] 10/19/2022 03:16:51: Loaded localization CSV:localization language:English

[Info   : Unity Log] 10/19/2022 03:16:51: Loaded localization CSV:localization_extra language:English

[Info   : Unity Log] 10/19/2022 03:16:51: Loaded localization CSV:localization language:English

[Info   : Unity Log] 10/19/2022 03:16:51: Loaded localization CSV:localization_extra language:English

[Info   :Jotunn.Managers.LocalizationManager] Loading custom localizations
[Info   : Unity Log] 10/19/2022 03:16:52: Loaded localization CSV:localization language:English

[Info   : Unity Log] 10/19/2022 03:16:52: Loaded localization CSV:localization_extra language:English

[Info   :Jotunn.Managers.LocalizationManager] Adding tokens for language 'English'
[Info   : Unity Log] The shader Hidden/Dof/DepthOfFieldHdr (UnityEngine.Shader) on effect Main Camera (UnityStandardAssets.ImageEffects.DepthOfField) is not supported on this platform!
[Warning: Unity Log] The image effect Main Camera (UnityStandardAssets.ImageEffects.DepthOfField) has been disabled as it's not supported on the current platform.
[Info   : Unity Log] The shader Hidden/SunShaftsComposite (UnityEngine.Shader) on effect Main Camera (UnityStandardAssets.ImageEffects.SunShafts) is not supported on this platform!
[Info   : Unity Log] The shader Hidden/SimpleClear (UnityEngine.Shader) on effect Main Camera (UnityStandardAssets.ImageEffects.SunShafts) is not supported on this platform!
[Warning: Unity Log] The image effect Main Camera (UnityStandardAssets.ImageEffects.SunShafts) has been disabled as it's not supported on the current platform.
[Info   : Unity Log] 10/19/2022 03:16:52: UI Group status changed Menu = True

[Warning: Unity Log] HDR Render Texture not supported, disabling HDR on reflection probe.
[Warning: Unity Log] HDR Render Texture not supported, disabling HDR on reflection probe.
[Info   : Unity Log] 10/19/2022 03:16:52: Using default prefs

[Info   :Jotunn.Managers.CommandManager] Adding 1 commands to the Console
[Info   : Unity Log] 10/19/2022 03:16:52: isModded: True

[Info   : Unity Log] 10/19/2022 03:16:52: Zonesystem Awake 239

[Info   : Unity Log] 10/19/2022 03:16:52: DungeonDB Awake 239

[Info   : Unity Log] 10/19/2022 03:16:53: PlayFab custom ID set to "PlayFab_DrPine_76d64bbe021fbc727753260b68422da66a88b2cb"

[Info   :Jotunn.Managers.PrefabManager] Adding 41 custom prefabs to the ZNetScene
[Info   :Jotunn.Managers.PieceManager] Adding 41 custom pieces to the PieceTables
[Info   : Unity Log] 10/19/2022 03:16:58: Audioman already exist, destroying self

[Info   : Unity Log] 10/19/2022 03:16:58: PlayFab logged in as "PlayFab_DrPine_76d64bbe021fbc727753260b68422da66a88b2cb"

[Info   : Unity Log] 10/19/2022 03:16:58: PlayFab local entity ID is B4087CD732ED4BD2

[Info   : Unity Log] 10/19/2022 03:16:58: New session server "DrPine" that has join code , now 0 player(s)

[Info   : Unity Log] 10/19/2022 03:16:58: Register PlayFab server "DrPine" with IP 73.109.159.243:2456

[Info   : Unity Log] 10/19/2022 03:16:58: Server 'DrPine' begin PlayFab create and join network for server 

[Info   :Jotunn.Managers.NetworkManager] Registering 2 custom RPCs
[Info   : Unity Log] 10/19/2022 03:17:04: Zonesystem Start 239

[Info   : Unity Log] 10/19/2022 03:17:04: Added 3 locations, 0 vegetations, 0 environments, 0 biome env-setups from locations_cp1

[Info   : Unity Log] 10/19/2022 03:17:04: Added 1 locations, 0 vegetations, 1 environments, 0 biome env-setups from locations_mountaincaves

[Info   : Unity Log] 10/19/2022 03:17:05: DungeonDB Start 239

[Info   : Unity Log] 10/19/2022 03:17:05: Load world: DrPine (DrPine)

[Info   : Unity Log] 10/19/2022 03:17:05: Loading 105637 zdos , my id 4035999163 data version:28

[Info   : Unity Log] 10/19/2022 03:17:06: Loaded 100000 dead zdos

[Info   : Unity Log] 10/19/2022 03:17:06: Removed 0 OLD generated ZDOS

[Info   : Unity Log] 10/19/2022 03:17:06: Loaded 7477 locations

[Info   : Unity Log] The shader Hidden/SunShaftsComposite (UnityEngine.Shader) on effect Main Camera (UnityStandardAssets.ImageEffects.SunShafts) is not supported on this platform!
[Info   : Unity Log] The shader Hidden/SimpleClear (UnityEngine.Shader) on effect Main Camera (UnityStandardAssets.ImageEffects.SunShafts) is not supported on this platform!
[Warning: Unity Log] The image effect Main Camera (UnityStandardAssets.ImageEffects.SunShafts) has been disabled as it's not supported on the current platform.
[Info   : Unity Log] 10/19/2022 03:17:08: Joined PlayFab Party network with ID "8ceb467f-e6ab-4a04-add6-bd54f1499985|AwBxUzlve+hYuFDjG06OdJLxAHisZkNlbnRyYWxVcwAAAAAAAAAAAAAAGnpkEL9Xa34rfnIgJk1n6olEkKykili28X3MawG4mvIpb0lkbnM4MWU1LWY5NDU4YWI5LTc5NGUtNGUzYi04ZGRiLTcyMDBjNmIxMWJhOC5jZW50cmFsdXMuY2xvdWRhcHAuYXp1cmUuY29t"

[Info   : Unity Log] 10/19/2022 03:17:08: Created PlayFab lobby with ID "d5227888-505c-48b3-8cbb-7917b25792b9", ConnectionString "cv1:d5227888-505c-48b3-8cbb-7917b25792b9|451107|kv1|cv1:GFUxn1EXrOUWDmU4dFk8WMBNFLUzf9ATPWemQ4faKQ4=" and owned by "B4087CD732ED4BD2"

[Info   : Unity Log] 10/19/2022 03:17:08: Session "DrPine" registered with join code 397508

[Info   : Unity Log] 10/19/2022 03:17:08: Retry join-code check 99

[Info   : Unity Log] 10/19/2022 03:17:09: Session "DrPine" with join code 397508 and IP 73.109.159.243:2456 is active with 0 player(s)

[Info   : Unity Log] 10/19/2022 03:19:58: PlayFab listen socket child connected to remote player B9339A5DE2E28FDF

[Info   : Unity Log] 10/19/2022 03:19:58: Player joined server "DrPine" that has join code 397508, now 1 player(s)

[Info   : Unity Log] 10/19/2022 03:19:58: Muted PlayFab remote player B9339A5DE2E28FDF

[Info   : Unity Log] 10/19/2022 03:19:58: PlayFab socket with remote ID playfab/B9339A5DE2E28FDF received local Platform ID Xbox_2533274817645690

[Info   : Unity Log] 10/19/2022 03:19:58: Got handshake from client playfab/B9339A5DE2E28FDF

[Info   : Unity Log] 10/19/2022 03:20:01: VERSION check their:0.211.9  mine:0.211.9

[Info   : Unity Log] 10/19/2022 03:20:01: Server: New peer connected,sending global keys

[Info   :Jotunn.Managers.SynchronizationManager+<>c__DisplayClass25_0+<<ZNet_RPC_Post_PeerInfo>g__SynchronizeInitialData|0>d] Sending initial data to peer #2965447355
[Info   : Unity Log] 10/19/2022 03:20:31: Got character ZDOID from Drpine : 2965447355:1```

@sweetgiorni
Copy link
Owner

Are you able to reproduce this issue with all other mods removed? AnyPortal doesn't make any changes to how portals are built/destroyed, resources used, etc., so this would be an unusual bug. I'm inclined to blame another mod if I have the option :)

@DrPine
Copy link
Author

DrPine commented Oct 19, 2022

You had the option, until I just completed the below testing which proves that it is this mod's fault 100%. These are the detailed steps I just took to reproduce. You can see that it works fine up until deploying the world to a dedicated server.

Using BepInEx: https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/

  1. Disabled All Mods on Client
  2. Deployed AnyPortal v2.0.0 on Client: https://www.nexusmods.com/valheim/mods/170
  3. Deployed Jotunn the Valheim Library - Jotunn v2.7.9 on Client: https://www.nexusmods.com/valheim/mods/1138
  4. Created Character named Test
  5. Selected Start
  6. Created New Seed, jgrGDCdxjC, named Testing
  7. Selected Start
  8. Waited through game intro and landed at spawn point
  9. Logged out
  10. Logged in with character that has the necessary resources
  11. Created a chest and placed the resources in said chest, 2 Surtling cores, 20 Fne wood, 10 Greydwarf eyes
  12. Logged out
  13. Logged in with Test character
  14. Picked up materials from chest
  15. Built portal
  16. Destroyed portal - Works as intended
  17. Logged out
  18. Configuring Dedicated Server batch file to use this world, this is where the bug seems to occur
  19. ValheimServer.exe -nographics -batchmode -name "DrPine" -port 2456 -world "Testing" -password "testing" -savedir "C:\Users\Nick\AppData\LocalLow\IronGate\Valheim\" -public 1
  20. Installed BepInEx to the Server in Program Files: https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/
  21. Deployed AnyPortal v2.0.0 to the Server: https://www.nexusmods.com/valheim/mods/170
  22. Deployed Jotunn the Valheim Library - Jotunn v2.7.9 to the Server: https://www.nexusmods.com/valheim/mods/1138
  23. Started "StartHeadlessServer - Testing.bat"
  24. Jumped back into Valheim I selected my Test character
  25. Selected Start
  26. Selected Join Game
  27. Selected Add Server then entered the join code from the Server terminal
  28. Selected Connect
  29. Entered password "testing"
  30. Build portal with existing resources and workbench
  31. Destroy Portal
  32. Proof that the bug is from this mod at long last, the portal is still standing

*** Further details that might lead to a fix
33. Destroy Portal - Receive duplicated resources
34. Build 2 portals now since we have the resources
35. Name one portal A and the other B
36. Set portal A to teleport to portal B
37. Destroy portal A - Works as intended no extra portal
38. Create portal again, name portal A
39. Destroy portal A - Bug exists portal still sitting there
40. Instead of destroying again, change this duplicated portal destination to B
41. While doing this the portal disappears
42. Place portal down again, name it A, set destination to B, delete portal, duplicate portal still exists
43. Change duplicated portal's destination from B to No destination and the duplicated portal poofs and is gone

** I hope with all my testing you can solve this bug. This mod is quite amazing, but this is definitely due to this mod alone.

@DrPine
Copy link
Author

DrPine commented Oct 25, 2022

Suggestion, you could try having your mod change the destination of the portal upon deletion. That way it disappears automatically as it did in my testing when I did that step manually. If you could make any changes to this, I would be happy to test it for you. The logic would have to check the portals current destination and if set to No destination it would have to set to something else

@Golkiwu
Copy link

Golkiwu commented Feb 3, 2023

This has been happening on our dedicated server as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants