MCPcopy Create free account
hub / github.com/crownengine/crown / device_command_game

Function device_command_game

src/device/device.cpp:259–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259static void device_command_game(ConsoleServer &cs, u32 client_id, const JsonArray &args, void *user_data)
260{
261 CE_UNUSED(user_data);
262 TempAllocator1024 ta;
263
264 if (array::size(args) < 2) {
265 cs.error(client_id, "Usage: game <pause|resume>");
266 return;
267 }
268
269 DynamicString subcmd(ta);
270 sjson::parse_string(subcmd, args[1]);
271 if (subcmd == "pause") {
272 device()->pause();
273 } else if (subcmd == "resume") {
274 device()->unpause();
275 } else {
276 loge(DEVICE, "Unknown game parameter");
277 }
278}
279
280static void device_command_crash(ConsoleServer &cs, u32 client_id, const JsonArray &args, void *user_data)
281{

Callers

nothing calls this directly

Calls 6

deviceFunction · 0.85
unpauseMethod · 0.80
sizeFunction · 0.50
parse_stringFunction · 0.50
errorMethod · 0.45
pauseMethod · 0.45

Tested by

no test coverage detected