Limit the avatar requests by the server - clients may only upload one avatar within a certain time. This is checked by IP address, so two players within the same NAT system might have to wait for a few seconds.
This commit is contained in:
@@ -90,8 +90,9 @@ protected:
|
||||
typedef std::deque<boost::shared_ptr<ConnectData> > ConnectQueue;
|
||||
typedef std::deque<SessionWrapper> SessionQueue;
|
||||
typedef std::list<SessionWrapper> SessionList;
|
||||
typedef std::map<SessionId, boost::timers::portable::microsec_timer> InitTimerSessionMap;
|
||||
typedef std::map<SessionId, boost::timers::portable::microsec_timer> TimerSessionMap;
|
||||
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<boost::shared_ptr<SenderThread> > SenderThreadList;
|
||||
|
||||
@@ -115,6 +116,7 @@ protected:
|
||||
void CloseSessionLoop();
|
||||
void RemoveGameLoop();
|
||||
void KickPlayerLoop();
|
||||
void UpdateAvatarClientTimerLoop();
|
||||
void CleanupAvatarCache();
|
||||
|
||||
void InternalAddGame(boost::shared_ptr<ServerGameThread> game);
|
||||
@@ -164,9 +166,12 @@ private:
|
||||
SessionManager m_sessionManager;
|
||||
SessionManager m_gameSessionManager;
|
||||
|
||||
InitTimerSessionMap m_initTimerSessionMap;
|
||||
TimerSessionMap m_initTimerSessionMap;
|
||||
mutable boost::mutex m_initTimerSessionMapMutex;
|
||||
|
||||
TimerClientAddressMap m_timerAvatarClientAddressMap;
|
||||
mutable boost::mutex m_timerAvatarClientAddressMapMutex;
|
||||
|
||||
RemoveGameList m_removeGameList;
|
||||
mutable boost::mutex m_removeGameListMutex;
|
||||
|
||||
@@ -176,6 +181,7 @@ private:
|
||||
PlayerDataMap m_computerPlayers;
|
||||
mutable boost::mutex m_computerPlayersMutex;
|
||||
|
||||
|
||||
GameMap m_gameMap;
|
||||
|
||||
boost::shared_ptr<ReceiverHelper> m_receiver;
|
||||
|
||||
Reference in New Issue
Block a user