From e00289b575d885c2039238c8e7d06b099ccdf727 Mon Sep 17 00:00:00 2001 From: hbeni Date: Sat, 17 Oct 2020 16:07:26 +0200 Subject: [PATCH] Channel description is searched for the string "fgcom-mumble enabled" to see if it should enable the plugin /!\ BEWARE: this is notorious unstable, because mumble does only sync channel comments <128 bytes currently. Longer comments will only be synched on-demand (when the users hovers over the channel), which is too late for plugin initialization. --- README-de_DE.md | 2 +- README.md | 2 +- client/mumble-plugin/fgcom-mumble.cpp | 34 ++++++++++++++++++++------- client/mumble-plugin/fgcom-mumble.ini | 5 +++- client/mumble-plugin/lib/globalVars.h | 12 ++++++---- client/plugin.spec.md | 4 +++- 6 files changed, 42 insertions(+), 17 deletions(-) diff --git a/README-de_DE.md b/README-de_DE.md index afb7261e..3143f766 100644 --- a/README-de_DE.md +++ b/README-de_DE.md @@ -72,7 +72,7 @@ Das Plugin einsetzen ==================== - Verbinde dich auf den mumble server - Aktiviere das FGCom-mumble plugin -- betrete einen Chatraum der mit `fgcom-mumble` beginnt +- betrete einen Chatraum der mit `fgcom-mumble` beginnt oder dessen Beschreibung `fgcom-mumble activated` enthält Jetzt bist du bereit, am Funkverkehr teilzunehmen! Dein Flugsimulator oder ATC-Programm muss dem Plugin nun die notwendigen Informationen senden, damit es weiß, wo du bist und welche Funkgeräte zur Verfügung stehen. diff --git a/README.md b/README.md index d30e1d18..0e21c1dd 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Running the client ====================== - connect your mumble client to fgfs mumble server - enable your plugin in your standard mumble client -- join a channel starting with `fgcom-mumble` +- join a channel starting with `fgcom-mumble` or with `fgcom-mumble activated` in its description. You are ready for radio usage! Some client needs to supply information to the plugin now, so it knows about your location and radio stack. diff --git a/client/mumble-plugin/fgcom-mumble.cpp b/client/mumble-plugin/fgcom-mumble.cpp index 4b6764c2..479992a2 100644 --- a/client/mumble-plugin/fgcom-mumble.cpp +++ b/client/mumble-plugin/fgcom-mumble.cpp @@ -314,11 +314,12 @@ mumble_error_t fgcom_loadConfig() { std::string token_value = sm[2]; pluginDbg("[CFG] Parsing token: "+token_key+"="+token_value); - if (token_key == "radioAudioEffects") fgcom_cfg.radioAudioEffects = (token_value == "0" || token_value == "false" || token_value == "off")? false : true; + if (token_key == "radioAudioEffects") fgcom_cfg.radioAudioEffects = (token_value == "0" || token_value == "false" || token_value == "off")? false : true; if (token_key == "allowHearingNonPluginUsers") fgcom_cfg.allowHearingNonPluginUsers = (token_value == "1" || token_value == "true" || token_value == "on")? true : false; - if (token_key == "specialChannel") fgcom_cfg.specialChannel = token_value; - if (token_key == "udpServerHost") fgcom_cfg.udpServerHost = token_value; - if (token_key == "udpServerPort") fgcom_cfg.udpServerPort = std::stoi(token_value); + if (token_key == "specialChannelName") fgcom_cfg.specialChannelName = token_value; + if (token_key == "specialChannelDescription") fgcom_cfg.specialChannelDescription = token_value; + if (token_key == "udpServerHost") fgcom_cfg.udpServerHost = token_value; + if (token_key == "udpServerPort") fgcom_cfg.udpServerPort = std::stoi(token_value); } } } else { @@ -428,7 +429,7 @@ mumble_error_t fgcom_initPlugin() { return EC_CHANNEL_NOT_FOUND; // abort online init - something horribly went wrong. } else { pluginLog("Server has "+std::to_string(channelCount)+" channels, looking for special ones"); - pluginDbg(" fgcom.specialChannel='"+fgcom_cfg.specialChannel+"'"); + pluginDbg(" fgcom.specialChannelName='"+fgcom_cfg.specialChannelName+"'"); for (size_t ci=0; ci