add some server commands

This commit is contained in:
2025-04-17 21:59:14 -05:00
parent 9147787fd2
commit 600d0f3c81
4 changed files with 22 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ void ChatClient::run() {
static ClientModule* cm; { cm = (ClientModule*) moduleInstances[ClientModule()]; }
if(open) {
static std::string s, addr;
static std::string s, addr = "127.0.0.1:9932";
ImGui::Begin("ChatClient Module", &open);

View File

@@ -26,6 +26,13 @@ bool ChatServer::onEvent(const Archimedes::Event& event) {
static std::string s; s = std::string((const char*)e.msg->m_pData, e.msg->m_cbSize);
if(s == "/quit") {
sm->disconnectClient(e.msg->m_conn);
} else if(s == "/shutdown") {
sm->stopServer();
app->end();
}
std::cerr << "Server Recieved: " << s << std::endl;
for(auto& it : sm->getClients()) {