ZZ-Cat / raildriver

Smart Locomotive Controller script for Garry's Mod Train Build Servers.
GNU Affero General Public License v3.0
2 stars 0 forks source link

E-Stop RailDriver on Player Disconnect #41

Closed ZZ-Cat closed 1 year ago

ZZ-Cat commented 1 year ago

Just a quick minder here for something that I want to test to see if it is actually viable to put into both RailDriver & RailDriver-LTS.

What I want to have happen here is, when the driver of the locomotive suddenly disconnects from the server that thar playing in, RailDriver instantly freezes the entire train & shuts itself down.

This will be a little different from the regular way that RailDriver freezes the train, during a normal E-Stop. What I want to try out here is the entire train's physics & collision models are disabled as the train is frozen in place. Therefore, if anyone else is running trains on the server, they won't collide with an unpiloted RailDriver train.

I am told this is not possible, due to Expression2 going dormant when the player disconnects. However, there is a way to detect when the player actually disconnects & reconnects with the server.

With that being said, that is what I want to test & I will use the player disconnecting to freeze the train, & then use the player reconnecting to unfreeze the train.

If this test is successful, I will add this as a must have feature for both RailDriver & RailDriver-LTS. Because, currently, the train can easily carry on fully unpiloted on its own with no way for anyone other than the (now disconnected) driver to intervene.