Author Topic: client side mods not working when enabled on dedicated server  (Read 115 times)

brunobf

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
Hello all,

I'm trying to run a dedicated server which is enabling both server and client side mods. For reference, here's a copy of my modconfig.lua:
Code: [Select]
modLocation = ""
forceEnabling = false
 
-- Docs: https://avorion.gamepedia.com/Using_Mods_on_Dedicated_Servers
 
mods =
{
    {workshopid = "1731575231"},  -- Auto Research By: Rinart73
    {workshopid = "1722652757"},  -- AzimuthLib - Library for modders By: Rinart73
    {workshopid = "1722261398"},  -- Compass-like Gate Pixel Icons By: Rinart73
    {workshopid = "1756645965"},  -- Crewboard Tweaks By: Rinart73
    {workshopid = "1765619430"},  -- Galaxy Map QoL By: Rinart73
    {workshopid = "1734791653"},  -- Gate Founder By: Rinart73
    {workshopid = "1723188393"},  -- Improved Energy Suppressor By: Rinart73
    {workshopid = "1728695059"},  -- NPC Respawn By: Rinart73
    {workshopid = "1769379152"},  -- Resource Display By: Rinart73
    {workshopid = "1722256729"},  -- Sector Overview By: Rinart73
    {workshopid = "1776283892"},  -- Trading Overview Fixes By: Rinart73
    {workshopid = "1754114031"},  -- Trading Tweaks By: Rinart73
    {workshopid = "1722263986"},  -- Transfer Cargo Tweaks By: Rinart73
    {workshopid = "1691591293"},  -- claim.lua claim() hook By: Laserzwei
    {workshopid = "1695671502"},  -- Laserzwei's Advanced Shipyard By: Laserzwei
    {workshopid = "1691539727"},  -- Laserzwei's Move Asteroids By: Laserzwei
    {workshopid = "1694550170"},  -- Laserzwei's Sector Manager By: Laserzwei
    {workshopid = "1692998037"},  -- Laserzwei's simple asteroid respawn mod By: Laserzwei
    {workshopid = "1745027189"},  -- Sell Asteroid - Extended By: Finite
    {workshopid = "1746985221"},  -- IFTL Library [Current v1.3] By: IFoundTheLight
    {workshopid = "1747690472"},  -- IFTL Loot Display [Current v1.3] By: IFoundTheLight
    {workshopid = "1746985158"},  -- IFTL Player Gate [Current v1.3] By: IFoundTheLight
    {workshopid = "1751636748"},  -- Detailed Turret Tooltips By: MassCraxx
    {workshopid = "1751540023"},  -- Fleet Jump through Gate Command By: MassCraxx
    {workshopid = "1751798934"},  -- System Scanner Upgrade By: MassCraxx
}
 
-- these are allowed mods, that can run on the client only (ie. UI mods)
allowed =
{
}

On the server, I don't see any issues, and the console doesn't produce any errors or warnings.

When I try to connect a client to the server though, I see the following issues:
Code: [Select]
Warning: Couldn't add script from stream: 12ClientPlayer: Script 'H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua' not found. Tried the following paths:
data/scripts/player/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
data/scripts/player/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua.lua
data/scripts/playerH:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
data/scripts/playerH:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua.lua
data/scripts/quest/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
data/scripts/quest/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua.lua
data/scripts/questH:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
data/scripts/questH:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua.lua
H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua.lua
data/scripts/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
data/scripts/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua.lua
data/scriptsH:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
data/scriptsH:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua.lua

Modders: Make sure to enable Dev-Mode while writing scripts, or files you created while the game was already running might get ignored.
Warning: Couldn't add script from stream: 12ClientPlayer: Script 'H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1694550170\data/scripts/player/sectorOpener.lua' not found. Tried the following paths:
data/scripts/player/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1694550170\data/scripts/player/sectorOpener.lua
<...snip....>
data/scriptsH:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1694550170\data/scripts/player/sectorOpener.lua.lua

Modders: Make sure to enable Dev-Mode while writing scripts, or files you created while the game was already running might get ignored.
Warning: Couldn't add script from stream: 12ClientPlayer: Script 'H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1734791653\data/scripts/player/gatefounder.lua' not found. Tried the following paths:
<...snip....>

Modders: Make sure to enable Dev-Mode while writing scripts, or files you created while the game was already running might get ignored.
Warning: Couldn't add script from stream: 12ClientPlayer: Script 'H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1765619430\data/scripts/player/map/galaxymapqol.lua' not found. Tried the following paths:
<...snip....>

Modders: Make sure to enable Dev-Mode while writing scripts, or files you created while the game was already running might get ignored.
<Server> Player BBFz0r joined the galaxy
Player BBFz0r joined the galaxy
Warning: Couldn't add script from stream: 12ClientPlayer: Script 'H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua' not found. Tried the following paths:
data/scripts/player/H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua
<...snip....>

The server is being spawned with the following command:
Code: [Select]
bin\AvorionServer.exe --galaxy-name GalaxyModSeason --seed ModSeason234 --datapath H:/Games/Avorion --admin <...snip...> --collision-damage 0.25 --use-steam-networking 1 -t all

So the save for the galaxy is located at:
H:\Games\Avorion\GalaxyModSeason

And  the location that is being used for the workshop mods is:
H:\Games\Avorion\GalaxyModSeason\workshop\content\445220

Somehow, that absolute server path is being sent to the client side, and being expanded by package.path.
Am I'm missing something in my configuration, or is this a bug?






brunobf

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
By the way, I noticed that there is some log corruption happening on the server. It seems like calls to the logger are not thread safe.

Example:
Code: [Select]
Call to 'sectorOpener.initialize' in '"H:\GameFilesecurer destination content size: s\A649274vor
ion\GalaxyModSeason\workshop\content\445220\1694550170\data/scripts/player/sectorOpener.lua"' successful.
I think this is supposed to be:
Code: [Select]
Filesecurer destination content size: 649274
Call to 'sectorOpener.initialize' in '"H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1694550170\data/scripts/player/sectorOpener.lua"' successful.



koonschi

  • Developer
  • *
  • Status:
    Offline
    Posts:
    1605
    • View Profile
    • Avorion
For some reason the server is sending script information to the connecting clients with full paths, instead of relative paths. Did you add scripts manually at some point and use the full path (H:\Games\Avorion\GalaxyModSeason\workshop\content\445220\1722652757\data/scripts/player/azimuthlib-clientdata.lua) instead of a relative path (data/scripts/player/azimuthlib-clientdata.lua)?
#define TRUE FALSE // happy debugging suckers

If you need help, please post in the forum, don't PM me. If there's something that only I can help you with, contact me via mail.



koonschi

  • Developer
  • *
  • Status:
    Offline
    Posts:
    1605
    • View Profile
    • Avorion
Second question: Is it possible that you've disabled a mod? Does this issue happen only with specific mods or with all mods?
« Last Edit: July 17, 2019, 03:13:45 PM by koonschi »
#define TRUE FALSE // happy debugging suckers

If you need help, please post in the forum, don't PM me. If there's something that only I can help you with, contact me via mail.



koonschi

  • Developer
  • *
  • Status:
    Offline
    Posts:
    1605
    • View Profile
    • Avorion
The issue has been resolved, thanks for the report!
#define TRUE FALSE // happy debugging suckers

If you need help, please post in the forum, don't PM me. If there's something that only I can help you with, contact me via mail.



brunobf

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
Hi koonschi,

Sorry for not noticing your previous requests for more info, I never received any email from the forum that I had replies on this thread.

Although the bug has been fixed, to address your previous questions, I had created a brand new galaxy when providing the reproduction steps.
On the client side I had also unsubscribed from all mods after I noticed the issue, and the issue did not manifest on all mods, only 4 of them.

Anyways, thank you for fixing the bug. Is the fix coming out on the 0.23.x stable branch, or only eventually on 0.24.x?



koonschi

  • Developer
  • *
  • Status:
    Offline
    Posts:
    1605
    • View Profile
    • Avorion
No worries! Thanks for the infos. The fix will be coming to all live branches, including 0.23.*
#define TRUE FALSE // happy debugging suckers

If you need help, please post in the forum, don't PM me. If there's something that only I can help you with, contact me via mail.



brunobf

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
So I noticed the new manifests in the Steam depots, and decided to try out the new build in hopes the fixes were included. And apparently they were :)

Unfortunately though, once I did  that the server begun crashing. Initially I thought I would get away by just disabling the offending mods, which did not work. I noticed the logs had references even to the disabled mods. So I renamed the workshop download folders, and that made some difference, but not enough to fix it.

Since lua scripts are attached to game objects/entities, and they contain absolute paths, the server is very unhappy with it's current state on this new build. Are there any asserts() for invalid state? Player profiles are not being loaded correctly, and blank ones are been attached to existing players. It's not a happy sight.

I had to rollback the galaxy save to before updating, and then manually download the previous depots to keep players on the server playing while something can be done.

At this point I'm considering if I should write a mod that removes scripts from the entities when it detects absolute paths on them, and even if that will be enough to prevent the latest crashes. I'm attaching the logs from the crashes in case anyone has a better idea on how to fix the state in the saves.

Thanks