Jump to content

OnGameExit event


thirteenth

Recommended Posts

Hi.
An Events.OnGameStart event is exist to enter the game, but I can not find the event responsible for exiting the game. 

There is an Events.OnDisconnect event, but for me it does not work - the function added to it is never called. I searched the Internet and found a 2016 post on the forum https://theindiestone.com/forums/index.php?/topic/17846-testing-for-when-the-game-is-running-lua/&tab=comments#comment-220050 which mentions the Event.OnGameExit event, but, as far as I understand, this event does not exist.

 

Now I’m thinking about redefining clicking on the Quit menu item, but this will not give me the full necessary result, since it’s still not clear how to handle closing the game console, ALT + F4 or losing the connection.

 

I probably need to look towards the server side of the mod, but I have run out of ideas where and what to look for. I will be grateful if someone shares their knowledge in this area.

Link to comment
Share on other sites

I apologize for the pause in the reply. I know the OnSave event, but I did not consider it. I'll see if it suits me.

Events.OnDisconnect is called when connecting to the server. If a break occurs at the time of the connection, then it is called. After a successful connection, it is no longer called, as far as I understand.

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...