MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DebugAsk

Method DebugAsk

engine/Poseidon/Network/NetworkServerSimulate.cpp:200–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198 return word;
199}
200
201void NetworkServer::DebugAsk(RString str, int from, bool fullAccess)
202{
203 // check for some special debug commands
204 RString line = str;
205 RString word = ExtractWord(line);
206 if (!strcmpi(word, "version"))
207 {
208 RString versionText = GetVersionString();
209
210 DebugAnswer(RString("Debug: version ") + versionText);
211
212 ChatMessage chat;
213 chat.channel = CCGlobal;
214 chat.text = RString("Server Version: ") + versionText;
215 chat.sender = nullptr;
216 chat.name = "";
217 SendMsg(from, &chat, NMFGuaranteed);
218 return;
219 }
220 if (!fullAccess)
221 {
222 return;
223 }
224 if (!strcmpi(word, "checkfile"))
225 {
226 // get file name
227 RString filename = ExtractWord(line);
228 if (filename.GetLength() > 0)
229 {
230 // check file CRC
231 if (!IsRelativePath(filename))
232 {
233 RString message = RString("Only relative path check allowed: ") + filename;
234 GChatList.Add(CCGlobal, nullptr, message, false, true);
235 }
236 else
237 {
238 // if there is no ID, check all players
239 PerformFileIntegrityCheck(filename);
240 }
241 }
242 }
243 else if (!strcmpi(word, "checkexe"))
244 {
245 // format: offset:size offset:size, offset:size
246 for (;;)
247 {
248 RString location = ExtractWord(line);
249 if (location.GetLength() <= 0)
250 {
251 break;
252 }
253 PerformExeIntegrityCheck(location);
254 }
255 }
256
257 // check if string is only numbers

Callers

nothing calls this directly

Calls 15

ExtractWordFunction · 0.85
GetVersionStringFunction · 0.85
IsRelativePathFunction · 0.85
saturateFunction · 0.85
sprintfFunction · 0.85
GlobalTickCountFunction · 0.85
strcmpiFunction · 0.50
RStringClass · 0.50
stricmpFunction · 0.50
toIntFunction · 0.50
GetLengthMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected