MCPcopy Index your code
hub / github.com/assaultcube/AC / processmasterinput

Function processmasterinput

source/src/serverms.cpp:92–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90extern void processmasterinput(const char *cmd, int cmdlen, const char *args);
91
92void processmasterinput()
93{
94 if(masterinpos >= masterin.length()) return;
95
96 char *input = &masterin[masterinpos], *end = (char *)memchr(input, '\n', masterin.length() - masterinpos);
97 while(end)
98 {
99 *end++ = '\0';
100
101 const char *args = input;
102 while(args < end && !isspace(*args)) args++;
103 int cmdlen = args - input;
104 while(args < end && isspace(*args)) args++;
105
106 if(!strncmp(input, "failreg", cmdlen))
107 xlog(ACLOG_WARNING, "master server registration failed: %s", args);
108 else if(!strncmp(input, "succreg", cmdlen))
109 {
110 xlog(ACLOG_INFO, "master server registration succeeded");
111 }
112 else processmasterinput(input, cmdlen, args);
113
114 masterinpos = end - masterin.getbuf();
115 input = end;
116 end = (char *)memchr(input, '\n', masterin.length() - masterinpos);
117 }
118
119 if(masterinpos >= masterin.length())
120 {
121 masterin.setsize(0);
122 masterinpos = 0;
123 }
124}
125
126void flushmasteroutput()
127{

Callers 1

flushmasterinputFunction · 0.70

Calls 4

xlogFunction · 0.85
setsizeMethod · 0.80
lengthMethod · 0.45
getbufMethod · 0.45

Tested by

no test coverage detected