Browse Source

1.03 - added /mss(/ms send) /mst(/ms sendto) and /msg(/ms sendgroup) aliases

pull/1/head
Lolwutt 7 years ago
parent
commit
1589d89009
  1. BIN
      release/plugins/MultiSend.dll
  2. 41
      src/MultiSend/Commands.cpp
  3. 2
      src/MultiSend/Main.cpp

BIN
release/plugins/MultiSend.dll

Binary file not shown.

41
src/MultiSend/Commands.cpp

@ -4,27 +4,31 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
{ {
std::string arg; std::string arg;
const char* com = command + GetArg(command, &arg); const char* com = command + GetArg(command, &arg);
if ((_stricmp(arg.c_str(), "/ms")) if ((_strnicmp(command, "/ms", 3))
&& (_stricmp(arg.c_str(), "/multisend"))) && (_stricmp(arg.c_str(), "/multisend")))
{ {
return false; return false;
} }
if (strlen(com) < 2) return true; if (strlen(com) < 2) return true;
com++; if ((_stricmp(arg.c_str(), "/ms") == 0)
com += GetArg(com, &arg); || (_stricmp(arg.c_str(), "/multisend")) == 0)
{
com++;
com += GetArg(com, &arg);
}
if ((_stricmp(arg.c_str(), "send") == 0) if ((_stricmp(arg.c_str(), "send") == 0)
|| (_stricmp(command, "/mss") == 0)) || (_stricmp(arg.c_str(), "/mss") == 0))
{ {
if (strlen(com) < 2) return true; if (strlen(com) < 2) return true;
SendCommand(0xFFFF0000, com + 1); SendCommand(0xFFFF0000, com + 1);
return true; return true;
} }
if ((_stricmp(arg.c_str(), "sendto") == 0) else if ((_stricmp(arg.c_str(), "sendto") == 0)
|| (_stricmp(command, "/mst") == 0)) || (_stricmp(arg.c_str(), "/mst") == 0))
{ {
if (strlen(com) < 2) if (strlen(com) < 2)
{ {
@ -52,10 +56,11 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
InterlockedExchange(&(MMF_Pointer->Name.ProcessID), 0); InterlockedExchange(&(MMF_Pointer->Name.ProcessID), 0);
m_AshitaCore->GetChatManager()->Write("MultiSend: Character not found."); m_AshitaCore->GetChatManager()->Write("MultiSend: Character not found.");
return true;
} }
if ((_stricmp(arg.c_str(), "sendgroup") == 0) else if ((_stricmp(arg.c_str(), "sendgroup") == 0)
|| (_stricmp(command, "/msg") == 0)) || (_stricmp(arg.c_str(), "/msg") == 0))
{ {
if (strlen(com) < 3) if (strlen(com) < 3)
{ {
@ -78,7 +83,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
return true; return true;
} }
if (_stricmp(arg.c_str(), "followme") == 0) else if (_stricmp(arg.c_str(), "followme") == 0)
{ {
if (strlen(com) < 2) return true; if (strlen(com) < 2) return true;
com++; com++;
@ -120,7 +125,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
return true; return true;
} }
if (_stricmp(arg.c_str(), "follow") == 0) else if (_stricmp(arg.c_str(), "follow") == 0)
{ {
if (strlen(com) < 2) return true; if (strlen(com) < 2) return true;
com++; com++;
@ -146,7 +151,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
return true; return true;
} }
if (_stricmp(arg.c_str(), "ignoreself") == 0) else if (_stricmp(arg.c_str(), "ignoreself") == 0)
{ {
if (strlen(com) < 2) return true; if (strlen(com) < 2) return true;
com++; com++;
@ -171,7 +176,7 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
return true; return true;
} }
if (_stricmp(arg.c_str(), "debug") == 0) else if (_stricmp(arg.c_str(), "debug") == 0)
{ {
if (strlen(com) < 2) return true; if (strlen(com) < 2) return true;
com++; com++;
@ -197,13 +202,13 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
return true; return true;
} }
if (_stricmp(arg.c_str(), "reload") == 0) else if (_stricmp(arg.c_str(), "reload") == 0)
{ {
LoadGroups(); LoadGroups();
return true; return true;
} }
if (_stricmp(arg.c_str(), "help") == 0) else if (_stricmp(arg.c_str(), "help") == 0)
{ {
m_AshitaCore->GetChatManager()->Write("Multisend Command Listing"); m_AshitaCore->GetChatManager()->Write("Multisend Command Listing");
m_AshitaCore->GetChatManager()->Write("/ms send [command] - Sends [command] to all characters with multisend loaded."); m_AshitaCore->GetChatManager()->Write("/ms send [command] - Sends [command] to all characters with multisend loaded.");
@ -216,8 +221,8 @@ bool MultiSend::HandleCommand(const char* command, int32_t type)
m_AshitaCore->GetChatManager()->Write("/ms debug on/off - When enabled, debug prints will be visible."); m_AshitaCore->GetChatManager()->Write("/ms debug on/off - When enabled, debug prints will be visible.");
return true; return true;
} }
return true; return (_strnicmp(command, "/ms ", 4) == 0);
} }
uint32_t MultiSend::GetArg(const char* text, std::string* buffer) uint32_t MultiSend::GetArg(const char* text, std::string* buffer)

2
src/MultiSend/Main.cpp

@ -116,7 +116,7 @@ __declspec(dllexport) void __stdcall CreatePluginInfo(plugininfo_t* lpBuffer)
strcpy_s(g_PluginInfo->Author, sizeof(g_PluginInfo->Author), "Thorny"); strcpy_s(g_PluginInfo->Author, sizeof(g_PluginInfo->Author), "Thorny");
g_PluginInfo->InterfaceVersion = ASHITA_INTERFACE_VERSION; g_PluginInfo->InterfaceVersion = ASHITA_INTERFACE_VERSION;
g_PluginInfo->PluginVersion = 1.02f; g_PluginInfo->PluginVersion = 1.03f;
g_PluginInfo->Priority = 0; g_PluginInfo->Priority = 0;
} }

Loading…
Cancel
Save