forked from packetflinger/q2admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathg_admin.h
More file actions
49 lines (43 loc) · 1.77 KB
/
Copy pathg_admin.h
File metadata and controls
49 lines (43 loc) · 1.77 KB
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
/**
* Q2Admin
* ref/admin related stuff
*/
#pragma once
#define LOGINFILE "q2a_login.cfg"
#define BYPASSFILE "q2a_bypass.cfg" // anticheat requirement bypass
#define MAX_ADMINS 128
#define ADMIN_AUTH_LEVEL 1
// Sets what admin commands are available for an admin-auth'd player. They can
// use these commands plus all commands from lower levels:
#define ADMIN_LEVEL1 BIT(0) // !boot - to kick other players
#define ADMIN_LEVEL2 BIT(1) // !dumpmsec - see what msec values are used
#define ADMIN_LEVEL3 BIT(2) // !changemap - obvious
#define ADMIN_LEVEL4 BIT(3) // !dumpuser - extended player data
#define ADMIN_LEVEL5 BIT(4) // !auth and !gfx
#define ADMIN_LEVEL6 BIT(5) // !dostuff - stuff cmds to players
#define ADMIN_LEVEL7 BIT(6) // ???
#define ADMIN_LEVEL8 BIT(7) // !writewhois - write players to local whois
#define ADMIN_LEVEL9 BIT(8) // ???
typedef struct {
char name[256];
char password[256];
char ip[256]; // unused?
int level;
} admin_t;
extern admin_t admin_pass[MAX_ADMINS];
extern admin_t bypass_pass[MAX_ADMINS];
extern int num_admins;
extern int num_bypasses;
void adm_auth(edict_t *ent);
void adm_boot(edict_t *ent, int client, int user);
void adm_changemap(edict_t *ent, int client, char *mname);
void adm_dumpmsec(edict_t *ent, int client);
void adm_dumpuser(edict_t *ent, int client, int user, bool check);
void adm_gfx(edict_t *ent);
void adm_players(edict_t *ent, int client);
int doAdminCommand(edict_t *ent, int client);
int getAdminLevel(char *givenpass, char *givenname);
int getBypassLevel(char *givenpass, char *givenname);
void listAdminCommands(edict_t *ent, int client);
void readAdminConfig(void);
void reloadLoginFileRun(int startarg, edict_t *ent, int client);