Skip to content

Add coalition, toAll and playerName to sendchat event#298

Draft
mobot-gh wants to merge 3 commits into
DCS-gRPC:mainfrom
mobot-gh:playerSendChatAdds
Draft

Add coalition, toAll and playerName to sendchat event#298
mobot-gh wants to merge 3 commits into
DCS-gRPC:mainfrom
mobot-gh:playerSendChatAdds

Conversation

@mobot-gh
Copy link
Copy Markdown
Contributor

@mobot-gh mobot-gh commented May 4, 2026

this allows for discord integrations to pipe game chats to the correct channels and add coalition colouring via ansi formatting

YoloWingPixie
YoloWingPixie previously approved these changes May 15, 2026
Copy link
Copy Markdown
Collaborator

@YoloWingPixie YoloWingPixie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I left a nit to consider, but I am ok merging as is.

Comment thread lua/DCS-gRPC/grpc-hook.lua Outdated
-- or to everybody. When ED fixes this, implementation should determine the dcs.common.v0.Coalition

local coalition = net.get_player_info(playerID, "side")
local playerName = net.get_player_info(playerID, "name")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this could theoretically fail if somehow the player disconnects around the same time as a chat is sent. (It's very unlikely).

Personally I would wrap any call like this in a pcall with a safe default applied if the call fails. However, I acknowledge that this is a far edge case and I don't believe all of our DCS MSE API calls are safe as is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a nil guard

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.

2 participants