Author Topic: Next Update, Bypass GSX Menu ?  (Read 2415 times)

hkhoanguyen

  • Jr. Member
  • **
  • Posts: 71
Next Update, Bypass GSX Menu ?
« on: February 21, 2022, 08:54:18 am »
Hello,

Would it be possible for the next update, we can bypass the GSX Menu ? something like the GSX Services can be called by writing the LVARS ? and specific action will be called by writing the correspond numbers 1 2 3 4

Thanks

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51238
    • VIRTUALI Sagl
Re: Next Update, Bypass GSX Menu ?
« Reply #1 on: February 21, 2022, 11:21:29 am »
Before doing that, we need to add other new services first. I don't think using LVars for that would work, we'd need a proper communication protocol based on Simconnect.

Fragtality

  • Jr. Member
  • **
  • Posts: 94
Re: Next Update, Bypass GSX Menu ?
« Reply #2 on: February 21, 2022, 09:26:25 pm »
Imho an "API/SDK" based on SimConnect would not really help Users, not even "advanced Users". The Complexity alone to get to the Point where you could do any Communication with GSX would be so high, you would end up writing an API which almost no User would (or can) use. Excluding Plane-Devs of course, but they already can do really much (e.g. FSLabs) with just the Lvars. Or as another Example: I would not even had started writing an Integration for the QW787 if the current API would already be in SimConnect to be honest! (and I wrote a whole StreamDeck-Plugin in C#) ^^

It also would not need that much work imho (compared to a whole new Approach via SimConnect)! For Example: if there would be a "Request Lvar" where the User/Plan-Dev could write a non-zero Value which Service to Request (like 1=Refuel, 2=Cater and so on) could already achieve the goal to bypass the Menu. Paired with some Optimizations on the existing Status Variables (e.g. showing Service Availability earlier) this would already offer a very capable "API/SDK".

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51238
    • VIRTUALI Sagl
Re: Next Update, Bypass GSX Menu ?
« Reply #3 on: February 21, 2022, 09:31:45 pm »
I would not even had started writing an Integration for the QW787 if the current API would already be in SimConnect to be honest! (and I wrote a whole StreamDeck-Plugin in C#)

It wouldn't be much different than that.

Fragtality

  • Jr. Member
  • **
  • Posts: 94
Re: Next Update, Bypass GSX Menu ?
« Reply #4 on: February 21, 2022, 10:26:45 pm »
Uhm ... sure it would be. With C# and the FSUIPCClient it's basically 3 Lines to read/write an Lvar (and setting up the VS-Project is also much less complex). With a Lua-Script within FSUIPC you can directly read/write Lvars. Experienced the hassles I just had to today to get a small prototype running on how to read a single Lvar via a C++ DLL (PDK), I really wouldn't have done the Integration ^^
But I guess it depends on the experience in coding in C/C++ for FlightSims ;)

I just wanted to remark that if that "SimConnect-API" would be intended for Users, it would make the User-Base really small.

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51238
    • VIRTUALI Sagl
Re: Next Update, Bypass GSX Menu ?
« Reply #5 on: February 21, 2022, 10:53:44 pm »
Uhm ... sure it would be. With C# and the FSUIPCClient it's basically 3 Lines to read/write an Lvar (and setting up the VS-Project is also much less complex).

You misunderstood. I said it wouldn't be too different shouldn't be too different for some that already coded something in Simconnect. Not compared to do something else entirely.

In any case, the problem with your approach is wanting to convert something that is inherently EVENT-BASED into POLLING, because it's "easier", without caring for the consequences.

To do what you are asking, GSX should ALSO revert to do POLLING the LVar you are setting, to see if has changed, when the rest of its behaviour, like any Simconnect app is, instead, listening to Simconnect EVENTS instead, not doing anything if they don't happen, which is the whole point of event-based programming.

Using LVar just to simulate a bi-directional communication protocol is really bad practice ( forces doing polling from *both* sides ), and it becomes complex and bugged very soon, so you'd better use the proper communication protocol, which Simconnect provides for and it's there precisely to cover these cases.

And please, don't turn this post into a programming debate. GSX is our program to design so, if it'll ever had a communication API, it will be done in the proper way, using the correct tools for the job, in a similar way as GSX communicates with SODE.

hkhoanguyen

  • Jr. Member
  • **
  • Posts: 71
Re: Next Update, Bypass GSX Menu ?
« Reply #6 on: March 28, 2022, 05:28:28 pm »
Before doing that, we need to add other new services first. I don't think using LVars for that would work, we'd need a proper communication protocol based on Simconnect.

Thanks, really looking forward to that, (we can bypass the menu for simple requests such as Boarding/Deboarding/Pushback)