diff --git a/src/stdinreader.cpp b/src/stdinreader.cpp index 8fba6f4db70..e16e110fce6 100644 --- a/src/stdinreader.cpp +++ b/src/stdinreader.cpp @@ -1061,6 +1061,39 @@ int cmdInputThreadFunc(void *) } }); } + else if(!strncmpl(line, "status")) + { + wzAsyncExecOnMainThread([] { + std::string statusString = "WZSTATUS: 0 "; + statusString += time(NULL); + for (uint32_t i = 0; i < MAX_CONNECTED_PLAYERS; i++) + { + auto player = NetPlay.players[i]; + if (!isHumanPlayer(i)) + { + continue; + } + std::string playerName = NetPlay.players[i].name; + + statusString += " "; + if (player.isSpectator) + { + statusString += "spec"; + } + else + { + statusString += player.position; + } + statusString += " "; + statusString += base64Encode(std::vector(playerName.begin(), playerName.end())); + statusString += " "; + statusString += player.IPtextAddress; + statusString += " "; + statusString += base64Encode(getMultiStats(i).identity.toBytes(EcKey::Public)); + } + wz_command_interface_output("%s\n", statusString.c_str()); + }); + } else if(!strncmpl(line, "shutdown now")) { inexit = true;