generated from AfonsoCMSousa/CPP-Template
35 lines
762 B
C++
35 lines
762 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);
|
|
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;
|
|
}
|
|
|
|
|