mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-22 07:10:25 -08:00
removed recursive lock in server; moved object serialisation to worker thread
This commit is contained in:
@@ -38,6 +38,8 @@ Server_ProtocolHandler::~Server_ProtocolHandler()
|
||||
{
|
||||
}
|
||||
|
||||
// This function must only be called from the thread this object lives in.
|
||||
// The thread must not hold any server locks when calling this (e.g. clientsLock, roomsLock).
|
||||
void Server_ProtocolHandler::prepareDestroy()
|
||||
{
|
||||
if (deleted)
|
||||
@@ -399,6 +401,8 @@ Response::ResponseCode Server_ProtocolHandler::cmdGetGamesOfUser(const Command_G
|
||||
if (authState == NotLoggedIn)
|
||||
return Response::RespLoginNeeded;
|
||||
|
||||
// XXX This does not take external users into account.
|
||||
// XXX Maybe remove this check and test if the result list is empty at the end.
|
||||
server->clientsLock.lockForRead();
|
||||
if (!server->getUsers().contains(QString::fromStdString(cmd.user_name())))
|
||||
return Response::RespNameNotFound;
|
||||
|
||||
Reference in New Issue
Block a user