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

Allow CA & EAM to intercom (with channels), but not across Coalition #724

Conversation

TaeruAlethea
Copy link
Contributor

@TaeruAlethea TaeruAlethea commented Aug 17, 2024

Adding some more context.

Currently:

  • EAM is on island A. Intercom channels work on this island.
  • spectators, like when new player joins or is not holding a slot, are on Intercom island B.
  • all in-game CA slots are on the same island as spectators, island B. Intercom channels DO NOT WORK.
  • When a CA slot controls a vehicle, they become an FC3 aircraft. Resetting and limiting their radios. When the vehicle is released, their Radios limits are expanded again and reset to defaults. (Radio state is not maintained between CA -> vehicle -> CA.)

Note: Gamemaster/observer are, functionally, the same as Commander/JTAC. The difference is that Commander/JTAC have coalition vision and fog of war behavior like the jets do.

What does this PR do:

This PR makes the SRS-Client aware of what actual slot the player is in. It then sets a deterministic UnitID, with offsets for different things, to group special slot cases together.

Preparatory Changes

Slot Awareness is achieved using the changes in SRSGameGUI.lua. The get_player_info call was already being done there and contains the rich data needed to determine more complex slot types. The exact parsing uses code currently deployed by SpecialK's Bot for the same purpose.

The export lua, DCS-SimpleRadioStandalone.lua, notes the Slot using the existing mechanism used for determining Seats in multi-crew vehicles. It then uses the additional context to parse valid Unit Data, along with verifying if we are in a Special Slot case. The Default option has been amended to being Spectator.

DCSPlayerSideInfo.cs - defined the new data available from the SRS-GameGUI.lua
DCSPlayerRadioInfo.cs - Defaults and UnitID Offsets are defined so that they can be referenced else where.

Primary Change

The major functionality change is in the SR-Client itself. in DCSRadioSyncHandler.cs, a switch case is used to customize what each of the Special Slot cases and default case should do.
A Special Slot UnitID is built from various offsets, allowing for trimming/tweaking later. The message.unit is then parsed. If it matches any of the known special cases, including EAM's existing definition and the Init case ?, the Special Slot UnitID is assigned. The Default case passes the Unit and UnitID provided be the Export Lua with out modification.
Due to some quirks with how Artillery Commander and Ground unit slots work, the old UnitID based 'slot change' detection no longer works. A new Switch case is added to only update the aircraft/vehicle definition when a Slot change is detected.

Integration changes

DCSRadioSyncManager.cs - EAM definition amended to match how Aircraft/Export slots will look now.
AwacsIntercomControlGroup.xaml.cs - UnitID references now point at the CombinedArms variant.

Original Post:

Similar to #720 but this should be more coherent and less scattered. It centralizes all of the case switching in the Sync Handler.

The following cases were tested between two clients with these changes on an existing server.

Cases to test:
1: ✅ Blue EAM <-> Spectator, Exp: No Comms
2: ✅ Blue EAM <-> Blue Controller, Exp: Working Comms
3: ✅ Blue EAM, Intercom Ch1 <-> Blue Controller, Intercom Ch2, Exp: No Comms
4: ✅ Blue EAM, Intercom Ch2 <-> Blue Controller, Intercom Ch1, Exp: No Comms
5: ✅ Blue EAM <-> Red Controller, Exp: No Comms
5.5 ✅Blue EAM <-> Red EAM, Exp: No Comms.

@TaeruAlethea
Copy link
Contributor Author

adjusted checks so that Combined Arms slots retain their Full panel of radios when controlling a vehicle.

@TaeruAlethea
Copy link
Contributor Author

I've been thinking about it and want to break this up into 2 or 3 parts. I've also learned some new things since writing it originally.

@TaeruAlethea
Copy link
Contributor Author

Step 1: #742

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

Successfully merging this pull request may close these issues.

1 participant