|
@@ -174,6 +174,7 @@ void Session::dispatch_line(std::string line) {
|
|
|
|
|
|
if (temp.find("TradeWars Game Server ") != std::string::npos) {
|
|
|
to_client("\rTradeWars Proxy v2++ READY (~ to activate)\n\r");
|
|
|
+ game = 0;
|
|
|
// reset "active game" -- we're back at the menu
|
|
|
}
|
|
|
|
|
@@ -184,8 +185,11 @@ void Session::dispatch_line(std::string line) {
|
|
|
if (temp.find("Selection (? for menu): ") != std::string::npos) {
|
|
|
char ch = temp[temp.length() - 1];
|
|
|
if (ch >= 'A' && ch < 'Q') {
|
|
|
- BUGZ_LOG(warning) << "GAME " << ch << " activated!";
|
|
|
+ game = ch;
|
|
|
+ BUGZ_LOG(warning) << "GAME " << game << " activated!";
|
|
|
}
|
|
|
+ if (ch == 'Q')
|
|
|
+ game = 0;
|
|
|
}
|
|
|
|
|
|
// "Selection (? for menu): ?"
|
|
@@ -543,9 +547,11 @@ Server::Server(boost::asio::io_service &io_service,
|
|
|
: io_service_{io_service}, acceptor_{io_service_, endpoint}, host_{host},
|
|
|
port_{port} {
|
|
|
only_one = from_config("one_connection", "0") == "1";
|
|
|
+ BUGZ_LOG(info) << "Server::Server()";
|
|
|
do_accept();
|
|
|
}
|
|
|
|
|
|
+Server::~Server() { BUGZ_LOG(info) << "Server::~Server()"; }
|
|
|
/**
|
|
|
* setup async connect accept
|
|
|
*
|
|
@@ -562,8 +568,9 @@ void Server::do_accept(void) {
|
|
|
->start();
|
|
|
}
|
|
|
|
|
|
- if (!only_one)
|
|
|
+ if (!only_one) {
|
|
|
do_accept();
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|