-
Notifications
You must be signed in to change notification settings - Fork 0
/
pug.h
65 lines (59 loc) · 2.84 KB
/
pug.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
#ifndef PUG_H
#define PUG_H
#include "config.h"
struct player
{
bool taken;
char playername[32];
bool team; // false = team one, true = team two
};
class PUG
{
public:
PUG();
void SetChan(char pchan[]);
void SetServer(char serverip[], unsigned long pport);
void SetPasswords();
void ModifyPassword(char[],char[]);
bool HasPlayer(char[]);
void Details(char *dets);
void SetMap(char pmap[]) { strncpy(map,pmap,sizeof(map)-1); mapset = true; return; } // should extract the real map name somehow, ie. stop at space
char *GetMap() { return(map); }
int FindPlayer();
char *AddPlayer(char *nick);
bool RemovePlayer(char *nick);
void ProcessNameChange(char oldname[], char newname[]);
void Status(char[]);
void KillPug();
void StartPug();
void MakeTeams();
void AppendTeams(char CT[], char T[]);
virtual void SendNotice(char nick[], char text[]) { return; } //nick + text
virtual void SetMode(char chan[],char nick[],char mode[]) { return; }
virtual void SetModes(char chan[],char mode[]) { return; }
virtual void onstartpug(char adminpass[],char serverpass[]) { return; } // called on start pug
char chan[32];
char password[16];
char adminpassword[6];
protected:
player Players[10];
unsigned long port;
int pcount;
bool inprogress, mapset;
char ip[32], map[32];
};
#define PLAYERSIZE 10 // how many people are needed in the pug to start it?
#define PUG_START "000,1[ 9,1eXeTeL 14,1:0,1 Starting Pug on %s 9,1]"
#define PUG_END "000,1[ 9,1eXeTeL 14,1:0,1 Ending Pug 9,1]"
#define PUG_INPROGRESS "000,1[ 9,1#eXeTeL 14,1:0,1 Pug in progress 9,1]"
#define PUG_EMPTY "000,1[ 9,1eXeTeL 14,1:0,1 Cannot !join - type !pug <level> 9,1]"
#define PUG_FULL "0,1[ 9,1eXeTeL 14,1:0,1 Pug is full 9,1]"
#define PUG_JOIN "0,1[ 9,1eXeTeL 14,1:0,1 Pug is already started - type !join 9,1]"
#define PUG_NOGAME "000,1[ 9,1eXeTeL 14,1:0,1 No game is in progress 9,1]"
#define PUG_NONADMIN "0,1[ 9,1eXeTeL 14,1:0,1 You are not the admin. 9,1]"
#define PUG_INFO "000,1[ 9,1eXeTeL 14,1:0,1 Pug is starting @ cs://%s:%d/%s 9,1]"
#define PUG_ADMIN "000,1[ 9,1eXeTeL 14,1:0,1 You are the Administrator, !login password is \"%s\" 9,1]"
#define PUG_SET "000,1[ 9,1eXeTeL 14,1:0,1 Password has been changed to \"%s\" 9,1]"
#define PUG_GET "0,1[ 9,1eXeTeL0,1PUG 9,1] 14,1-0,1 [ 9,1Ingame 14,1:0,1 Player Needed! 9,1] 14,1- 0,1[ 9,1Launcher 14,1: 0,1cs://%s:%d/%s 9,1] 14,1- 0,1[ 9,1Password 14,1: 0,1%s 9,1]"
#define PUG_REPLACE "0,1[ 9,1eXeTeL0,1PUG 9,1] 14,1-0,1 [ 9,1Ingame 14,1:0,1 Replacement Needed! 9,1] 14,1- 0,1[ 9,1Launcher 14,1: 0,1cs://%s:%d/%s 9,1] 14,1- 0,1[ 9,1Password 14,1: 0,1%s 9,1]"
#endif