Open PainedPsyche opened 4 months ago
it is default that you have issues with async code inside a sync system this require sync code other the resource is stopped after call the stopevent is ended and the resource terminated before the async code is fully executed
it is default that you have issues with async code inside a sync system this require sync code other the resource is stopped after call the stopevent is ended and the resource terminated before the async code is fully executed
Changing it to sync code like this:
import alt from 'alt-server';
console.log('resourceStop handler loaded')
alt.on('resourceStop', function() {
console.log('resource stopped');
});
Results in the exact same behavior: the message inside the event is not displayed.
ah yeah sorry i missed some other points sorry strg+C does not shutdown the server, it kills the server to shutdown a server and trigger the stop event you need to use quit strg+c does not show stopping resource xxxx inside console
trigger the stop event you need to use quit strg+c does not show stopping resource xxxx inside console
This is kinda offtopic, but how do you do that? I mean "use quit".
The server does not seem to have an interactive shell. Is there any documentation listing commands you can use on the server and how to actually input them?
@BluePeer resourceStop supports promise, it works on windows, and ctrl+c also should work with it
can also be related: https://github.com/altmp/altv-issues/issues/1863
trigger the stop event you need to use quit strg+c does not show stopping resource xxxx inside console
This is kinda offtopic, but how do you do that? I mean "use quit".
The server does not seem to have an interactive shell. Is there any documentation listing commands you can use on the server and how to actually input them?
https://docs.altv.mp/articles/commandlineargs.html#server-commands quit is also a command and some others
remember we are able to create custom ones https://docs.altv.mp/js/api/alt-server.IServerEvent.html#_altmp_altv_types_alt_server_IServerEvent_consoleCommand if there is no way to enter, then this makes no sense ;)
can also be related: #1863
the strg+c instant exit is since 12 <-> 14 so can be related but it is older then this found. i can't find it currently (idk if that talk is inside a issue or discord)
Description of the problem
When pressing ctrl+C in the server console, it seems like resourceStop event is not emitted.
Reproduction steps
Start the server and then hit Ctrl+C to stop it.
Expected behaviour
Both
resourceStop handler loaded'
andresource stopped
messages will appear in the server console log.Additional context
No response
Operating system
Rocky Linux 9.3 (Blue Onyx)
Version
v16.0.0-dev.389
Crashdump ID
No response
Confirmation of issue's presence