Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement fsnotify watchdog for gamemode .amx file to facilitate hot-reload #12

Closed
Southclaws opened this issue Sep 25, 2017 · 4 comments

Comments

@Southclaws
Copy link
Owner

Southclaws commented Sep 25, 2017

https://github.com/fsnotify/fsnotify

If the gamemode .amx file changes and is not zero bytes, sampctl should issue a gmx command to the server's child process via stdin to restart the server to speed up the development cycle.

@Southclaws Southclaws mentioned this issue Nov 26, 2017
5 tasks
@Southclaws
Copy link
Owner Author

Southclaws commented Dec 21, 2017

I'm thinking this can be done through the package subcommand and be a flag, such as:

sampctl package run --watch which would perform an initial build then run the package while also checking for changes in any .pwn files in the package directory (not including dependencies) and if a pwn file changes, run the build process again and then if it's successful, issue a gmx to the server to restart it.

I'm not sure what to do for output here, the build output is necessary for editor integration (problems panel in vscode) but the server output may also be useful, possibly dump it to a log in the package directory? Or output it to stderr so it's available if needed.

@Southclaws
Copy link
Owner Author

I also need to experiment with signal codes and figure out if there's a signal that does not force the player to re-launch the game due to Server closed connection message.

If that's possible, it would be even faster to restart the server and jump back to testing. I used to do this with SS somehow...

@Southclaws
Copy link
Owner Author

Signal 11 (SIGSEGV) closes the server process without kicking players.

The plan is to issue a gmx command to put all players into Gamemode restarting... mode, then issue SIGSEGV, then restart the server process. That should seamlessly restart the server fast without breaking gamemodes that don't work with gmx and without disconnecting players.

@Southclaws
Copy link
Owner Author

Implemented in 1.6 release.

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

No branches or pull requests

1 participant