Fixed one thread per session implementation. Kind of. Still seems to have a handle leak on Windows. However, it does not scale at all and needs to be reverted. It won't even handle 500 players with 500 games on a dual core high end machine.
This commit is contained in:
@@ -77,6 +77,7 @@ public:
|
||||
void RemoveComputerPlayer(boost::shared_ptr<PlayerData> player);
|
||||
|
||||
void RemoveGame(unsigned id);
|
||||
void RemoveSender(unsigned session);
|
||||
|
||||
u_int32_t GetNextUniquePlayerId();
|
||||
u_int32_t GetNextGameId();
|
||||
@@ -97,6 +98,8 @@ protected:
|
||||
typedef std::map<unsigned, boost::shared_ptr<ServerGameThread> > GameMap;
|
||||
typedef std::map<std::string, boost::timers::portable::microsec_timer> TimerClientAddressMap;
|
||||
typedef std::list<unsigned> RemoveGameList;
|
||||
typedef std::list<unsigned> RemoveSenderList;
|
||||
typedef std::map<unsigned, boost::shared_ptr<SenderInterface> >SenderMap;
|
||||
|
||||
// Main function of the thread.
|
||||
virtual void Main();
|
||||
@@ -117,6 +120,7 @@ protected:
|
||||
void NewSessionLoop();
|
||||
void RemoveGameLoop();
|
||||
void RemovePlayerLoop();
|
||||
void RemoveSenderLoop();
|
||||
void ResubscribeLobbyMsgLoop();
|
||||
void CheckSessionTimeoutsLoop();
|
||||
void UpdateAvatarClientTimerLoop();
|
||||
@@ -179,6 +183,9 @@ private:
|
||||
RemovePlayerList m_removePlayerList;
|
||||
mutable boost::mutex m_removePlayerListMutex;
|
||||
|
||||
RemoveSenderList m_removeSenderList;
|
||||
mutable boost::mutex m_removeSenderListMutex;
|
||||
|
||||
PlayerDataMap m_computerPlayers;
|
||||
mutable boost::mutex m_computerPlayersMutex;
|
||||
|
||||
@@ -186,6 +193,7 @@ private:
|
||||
mutable boost::mutex m_resubscribeListMutex;
|
||||
|
||||
GameMap m_gameMap;
|
||||
SenderMap m_senderMap;
|
||||
|
||||
boost::shared_ptr<ReceiverHelper> m_receiver;
|
||||
boost::shared_ptr<ServerSenderCallback> m_senderCallback;
|
||||
|
||||
Reference in New Issue
Block a user