PRC API wrapper written in C++.
| src | sdmawd | |
| .gitignore | sdmawd | |
| LICENSE | sdmawd | |
| README.md | sdmawd | |
⚠ Warning
This PRC API wrapper is still in early development. Some features may be incomplete or behave unexpectedly. Use in production at your own risk.
A modern C++ wrapper for the Police Roleplay Community API, designed for easy integration into C++ projects using cpp-httplib and nlohmann::json.
Getting Started:
1. Clone the repo:
$ git clone https://codeberg.org/Wicks/PXX
$ cd PXX
2. Include it into your project
#include "pxx.h"// The libary itself.
Advice:
Optionally, you can use the single header version.
Usage Example
#include "pxx.h"#include <iostream>
int main() {
try {
PRC::API api("SERVER_KEY", "GLOBAL_KEY");
auto serverInfo = api.getServer();
std::cout << serverInfo.dump(2) << std::endl;
auto players = api.getServerPlayers();
std::cout << "Active players: " << players.size() << std::endl;
// Exec a command.
auto response = api.executeCommand(":kick Dummy");
std::cout << response.dump(2) << std::endl;
} catch (const std::exception& e) {
std::cerr << "API Error: " << e.what() << std::endl;
}
return 0;
}
API Methods
| Method | Description |
|---|---|
getServer() |
Retrieve server info |
getServerPlayers() |
Get a list of active players |
getServerJoinLogs() |
Retrieve join logs |
getServerQueue() |
Get the server queue |
getServerKillLogs() |
Retrieve kill logs |
getServerCommandLogs() |
Retrieve command logs |
getServerModCalls() |
Retrieve mod call logs |
getServerBans() |
Retrieve bans |
getServerVehicles() |
Retrieve server vehicles |
executeCommand(cmd) |
Execute a server command (POST) |