Chat and share with mtgcompanion users - nicho92/MtgDesktopCompanion GitHub Wiki
This page documents the network chat module used by MTG Desktop Companion for peer communication, shared deck messages, and stock search collaboration.
Overview
The chat module is exposed in the UI via NetworkChatPanel, where users can:
- Connect/disconnect from a configured network endpoint.
- Send markdown chat messages.
- Share decks in-chat.
- Send stock search requests and receive answer payloads.
- Change player status (online/away/busy/offline-like states except disconnected).
- Optionally spawn the AI virtual user helper.
Main Components
Configuration Panel
In config panel you can enable 2 features :
- Auto connect on latest server at startup
- Enabling search query if you wan't to share your stock with other users
Main UI
Toolbar
- type the server uri
- click 'connect'. (not necessary if auto_connect is enable in configuration panel
- Integrate your IA in the chat
Chat toolbar
- Change your status
- change your foreground color
- search for a card
- share a deck
just press enter to send your text message.
Chat syntax
- user markdown syntax https://www.markdownguide.org/basic-syntax/
- overlight a card name by surround the name with {'Black Lotus'}
Discuss with your IA
- MTGCompanion can your your IA provider and transform it as a Magic the gathering companion and can help you with Deckbuilding advice, Rules questions, Card identification, Strategy tips,...
just press and your agent will be online. Just ask him questions about mtg ;)
Message Model
All chat traffic extends AbstractMessage with shared metadata (id, author, message, typeMessage, timestamps).
Concrete message classes used by the module:
TalkMessage(MSG_TYPE.TALK): plain text chat; attempts{Card Name}extraction to attach card metadata.StatutMessage(MSG_TYPE.CHANGESTATUS): player presence updates.SearchMessage(MSG_TYPE.SEARCH): stock lookup request for a selected product/card.SendStockMessage(MSG_TYPE.ANSWER): stock lookup response with card stock list.DeckMessage(MSG_TYPE.DECK): shared deck payload.TechnicalMessage(MSG_TYPE.SYSTEM): server-side synchronization payload (online players/channels).
Operational Considerations
- The default transport URI (
tcp://my.mtgcompanion.org:61616) implies external connectivity requirements, when no previous server is stored, and persists the last server in the user configuration. - Stock query auto-response can generate additional traffic in large rooms when enabled.