changed a lot of thread locking code in the server, rooms are working with ISL now

This commit is contained in:
Max-Wilhelm Bruker
2012-03-17 16:09:00 +01:00
parent 572e4eaafa
commit c23af44749
16 changed files with 449 additions and 221 deletions

View File

@@ -88,11 +88,9 @@ class Command_ShutdownServer;
class Server_ProtocolHandler : public QObject, public Server_AbstractUserInterface {
Q_OBJECT
protected:
QMap<int, QPair<Server_Game *, Server_Player *> > games;
QMap<int, QPair<int, int> > games; // gameId -> (roomId, playerId)
QMap<int, Server_Room *> rooms;
QPair<Server_Game *, Server_Player *> getGame(int gameId) const;
AuthenticationResult authState;
bool acceptsUserListChanges;
bool acceptsRoomListChanges;
@@ -100,6 +98,8 @@ protected:
void prepareDestroy();
int sessionId;
private:
QMutex gameListMutex;
QList<int> messageSizeOverTime, messageCountOverTime;
int timeRunning, lastDataReceived;
QTimer *pingClock;
@@ -175,8 +175,6 @@ private slots:
signals:
void logDebugMessage(const QString &message, Server_ProtocolHandler *session);
public:
QMutex gameListMutex;
Server_ProtocolHandler(Server *_server, QObject *parent = 0);
~Server_ProtocolHandler();
void playerRemovedFromGame(Server_Game *game);