linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06971
[Branch ~dcplusplus-team/dcpp-plugin-sdk-cpp/LoLPlugin] Rev 27: change OID to OIR
------------------------------------------------------------
revno: 27
committer: poy <poy@xxxxxxxxxx>
branch nick: LoLPlugin
timestamp: Sun 2013-06-09 14:00:28 +0200
message:
change OID to OIR
modified:
packaging/info.xml
src/AdcCommand.h
src/Plugin.cpp
src/version.h
--
lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/LoLPlugin
https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/LoLPlugin
Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/LoLPlugin.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/LoLPlugin/+edit-subscription
=== modified file 'packaging/info.xml'
--- packaging/info.xml 2013-06-03 17:39:19 +0000
+++ packaging/info.xml 2013-06-09 12:00:28 +0000
@@ -21,10 +21,10 @@
<dcext>
<UUID>{32c71f4f-ea2f-40ea-a5c9-52e46e721bbc}</UUID>
<Name>LoL plugin</Name>
- <Version>1</Version>
+ <Version>1.1</Version>
<ApiVersion>8</ApiVersion>
<Author>DC++</Author>
- <Description>Exchange League of Legends profile information with other users.</Description>
+ <Description>Exchange League of Legends profile information with other users. Works on ADC hubs only.</Description>
<Website>http://dcplusplus.sourceforge.net/</Website>
<Plugin Platform="pe-x64">LoLPlugin-x64.dll</Plugin>
<Plugin Platform="pe-x86">LoLPlugin-x86.dll</Plugin>
=== modified file 'src/AdcCommand.h'
--- src/AdcCommand.h 2013-05-19 15:45:47 +0000
+++ src/AdcCommand.h 2013-06-09 12:00:28 +0000
@@ -109,7 +109,7 @@
C(RNT, 'R','N','T');
C(ZON, 'Z','O','N');
C(ZOF, 'Z','O','F');
- C(OID, 'O','I','D');
+ C(OIR, 'O','I','R');
#undef C
static const uint32_t HUB_SID = 0xffffffff; // No client will have this sid
=== modified file 'src/Plugin.cpp'
--- src/Plugin.cpp 2013-06-03 17:39:19 +0000
+++ src/Plugin.cpp 2013-06-09 12:00:28 +0000
@@ -28,7 +28,6 @@
#include <pluginsdk/Hooks.h>
#include <pluginsdk/Hubs.h>
#include <pluginsdk/Logger.h>
-#include <pluginsdk/UI.h>
#include <pluginsdk/Util.h>
#include "AdcCommand.h"
@@ -41,7 +40,6 @@
using dcapi::Hooks;
using dcapi::Hubs;
using dcapi::Logger;
-using dcapi::UI;
using dcapi::Util;
using dcpp::AdcCommand;
@@ -97,7 +95,7 @@
/* Initialization phase. Initiate additional interfaces that you may have included from the
plugin SDK. */
Core::init(core);
- if(!Config::init(PLUGIN_GUID) || !Hooks::init() || !Hubs::init() || !Logger::init() || !UI::init(PLUGIN_GUID) || !Util::init()) {
+ if(!Config::init(PLUGIN_GUID) || !Hooks::init() || !Hubs::init() || !Logger::init() || !Util::init()) {
return false;
}
@@ -135,8 +133,9 @@
ShellExecute(nullptr, nullptr, Util::toT(link).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
}
#else
-void openLink(const string& link) {
- system(string("xdg-open " + link).c_str());
+void openLink(string link) {
+ boost::replace_all(link, "'", "'\\''");
+ system(string("xdg-open '" + link + "'").c_str());
}
#endif
} // unnamed namespace
@@ -151,16 +150,16 @@
AdcCommand(AdcCommand::CMD_CMD, AdcCommand::TYPE_INFO)
.addParam("Open LoL profile")
.addParam("CT", "14" /* 2 + 4 + 8 */)
- .addParam("TT", "DOID %[mySID] %[userSID] " + lolServ + "\n")
+ .addParam("TT", "DOIR %[mySID] %[userSID] " + lolServ + "\n")
.addParam("CO", "1")
.toString().c_str());
- } else if(cmd.getCommand() == AdcCommand::CMD_OID && cmd.getType() == AdcCommand::TYPE_DIRECT && cmd.getParam(0) == lolServ) {
+ } else if(cmd.getCommand() == AdcCommand::CMD_OIR && cmd.getType() == AdcCommand::TYPE_DIRECT && cmd.getParam(0) == lolServ) {
if(cmd.getParameters().size() == 1) {
// answer with our LoL info.
Hubs::handle()->send_protocol_cmd(hub,
- AdcCommand(AdcCommand::CMD_OID, cmd.getFrom(), AdcCommand::TYPE_DIRECT)
+ AdcCommand(AdcCommand::CMD_OIR, cmd.getFrom(), AdcCommand::TYPE_DIRECT)
.addParam(lolServ)
.addParam("SE", Config::getConfig("Server"))
.addParam("SU", Config::getConfig("Summoner"))
@@ -194,7 +193,7 @@
if(*last == '\n') { msg.erase(last); }
auto cmd = AdcCommand(msg);
- if(cmd.getCommand() == AdcCommand::CMD_OID && cmd.getParam(0) == lolServ && cmd.getParameters().size() == 1) {
+ if(cmd.getCommand() == AdcCommand::CMD_OIR && cmd.getParam(0) == lolServ && cmd.getParameters().size() == 1) {
// we are requesting LoL info; add the peer to the cache.
if(cache.size() > MAX_CACHE) {
cache.erase(cache.begin(), cache.begin() + MAX_CACHE / 2);
=== modified file 'src/version.h'
--- src/version.h 2013-05-16 17:47:44 +0000
+++ src/version.h 2013-06-09 12:00:28 +0000
@@ -31,10 +31,10 @@
#define PLUGIN_AUTHOR "DC++"
/* Short description of the plugin */
-#define PLUGIN_DESC "Exchange League of Legends profile information with other users."
+#define PLUGIN_DESC "Exchange League of Legends profile information with other users. Works on ADC hubs only."
/* Version of the plugin (note: not API version) */
-#define PLUGIN_VERSION 1.0
+#define PLUGIN_VERSION 1.1
/* Plugin website, set to "N/A" if none */
#define PLUGIN_WEB "http://dcplusplus.sourceforge.net/"