Files
Client/Server/AdminTool/AdminToolLibrary/Ryl_ModifyCharacterMgr.cpp
LGram16 dd97ddec92 Restructure repository to include all source folders
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>
2025-11-29 20:17:20 +09:00

85 lines
1.9 KiB
C++

#include "stdafx.h"
#include < Network/Session/Session.h>
#include < Network/Dispatch/Dispatch.h >
#include < Character/ModifyCharacter.h >
// CModifyCharacterMgr ----------------------------------------------------------
// 해당 UID를 편집중인 관리자들에게 해당 패킷을 보낸다
void CModifyCharacterMgr::isUIDSendAll(unsigned long dwUID, CBuffer* lpBuffer)
{
iterator pos = begin();
for(;pos != end(); ++pos)
{
CModifyCharacter* Character = pos->second;
if(dwUID == Character->GetUID())
{
CPacketDispatch* lpPacketDispatch = Character->GetDispatch();
if(NULL != lpPacketDispatch)
{
CSession& lpSession = lpPacketDispatch->GetSession();
lpSession.Send( /*lpBuffer*/ );
}
}
}
}
// 편집 하고자하는 캐릭터를 등록한다.
CModifyCharacter* CModifyCharacterMgr::InsertChar(unsigned long dwCID)
{
CModifyCharacter* lpModifyCharacter = CreateCharacter();
m_mapModifyChar.insert(std::make_pair(dwCID, lpModifyCharacter));
return lpModifyCharacter;
}
// 편집이 끝났거나 해당 Session이 닫히면 캐릭터를 지워주자.
bool CModifyCharacterMgr::EraseChar(unsigned long dwCID)
{
isMapCharList::iterator itr = m_mapModifyChar.find(dwCID);
if(itr != m_mapModifyChar.end())
{
delete itr->second;
m_mapModifyChar.erase(itr);
return true;
}
return false;
}
// 리스트에 등록되어있는 캐릭터데이터를 찾는다
CModifyCharacter* CModifyCharacterMgr::GetCharacter(unsigned long dwCID)
{
isMapCharList::iterator itr = m_mapModifyChar.find(dwCID);
if(itr != m_mapModifyChar.end())
return itr->second;
return NULL;
}
// 현재 Dispatch를 사용하는 캐릭터를 찾아 전부 리스트에서 삭제
void CModifyCharacterMgr::AllRemoveChar(CPacketDispatch* lpPacketDispatch)
{
isMapCharList::iterator itr = m_mapModifyChar.begin();
for(; itr != m_mapModifyChar.end();)
{
CPacketDispatch* lpDispatch = itr->second->GetDispatch();
if(lpDispatch == lpPacketDispatch)
{
delete itr->second;
m_mapModifyChar.erase(itr++);
}
else
{
++itr;
}
}
}