Background: I'm creating a new InSim app for my team and I have a couple of simple questions. I'm using the very handy JInSim Java library.
Question 1: I'm trying to monitor when track changes happen. I'm using the hostXXXX.txt file (the one that's created when the dedi host is running) to determine the current track and car(s) enabled. The only way I can track track changes is to listen out for StateResponse packets and perform a check against the current track combo (by querying the above file) and doing a comparison against what the combo was the last time I got a StateResponse packet. This doesn't seem to me to be a very good way to do it (lots of checks, lots of disk accesses). Is there a simpler way to listen out for track changes? The other way I was thinking of doing it was listening for a message by connectionID 0 (the host) saying "Track loaded" but I don't know if that would cover all situations.
Question 2: What's the best way to listen out for changes to the enabled car(s)? At the moment I'm using the same mechanism as above (checking host file) but I can't help thinking there's a better way.
Thanks in advance for any help or advice you can give
Question 1: I'm trying to monitor when track changes happen. I'm using the hostXXXX.txt file (the one that's created when the dedi host is running) to determine the current track and car(s) enabled. The only way I can track track changes is to listen out for StateResponse packets and perform a check against the current track combo (by querying the above file) and doing a comparison against what the combo was the last time I got a StateResponse packet. This doesn't seem to me to be a very good way to do it (lots of checks, lots of disk accesses). Is there a simpler way to listen out for track changes? The other way I was thinking of doing it was listening for a message by connectionID 0 (the host) saying "Track loaded" but I don't know if that would cover all situations.
Question 2: What's the best way to listen out for changes to the enabled car(s)? At the moment I'm using the same mechanism as above (checking host file) but I can't help thinking there's a better way.
Thanks in advance for any help or advice you can give