add some server commands
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user