check_csgo.h
830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CHECK_CSGO_H
#define CHECK_CSGO_H
#include <iostream>
#include <sstream>
#include <fstream>
#include <limits>
#include <ctype.h>
#include <cstdlib>
#include <unistd.h>
#include <cstring>
#include <sys/time.h>
#include "auxiliar.h"
#include "udp.h"
#define VERSION "1.0"
#define DATAGRAM_LENGTH 1400
#define HDR_SIZE 4
struct sourcedspacket_struct {
ssize_t length;
char* data;
};
typedef struct sourcedspacket_struct SOURCEDS_PACKET;
struct serverinfo_struct {
string name;
string game;
string map;
uint8_t players;
uint8_t max_players;
};
typedef struct serverinfo_struct SERVERINFO;
SOURCEDS_PACKET* getSourceDSResponse(int s, sockaddr_in *server);
int check_csgo(char *hostname, uint16_t port, SERVERINFO *server_info);
void printVersion();
void printHelp(bool longVersion);
#endif