Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.0 KiB
C++
53 lines
1.0 KiB
C++
#include "stdafx.h"
|
|
|
|
#include "ClientDispatchTable.h"
|
|
#include "RYL_AdminMgrDispatch.h"
|
|
#include <./Network/Session/Session.h>
|
|
#include <Stream/Buffer/Buffer.h>
|
|
|
|
|
|
void CClientDispatchTable::insert(CRylAdminMgrDispatch * lpDispatch)
|
|
{
|
|
DispatchLock::Syncronize Lock(m_DispatchLock);
|
|
|
|
m_lstDispatch.push_back(lpDispatch);
|
|
}
|
|
|
|
void CClientDispatchTable::erase(CRylAdminMgrDispatch * lpDispatch)
|
|
{
|
|
DispatchLock::Syncronize Lock(m_DispatchLock);
|
|
|
|
lstDispatch::iterator Itr_ =
|
|
std::find(m_lstDispatch.begin(), m_lstDispatch.end(), lpDispatch);
|
|
|
|
if(m_lstDispatch.end() != Itr_)
|
|
{
|
|
m_lstDispatch.erase(Itr_);
|
|
}
|
|
}
|
|
|
|
bool CClientDispatchTable::SendAll(CBuffer * lpBuffer)
|
|
{
|
|
bool bResult = true;
|
|
|
|
DispatchLock::Syncronize Lock(m_DispatchLock);
|
|
|
|
lstDispatch::iterator Itr_ = m_lstDispatch.begin();
|
|
lstDispatch::iterator end_ = m_lstDispatch.end();
|
|
|
|
for(;Itr_ != end_;)
|
|
{
|
|
CRylAdminMgrDispatch * lpDispatch = (*Itr_);
|
|
|
|
CSession & Session = lpDispatch->GetSession();
|
|
|
|
if(!Session.SendPending(lpBuffer))
|
|
{
|
|
bResult = false;
|
|
}
|
|
|
|
++ Itr_;
|
|
}
|
|
|
|
return bResult;
|
|
} |