Merge branch 'master' of git.barant.com:barant/ServerCore
This commit is contained in:
commit
dc6b1dcc56
8 files changed
+222
-55
No files matched your search
+5
-5
@@ -214,7 +214,7 @@ namespace core {
|
||||
// (combat, position, chat) go through, so this is very likely the
|
||||
// actual dominant cause of that crash, not just the ItemDataBase
|
||||
// subscriber list this session's earlier fix addressed.
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
std::lock_guard guard(lock);
|
||||
int sequence = 0;
|
||||
for (auto &sessionx : sessions)
|
||||
{
|
||||
@@ -226,14 +226,14 @@ namespace core {
|
||||
}
|
||||
|
||||
void TCPServer::sendToAll(std::stringstream &data) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
std::lock_guard guard(lock);
|
||||
for (auto &session : sessions)
|
||||
session->write(data.str());
|
||||
data.str("");
|
||||
}
|
||||
|
||||
void TCPServer::sendToAll(std::stringstream &data, TCPSession &sender) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
std::lock_guard guard(lock);
|
||||
for (auto &session : sessions)
|
||||
if (session.get() != &sender)
|
||||
session->write(data.str());
|
||||
@@ -241,7 +241,7 @@ namespace core {
|
||||
}
|
||||
|
||||
void TCPServer::sendToAll(std::stringstream &data, TCPSession &sender, SessionFilter filter) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
std::lock_guard guard(lock);
|
||||
for (auto &session : sessions)
|
||||
if (filter.test(*session))
|
||||
if (session.get() != &sender)
|
||||
@@ -251,7 +251,7 @@ namespace core {
|
||||
|
||||
std::shared_ptr<TCPSession> TCPServer::getSessionByAlias(void *alias) {
|
||||
coreutils::Log(coreutils::LOG_DEBUG_1) << alias;
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
std::lock_guard guard(lock);
|
||||
for (auto &session : sessions)
|
||||
if (session->alias == alias)
|
||||
return session;
|
||||
|
||||
Reference in new issue
Block a user