Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API needs a way to get connection status of individual antennas #365

Closed
jwvanderbeck opened this issue Mar 25, 2015 · 4 comments
Closed

Comments

@jwvanderbeck
Copy link

I would like to be able to determine whether or not a given antenna has a connection to KSC.

@SirDiazo
Copy link
Contributor

You are looking to check if a specific antenna, not a specific vessel, for a connection to KSC?

I do not believe that is currently possible, I'm assuming you are aware of the

bool API.HasConnectionToKSC(Guid id)

call that checks if a vessel has connection and that it will not work for what you are after.

The thing is, I'm not sure if per antenna state is possible. To the best of my knowledge, RemoteTech keeps track in the background on a per vessel basis if there is a connection, I don't know if you can check to see if on a vessel in Duna orbit that the short range antenna has no connection because as far as RemoteTech is concerned, the long range antenna on the same vessel means the short range antenna has a connection.

Now, I've barely worked with RemoteTech's code myself in a different part of the mod so I may be wrong, but that is my understanding of how things work.

@jwvanderbeck
Copy link
Author

Correct I need to check a specific antenna. The problem I have with RT right now is that while my mod can verify that the vessel as a whole has a connection to KSC, the antenna that gets chosen to transmit the actual data may or may not itself have a connection. Not the end of the world, but definitely annoying.

So what you are saying is that RT itself doesn't know this information?

@SirDiazo
Copy link
Contributor

Okay, parsing through the code there is one promising method.

NetworkFeedback.tryConnection(IAntenna antenna, Guid target)

that sounds like it would do what you want.

However, I can't tell if RemoteTech actually saves the result of that anywhere or if it is just a connection check that it uses as a true/false during processing for other stuff.

It is also not exposed in the API so you would have to call it directly via reflection which could get messy. Both in terms of using it at all, but also because it is not exposed in the API there is no promises from the RemoteTech side of things that this method will not change in the future.

@tomekpiotrowski
Copy link
Member

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants