hbeni / fgcom-mumble

A (flightsim) radio communication simulation based on mumble
GNU General Public License v3.0
17 stars 5 forks source link

FGFS Addon: Intercom support #166

Closed hbeni closed 1 year ago

hbeni commented 1 year ago

Adds intercom support for use in FGFS copilot mode.

Intercom functionality is automatically enabled when you make a connection using the FGFS copilot module.

hbeni commented 1 year ago

I have a first draft local here, still needs some tuning.

~To experiment: the props are unde rthe addons root. there is a debug prop where you ca enter a fake connection like "test1-test2", and you can handle the virtual intercom device via properties in the intercom subtree in the addon root.~

Three things are issues right now:

  1. The Combar code is rather fixed and i have no good idea yet how i can dynamically create the additional buttons. I would like to show the IC button only when there is actually IC functionality, as most of the time there will be no IC.
  2. The code to detect an established copilot connection is yet to be done. This is not as easy as it looks, because of lacking properties. Still searching.
  3. There seems to be a size limit for a getValue() call (368 chars). Currently, COM4's UDP code will be truncated, despite beeing there in the property. I think I remember that i already encountered that problem while testing a prior version of the FGFS addon, but I'm not sure what the clue was - I think it was some limit in C code. Maybe we need to add some kind of multiplexer or so, to write COM1-3 to one out property, COM4-6 to another, both transmitted in the protocol file.
hbeni commented 1 year ago

Investigated 3. a little further. Its not the property, and from nasal space it is readable in its entirity. It looks like something in the protocol.xml/io module that truncates this to 368 chars. (Actually,it is limited to 255 chars, but we have several chunks that makes this longer.)

https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Network/generic.cxx#l344 https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Network/generic.cxx#l442 Google did result in ML traffic: https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/B1102AC7-428A-440F-808C-27D84FF74776%40flightgear.org/

[edit] added a multiplexer solving this

hbeni commented 1 year ago

Connecting to Intercom based on dual control module now also works.

Test with two instances:

#--multiplay=in,10,127.0.0.1,5010 --multiplay=out,10,127.0.0.1,5011 --callsign=T-EST1
#--multiplay=in,10,127.0.0.1,5011 --multiplay=out,10,127.0.0.1,5010 --callsign=T-EST2

or set --prop:/sim/remote/pilot-callsign=T-EST1 manually


last thing open is now the combar

hbeni commented 1 year ago

@MariuszXC Hi Mariusz, I think this is ready for testing :) :tada:

MariuszXC commented 1 year ago

@hbeni I'll give it a go once real life settles up a bit, i.e. about a week from now (hopefully) ;)

hbeni commented 1 year ago

Or we use GA-Wendesday tomorrow, if I can join (which looks good at the moment) for a short test

hbeni commented 1 year ago

Just did a quick test (two FGFS instances, two mumble instances), and it worked trough normal multiplayer via mp01

Statuspage also did display it properly: grafik

hbeni commented 1 year ago

Hm, maybe we should switch the callsign mapping to another separator (hash? pipe? underscore?), so it would be easier to process via scripts or so in the future. What do you think?