Merge branch 'main' into linux
This commit is contained in:
commit
54c71536b1
10 files changed
+131
-131
No files matched your search
+1
-1
@@ -25,7 +25,6 @@ Session::Session(Server& server, tcp::socket&& socket, int id)
|
||||
}
|
||||
|
||||
bool Session::is_timed_out(std::chrono::system_clock::time_point now) const {
|
||||
if (!joined_) return false;
|
||||
auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(now - lastReceivedTime_).count();
|
||||
return elapsed > PLAYER_TIMEOUT_MS;
|
||||
}
|
||||
@@ -268,6 +267,7 @@ void Session::process_message(const std::string& msg) {
|
||||
std::lock_guard<std::mutex> lock(server_.g_sessions_mutex);
|
||||
for (auto& session : server_.g_sessions) {
|
||||
if (session->get_id() == this->id_) continue;
|
||||
if (!session->joined_) continue;
|
||||
std::string otherInfo = "PLAYERINFO:" + std::to_string(session->get_id()) + ":" + session->nickname + ":" + std::to_string(session->shipType);
|
||||
|
||||
this->send_message(otherInfo);
|
||||
|
||||
Reference in new issue
Block a user