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

[BUG]Not detecting Workshop Updates #133

Closed TraceIronworks closed 3 weeks ago

TraceIronworks commented 1 month ago

Describe the bug I'm paying for a PingPerfect server that uses your bot. I followed your setup and all the commands and timed restarts work except the "workshop update detection" What it does after an update is found might work but mine has never found an update to follow through on. To Reproduce Have any mod I'm using get an update from the steam workshop.

Expected behavior When a mod update is found, trigger xTime countdown warning messages to server > Shutdown > Update > Restart

Additional context I've now started to use the provided update script from the PingPerfect webconsole to check for updates every 15 minutes but I'm not allowed to edit their script so far as I know and my players are getting booted without warning any time the host script detects an update.

egebilecen commented 1 month ago

Hey. Can you share your log file? I suspect Steam blocks the requests from your server. Log file should have some log about it if that's the case.

TraceIronworks commented 1 month ago

pzbot.log Thanks for the Reply! For context, I rent a server from PingPerfect.com who uses your bot in their mods selection on its web console. This is the only related log file I could find on the box.

egebilecen commented 1 month ago

Thank you for the log. It seems the problem is that the default server path is different. The default path is %USERPROFILE%\Zomboid\Server\, however, in your case it is different. Do you have means to locate the server's folder? This said folder should contain files like in the below: image Which is basically in format of <server name>.ini, <server name>_spawnpoints.lua, etc. If you can locate this folder, can you give me its path? We actually have code to detect custom path, which is set in server.bat. If you have access to this file, could you share it as well? I don't recall if that file contained any sensitive information so be sure to censor it if that's the case. Thank you!

TraceIronworks commented 1 month ago

PPFolders PPWC Sadly PingPerfect wont let me modify or access the server.bat file, they have a script that runs the install of your bot and its all out of my hands. All I can see from the FTP or the web console they provide is my IPAddress/Zomboid/Server/servertest.ini ect

TraceIronworks commented 1 month ago

I guess at best I could pass them along any idea you might have to fix/update their script on the bot installer?

egebilecen commented 1 month ago

It seems like they are using a custom path. I am not sure if there is a way to set it other than server.bat. If you could ask them in which folder the server files are located, I can try to update the bot.

TraceIronworks commented 1 month ago

My ticket has be moved up a level of support... so maybe I can get more info next week lol.

TraceIronworks commented 1 month ago

Host got back to me with this info:

You can contact the bot's creator with the following information. Full commandline for the customer server is:

cd /d D:\Pingperfect\Users\CUSTOMER\8430573\ PZServerDiscordBot.exe -Duser.home=D:\Pingperfect\Users\CUSTOMER\8430573\ -Djava.awt.headless=true -Dzomboid.steam=1 -Dzomboid.znetlog=1 -XX:+UseZGC -XX:-CreateCoredumpOnCrash -XX:-OmitStackTraceInFastThrow -Xms1024m -Xmx20480m -Djava.library.path=D:\Pingperfect\Users\CUSTOMER\8430573\natives/;D:\Pingperfect\Users\CUSTOMER\8430573\natives/win64/;. -cp java/istack-commons-runtime.jar;java/jassimp.jar;java/javacord-2.0.17-shaded.jar;java/javax.activation-api.jar;java/jaxb-api.jar;java/jaxb-runtime.jar;java/lwjgl.jar;java/lwjgl-natives-windows.jar;java/lwjgl-glfw.jar;java/lwjgl-glfw-natives-windows.jar;java/lwjgl-jemalloc.jar;java/lwjgl-jemalloc-natives-windows.jar;java/lwjgl-opengl.jar;java/lwjgl-opengl-natives-windows.jar;java/lwjgl_util.jar;java/sqlite-jdbc-3.27.2.1.jar;java/trove-3.0.3.jar;java/uncommons-maths-1.2.3.jar;java/commons-compress-1.18.jar;java/ zombie.network.GameServer -statistic 0 -adminpassword "test"

Hope this helps?

egebilecen commented 4 weeks ago

I have released the new version which should fix this. Please let me know if the problem persists.

TraceIronworks commented 4 weeks ago

That's great news, thanks so much for helping me with this issue! I'm just waiting on them to update their link so the server grabs the new version.

TraceIronworks commented 4 weeks ago

Ok, an update!

After the host and I tried a few times this was the outcome on our end.

"Hi Wesley,

I've double checked the hashes of the file installed to your server, aswell as what I've installed from the github, they are the same, so it's the same file from the official release. Checking the source code though, even the version is set correctly, and all the messages pull from where it's been set. This is done from the main .exe, so it has to be the released build didn't have the version change. I would try contacting the developer and let him know. If he says that isn't the case, we will definitely look into it, but that is my current resolution based on what I've tested and seen."

egebilecen commented 4 weeks ago

After the host and I tried a few times this was the outcome on our end.

Sorry, I didn't understand. What did you try? What do you mean is that the problem is not fixed or something else?

I've double checked the hashes of the file installed to your server, aswell as what I've installed from the github, they are the same, so it's the same file from the official release. Checking the source code though, even the version is set correctly, and all the messages pull from where it's been set. This is done from the main .exe, so it has to be the released build didn't have the version change. I would try contacting the developer and let him know. If he says that isn't the case, we will definitely look into it, but that is my current resolution based on what I've tested and seen."

Again, I didn't understand what this reply about. Could you be more elaborate?

Edit: It might be better for you to include your message that you sent to them and then their reply. At the moment I am not sure what this reply about as the context is lacking.

TraceIronworks commented 4 weeks ago

I'm sorry I was up very late.

When I installed the new version (through their script) and the bot boots with the server its still posting as version 1.11.1 along with the note to update botupdate bot

So I messaged my host to be sure the new repo was being pulled and it started a few hours of back and forth through a ticket system with them. I didnt feel like your edit was being posted to my server but the host told me they did a manual install for me to be sure. They thought that maybe the update version number wasnt changed with the latest version.

I felt like they're not updating the bot properly but wanted to just double check with you that once the latest is installed the bot Will boot with a 1.11.2 notification so I can be sure.

TraceIronworks commented 4 weeks ago

What worries me is that when I "uninstall" uninst from their web console, its NOT removing things like server.bat or the old install files or my token text file..

I'm really sorry to bother you with a project you were finished with. PingPerfect feels like they dont host many Zomboid servers and I'm pulling teeth to get things working through them. Thanks again for trying to help me at all.

egebilecen commented 4 weeks ago

Whoops! It seems I accidentally uploaded the old version. facepalms Thank you for the heads up! I updated the zip file and tested it to be sure it is v1.11.2. image

Apologies for the inconvenience!

egebilecen commented 4 weeks ago

When I installed the new version (through their script) and the bot boots with the server its still posting as version 1.11.1

Could you try again to see if it's correctly updating now?

I'm really sorry to bother you with a project you were finished with.

Its not a problem. I intend to maintain the bot as much as I can.

TraceIronworks commented 4 weeks ago

Thanks so much for the fast update! Ill reset mine now (as much as I can through this web portal lol)

TraceIronworks commented 4 weeks ago

I'm not getting the update, I'll need the host to pull the latest for me. Its so frustrating to be out of reach of a host Im renting vs what I'm used to at home that I can quickly access. I'll updated you as soon as I get notification from the host they have the latest.

egebilecen commented 4 weeks ago

I'll updated you as soon as I get notification from the host they have the latest.

Thank you!

TraceIronworks commented 3 weeks ago

They did it!! It took them 4 hours to tell me they dont know where to find the new exe file.... so I gave them the direct link to your git... Then another 4.5 hours to install it after that. I really feel like this was all a "How many host service reps does it take to screw in a lightbulb joke" but its fixed and working. I cant thank you enough for all the help while I was pulling my hair out with these folks but they got there in the end! updatefound

TraceIronworks commented 3 weeks ago

Finding updates, giving countdown, restarting server but not grabbing the update. I've you've read any of my updated then deleted messages sorry, I was testing everything I can on my side. Anything you think I should try?

egebilecen commented 3 weeks ago

They did it!! It took them 4 hours to tell me they dont know where to find the new exe file.... so I gave them the direct link to your git... Then another 4.5 hours to install it after that. I really feel like this was all a "How many host service reps does it take to screw in a lightbulb joke" but its fixed and working. I cant thank you enough for all the help while I was pulling my hair out with these folks but they got there in the end!

Hey, I am glad it's fixed and working! Thank you for helping me find the problem as well.

Finding updates, giving countdown, restarting server but not grabbing the update. I've you've read any of my updated then deleted messages sorry, I was testing everything I can on my side. Anything you think I should try?

So, what this bot does is basically restarting the server, which should make the official Project Zomboid server pull the updates. It's something totally independent from this bot so I can't really comment why its not grabbing the update. Maybe it is having some trouble to connect to Steam? (I am closing this issue as the original problem is fixed. Feel free to continue commenting though. I will hopefully get emails from GitHub about comments)