ObjectManagerManager / SMAPIDedicatedServerMod

Dedicated (headless) server mod for Stardew Valley, powered by SMAPI. Turns the host into an automated bot.
MIT License
78 stars 17 forks source link

Chat command to force sleep #15

Open KnightSatellite opened 6 months ago

KnightSatellite commented 6 months ago

So been having a bit of problem with the bot refusing to go to sleep and losing a day of work because of this, was thinking maybe there should be a !sleep command in order to force the bot to go to sleep if it misses the 10 pm mark?

ObjectManagerManager commented 6 months ago

I can add something like this, but the root problem is that the bot isn't sleeping. Any idea how to reproduce this bug?

KnightSatellite commented 6 months ago

So it mostly happened when the first slow was filled and the second slot player tried to sleep. I do have an expanded player slot of 8. I even logged on their character and proceeded to confirm that it was only happening to the 2nd slot, first slot forced the bot to sleep.

Chris82111 commented 5 months ago

I have implemented a sleep command and other multiplayer commands in the fork-develop. But give me until Friday to bring the documentation up to date.

KnightSatellite commented 5 months ago

Thanks for this, I know a lot of people will enjoy being able to have more control over things.

evanmcmurdie commented 5 months ago

@KnightSatellite Were you ever able to remedy this issue? Im running into the exact same problem. The serverbot will not sleep so we keep having to restart the server but we are stuck on Day 1 of year 3

Chris82111 commented 5 months ago

Hi @evanmcmurdie the question went to someone else but do you have more information? I used version 1.0.1, started a new game and let the days run until just before the 3rd year. The last days I tested with a 2nd player, the grandpa event worked for me, but I have no achievements (money, community center, ...). What is hanging, can you see the host user's screen, is there a dialog?

evanmcmurdie commented 5 months ago

@Chris82111 from what i can tell the host screen is just straight black and this is coming also right after finishing the community center (idk what would have caused the error)

evanmcmurdie commented 5 months ago

@Chris82111 Using your mod we are still not able to get the host to sleep. It says the host will go to sleep in chat but then he does nothing. Our problem is that we are having the server hosted elsewhere so we cant see the hosts screen at all. The issue does only seem to be present when someone other than the first slot player is active

Chris82111 commented 5 months ago

@evanmcmurdie Here you will find the version that is currently to be merged as a pre-release. I will delete this version as soon as the merge is complete v1.0.2-beta.

evanmcmurdie commented 5 months ago

@Chris82111 We did some testing last night. Basically one person has to join first and sleep through a night and the bot will work. but if two people join before the bot has slept then it breaks and the server must be restarted which voids any progress made.

I tested the 1.0.2-beta this morning and found that the bot is still unable to sleep when two people are connected

evanmcmurdie commented 5 months ago

image

I tell the bot to sleep but if i do it after more than one person is in bed it breaks and requires a restart

evanmcmurdie commented 5 months ago

Note: there are two players sleeping in that image. the bot is the one that is not

KnightSatellite commented 5 months ago

Pretty much this is exactly what happened, if player in slot 1 is not present the game hangs like this. So I guess they managed to replicate it. (I have not tried the beta version)

Chris82111 commented 5 months ago

Thank you all for testing and the description, I need a little time to test it.

Chris82111 commented 5 months ago

Hello everyone, I have a new version that fixes another problem. I hope this solves the problem described. The problem that has been fixed occurs with a long playing time. The host's inventory slowly fills up with items: Fishing rod, gifts, ...etc. The problem is that the host has not yet confirmed the dialog. But until then he does not go to sleep and the whole automation hangs. Now it deletes all deletable items from the inventory and picks up new items.

Chris82111 commented 5 months ago

@evanmcmurdie Here you will find the version that is currently to be merged as a pre-release. I will delete this version as soon as the merge is complete 1.0.2-beta2.

Chris82111 commented 4 months ago

Hello, I assume that the error has been fixed.