2026-01-07 19:47:44 +00:00

36 lines
848 B
C++

#include <cstddef>
#include <cstdint>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
#include "file.hpp" // for parce_args
#include "net.hpp" // for socket operations
#include "server_structs.h"
using namespace std;
int main(int argc, char *argv[]) {
app_info app = parce_args(argc, argv);
api_packet packet;
try {
Socket sock;
sock.connect(app.app_server_out_ip, app.app_port_out);
packet = sock.create_packet((uint8_t)app.app_id);
cout << "Sending packet with tracker ID: " << (int)packet.tracker_id << endl;
sock.set_packet(packet);
sock.send();
} catch (const runtime_error &e) {
cerr << "Error: " << e.what() << endl;
cout << "Usage: ./PlayerTracker <app_id> <port_in> <port_out>" << endl;
return 1;
}
return 0;
}