Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
administration.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "inexor/io/Logging.hpp"
3 
5 enum {
6  PRIV_NONE = 0,
10 };
11 
12 inline const char *privname(int type)
13 {
14  switch(type)
15  {
16  case PRIV_LOCAL: return "local";
17  case PRIV_ADMIN: return "admin";
18  case PRIV_MASTER: return "master";
19  default: return "unknown";
20  }
21 }
22 
23 
25 enum
26 {
27  MM_START = -1,
28  MM_OPEN = 0, // anyone on this server can claim master
29  MM_VETO, // anyone on this server can vote for maps and join
30  MM_LOCKED, // newly joined players start in spectator mode
33 };
34 
36 static const char * const mastermodenames[] ={"default", "open", "veto", "locked", "private", "password"};
37 
39 inline const char *mastermodename(int n, const char *unknown = "unknown")
40 {
41  return (n>=MM_START && size_t(n-MM_START)<sizeof(mastermodenames)/sizeof(mastermodenames[0])) ? mastermodenames[n-MM_START] : unknown;
42 }
Definition: administration.hpp:6
const char * privname(int type)
Definition: administration.hpp:12
Definition: administration.hpp:28
static const char *const mastermodenames[]
static strings for server description in master server list
Definition: administration.hpp:36
Definition: administration.hpp:7
Logging stuff including the ingame console logging functionality.
Definition: administration.hpp:8
Definition: administration.hpp:30
Definition: administration.hpp:31
const char * mastermodename(int n, const char *unknown="unknown")
Gives back the mastermode name based on the index. If index is out of range, gives back the given unk...
Definition: administration.hpp:39
Definition: administration.hpp:27
Definition: administration.hpp:29
Definition: administration.hpp:9
Definition: administration.hpp:32