egebilecen / PZServerDiscordBot

A Project Zomboid Discord Bot written in C# using Discord.NET to manage and execute commands on Project Zomboid Server.
GNU General Public License v3.0
61 stars 11 forks source link

Possible issue with adding workshop mods #96

Closed Recon224 closed 7 months ago

Recon224 commented 10 months ago

Hi, I have been using your bot for over a month now and have had a great experience so far. However, I'm not sure if it is working as intended or not but when I updated the other day to v1.10 and attempted to add a workshop mod from the discord command line, the servertest.ini lines for ModID= and WorkshopID= were completely erased and replaced with the one workshop item that was being added through the command.

Therefore, I ended up with "ModID=NameofMod" and "WorkshopID=123456789" (examples only) instead of the bot adding the mod to the end of the 200+ list I had previously. Just wanted to give a heads up in case this isn't working exactly as planned.

egebilecen commented 10 months ago

Thanks for the heads up!

@DomicidalDesigns you might want to check this, otherwise I will need to revert the changes, in worst case. :(

DomicidalDesigns commented 10 months ago

Thanks for reporting this. I am sorry that you lost the other mods in the file. I have many mods too and I imagine that would be very frustrating.

I'll look into this and try to get it fixed.

@Recon224, Do you remember the mod that you tried adding? It'll be helpful to replicate the issue.

Recon224 commented 10 months ago

No problem! Happy to help in any way I can.

Here is the exact command I executed yesterday:

!add_workshop_mod https://steamcommunity.com/sharedfiles/filedetails/?id=2744797858

DomicidalDesigns commented 10 months ago

No problem! Happy to help in any way I can.

Here is the exact command I executed yesterday:

!add_workshop_mod https://steamcommunity.com/sharedfiles/filedetails/?id=2744797858

@Recon224 Thank you. I haven't been able to reproduce the issue at this time, but I am still evaluating.

DomicidalDesigns commented 10 months ago

@Recon224, can you provide the list of mods and workshopitems from the config *.ini file from the backup? It should be under "backups\startup\backup_1.zip\Server\servertest.ini" or similar.

If you don't have any passwords/private info stored in the .ini it would be helpful if you can share the entire file :)

egebilecen commented 10 months ago

@DomicidalDesigns did you test this feature while server was running? Maybe server is opening the config file and doesn't close the handle until the server is stopped. Thus writing to file while it having handle causing issues? I'm just spitballing. Because afaik we wouldn't able to get a handle to a file while they are in use (unless they specified file sharing options which is unlikely for server) so it shouldn't be the case but can't be too careful.

Recon224 commented 10 months ago

I do believe it was executed while the server was running. I will try to get the backup stuff you requested and send it over.

egebilecen commented 7 months ago

I am closing this issue as there have been no update for a long time.