Compare commits
5 Commits
Network-id
...
api-based
Author | SHA1 | Date | |
---|---|---|---|
8834f75f63 | |||
421ec84702 | |||
5ea0dd67c9 | |||
69a05e00f5 | |||
4782ca769b |
@ -167,6 +167,7 @@
|
||||
<ClInclude Include="functions.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="SimpleIni.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
|
@ -30,6 +30,9 @@
|
||||
<ClInclude Include="functions.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SimpleIni.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
|
10
README.md
10
README.md
@ -10,15 +10,9 @@ This C++ Plutonium t6 plugin and C# iw4m-admin plugin are used together to grab
|
||||
|
||||
# Installation:
|
||||
|
||||
Download the latest ClanTagRank.dll from the release page, and place it in your t6 server under ```./t6r/data/plugins```, and ClanTagRankApi.dll (from https://gitea.insanemode.org/INSANEMODE/ClanTagRankApi ) in your Iw4m-admin folder under ```./Plugins```
|
||||
- Download the latest ClanTagRank.dll from the release page, and place it in your t6 server under ```./t6r/data/plugins```, and ClanTagRankApi.dll (from https://gitea.insanemode.org/INSANEMODE/ClanTagRankApi ) in your Iw4m-admin folder under ```./Plugins```
|
||||
|
||||
# Limitations:
|
||||
|
||||
Currently, these plugins require iw4m-admin to be running locally, on the same machine as your servers, and also needs the webfront to be running on the default port, 1624.
|
||||
|
||||
if either of these aren't followed, or iw4m-admin is not running, you will see an error in your server's console window that looks similar to this
|
||||
|
||||
```curl_easy_perform() failed: Couldn't connect to server```
|
||||
- Run your server, and GetClanTag.ini will be generated in your ```./t6r/data/plugins``` folder. you can edit the URL in this file to match your iw4m-admin url or port if you aren't running it locally, or if you are not running on the default 1624 port.
|
||||
|
||||
# Additional required files/programs
|
||||
https://github.com/RaidMax/IW4M-Admin/releases
|
||||
|
3474
SimpleIni.h
Normal file
3474
SimpleIni.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,8 @@
|
||||
void init()
|
||||
{
|
||||
|
||||
std::cout << "ClanTagRank (1.0.4) by INSANEMODE\n";
|
||||
std::cout << "ClanTagRank (1.2) by INSANEMODE\n";
|
||||
std::cout << "loaded iw4m-admin url from .\\Plugins\\GetClanTag.ini: " << Game::configfile() << '\n';
|
||||
std::thread rank(Game::clanTagThread);
|
||||
rank.detach();
|
||||
}
|
||||
|
@ -8,11 +8,32 @@
|
||||
#include <thread>
|
||||
#include <algorithm>
|
||||
#include "curl\curl.h"
|
||||
#include "simpleini.h"
|
||||
#include <filesystem>
|
||||
#define GetCurrentDir _getcwd
|
||||
|
||||
namespace Game
|
||||
|
||||
{
|
||||
|
||||
std::string configfile()
|
||||
{
|
||||
|
||||
CSimpleIniA ini;
|
||||
|
||||
std::string currentpath = std::filesystem::current_path().generic_string();
|
||||
std::string configfile = currentpath + (R"(/t6r/data/plugins/GetClanTag.ini)");
|
||||
SI_Error rc = ini.LoadFile(configfile.c_str());
|
||||
//SI_Error rc = ini.LoadFile("\\t6r\\data\\plugins\\GetClanTag.ini");
|
||||
if (rc < 0)
|
||||
{
|
||||
ini.SetValue("Config", "URL", "127.0.0.1:1624");
|
||||
ini.SaveFile(configfile.c_str());
|
||||
};
|
||||
const char* pVal = ini.GetValue("Config", "URL", "http://127.0.0.1:1624");
|
||||
return pVal;
|
||||
}
|
||||
|
||||
|
||||
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp)
|
||||
{
|
||||
@ -28,7 +49,7 @@ namespace Game
|
||||
std::string readBuffer;
|
||||
curl = curl_easy_init();
|
||||
if (curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:1624/api/gsc/clientguid/" + guidstring);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, configfile() + "/api/gsc/clientguid/" + guidstring);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
|
||||
/* example.com is redirected, so we tell libcurl to follow redirection */
|
||||
@ -122,6 +143,7 @@ namespace Game
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
configfile();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10000));
|
||||
clanTagChanger();
|
||||
}
|
||||
|
@ -6,4 +6,5 @@ namespace Game
|
||||
{
|
||||
//void Testprint();
|
||||
void clanTagThread();
|
||||
std::string configfile();
|
||||
}
|
||||
|
Reference in New Issue
Block a user