Ticket #1454: patch4.diff
File patch4.diff, 1.7 KB (added by , 20 years ago) |
---|
-
ServerThread.cpp
969 969 LeaveCritSection(m_threadsync); 970 970 } 971 971 972 std::list<CServerThread::t_Notification> CServerThread::GetNotifications()972 void CServerThread::GetNotifications(std::list<CServerThread::t_Notification>& list) 973 973 { 974 974 EnterCritSection(m_threadsync); 975 975 976 std::list<t_Notification> list = m_pendingNotifications; 977 m_pendingNotifications.clear(); 976 m_pendingNotifications.swap(list); 978 977 979 978 if (m_throttled) 980 979 SetPriority(THREAD_PRIORITY_NORMAL); 981 980 982 981 LeaveCritSection(m_threadsync); 983 984 return list;985 982 } 986 983 987 984 void CServerThread::AntiHammerIncrease(DWORD ip) -
ServerThread.h
69 69 }; 70 70 71 71 void SendNotification(WPARAM wParam, LPARAM lParam); 72 std::list<t_Notification> GetNotifications();72 void GetNotifications(std::list<t_Notification>& list); // list MUST be empty when entering! 73 73 74 74 void AntiHammerIncrease(DWORD ip); 75 75 -
Server.cpp
213 213 CServerThread *pThread = pServer->m_ThreadNotificationIDs[index]; 214 214 if (pThread) 215 215 { 216 std::list<CServerThread::t_Notification> notifications = pThread->GetNotifications(); 216 std::list<CServerThread::t_Notification> notifications; 217 pThread->GetNotifications(notifications); 217 218 for (std::list<CServerThread::t_Notification>::const_iterator iter = notifications.begin(); iter != notifications.end(); iter++) 218 219 if (pServer->OnServerMessage(pThread, iter->wParam, iter->lParam) != 0) 219 220 break;