I use destroy just like you but not in a headless application, your implementation looks fine to me.
I think that headless applications don’t call destroy in all situations, have you tried to call close on your SimpleApplication class when you want to quit?
@dansion said:
I use destroy just like you but not in a headless application, your implementation looks fine to me.
I think that headless applications don't call destroy in all situations, have you tried to call close on your SimpleApplication class when you want to quit?
Handeling a regular shutdown is not an issue. I hoped that the @destory function would act as a fall back for unexpected shutdown, like CONTROL+C on the server.
@zzuegg Handeling a regular shutdown is not an issue. I hoped that the @destory function would act as a fall back for unexpected shutdown, like CONTROL+C on the server.
Then I don't know if there are any JMonkey solutions but there are java alternatives,and I suggest you study those, I don't use them myself so no examples :P : how-to-capture-system-exit-event java signalhandling
I posted on another thread how to use a simple command loop instead of running a JME headless app on the server. Between that and a shutdown hook you could catch most cases.
You don’t really get any benefit from a JME SimpleApplication on the server and so I don’t really see the point of going that route.
@pspeed said:
You don't really get any benefit from a JME SimpleApplication on the server and so I don't really see the point of going that route.
Depends on how your server is set up. E.g. MonkeyZone basically mirrors everything happening on clients and server and all of that happens in AppStates, so why would I not use the existing infrastructure when I need an update loop and some jME API anyway.
@pspeed said:
I posted on another thread how to use a simple command loop instead of running a JME headless app on the server. Between that and a shutdown hook you could catch most cases.
That is true, i use the command loop also for the passive server.
In this case, the server should also simulate the physics for which i need the SimpleApp. I want all actions to be executed on the server side. The client only shows the visual representation and manages the playerinput.