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>
70 lines
2.3 KiB
C++
70 lines
2.3 KiB
C++
#include "stdafx.h"
|
|
#include "ManageClientManager.h"
|
|
|
|
#include <Network/Session/Session.h>
|
|
#include <Network/Dispatch/SendManagePacket.h>
|
|
|
|
#include <Log/ServerLog.h>
|
|
|
|
bool CManageClientManager::SendRunInfo(CSession& Session, const RunTable& runTable)
|
|
{
|
|
if(!runTable.empty())
|
|
{
|
|
CManageClientManager::RunTable::const_iterator pos = runTable.begin();
|
|
CManageClientManager::RunTable::const_iterator end = runTable.end();
|
|
|
|
const int MAX_RUN_INFO = (PktMaxLen - sizeof(ServerManage::ManageCommand)) / sizeof(ServerManage::RunInfo);
|
|
ServerManage::RunInfo tempRunInfo[MAX_RUN_INFO];
|
|
|
|
if(!ServerManage::SendManagePacket(Session, ServerManage::CMD::UpdateRunList,
|
|
0, 0, 0, 0, 0, ServerManage::SEND_RUNINFO_START, 0, 0))
|
|
{
|
|
ERRLOG1(g_Log, "SS:0x%p/UpdateRunList : SendRunInfoStart packet failed", &Session);
|
|
return false;
|
|
}
|
|
|
|
int nRunInfo = 0;
|
|
|
|
for(;pos != end; ++pos)
|
|
{
|
|
tempRunInfo[nRunInfo] = pos->second;
|
|
|
|
++nRunInfo;
|
|
|
|
if(nRunInfo == MAX_RUN_INFO)
|
|
{
|
|
if(!ServerManage::SendManagePacket(Session,
|
|
ServerManage::CMD::UpdateRunList,
|
|
0, 0, 0, 0, nRunInfo * sizeof(ServerManage::RunInfo),
|
|
ServerManage::SEND_RUNINFO_NOW, tempRunInfo, 0))
|
|
{
|
|
ERRLOG1(g_Log, "SS:0x%p/UpdateRunList : SendRunInfoNow packet failed", &Session);
|
|
return false;
|
|
}
|
|
|
|
nRunInfo = 0;
|
|
}
|
|
}
|
|
|
|
if(0 < nRunInfo)
|
|
{
|
|
if(!ServerManage::SendManagePacket(Session, ServerManage::CMD::UpdateRunList,
|
|
0, 0, 0, 0, nRunInfo * sizeof(ServerManage::RunInfo),
|
|
ServerManage::SEND_RUNINFO_NOW, tempRunInfo, 0))
|
|
{
|
|
ERRLOG1(g_Log, "SS:0x%p/UpdateRunList : SendRunInfoNow packet failed", &Session);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if(!ServerManage::SendManagePacket(Session, ServerManage::CMD::UpdateRunList,
|
|
0, 0, 0, 0, 0, ServerManage::SEND_RUNINFO_FINISH, 0, 0))
|
|
{
|
|
ERRLOG1(g_Log, "SS:0x%p/UpdateRunList : SendRunInfoFinish packet failed", &Session);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|