-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjk2pugbot.h
110 lines (90 loc) · 2.13 KB
/
jk2pugbot.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
Copyright 2014 Witold Piłat
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MYIRCBOT_H_
#define _MYIRCBOT_H_
#include <assert.h>
#include <netdb.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#define MAX_MSG_LEN 512
#define MAX_Q3_INFO_LEN 1024
#define SEND_BUF_SIZE 4096
#define RECV_BUF_SIZE 4096
enum sv_type {
SV_NONE = 0,
SV_Q3
};
typedef struct q3serverInfo_s {
int maxclients;
int clients;
} q3serverInfo_t;
struct prefix_s {
union {
char *servername;
char *nick;
};
char *user;
char *host;
};
typedef struct message_s {
struct prefix_s prefix;
char *command;
char *parameter[14];
char *trailing;
} message_t;
typedef struct player_s {
char *nick;
bool op;
} player_t;
typedef struct playerNode_s {
player_t *player;
struct playerNode_s *next;
} playerNode_t;
typedef struct server_s {
const char *name;
const char *address;
const char *port;
const char *games;
enum sv_type type;
} server_t;
typedef struct serverNode_s {
const server_t *server;
struct serverNode_s *next;
} serverNode_t;
typedef struct pickup_s {
const char *name;
serverNode_t *serverList;
playerNode_t *playerList;
int count;
int max;
} pickup_t;
typedef struct pickupNode_s {
pickup_t *pickup;
struct pickupNode_s *next;
} pickupNode_t;
typedef enum {
RPL_WELCOME = 001,
RPL_NAMREPLY = 353,
RPL_ENDOFNAMES = 366,
} reply_t;
#endif // _MYIRCBOT_H_