Files
Client/Server/AdminTool/AdminToolClient/PacketManager.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

1556 lines
56 KiB
C++

#include "stdafx.h"
#include "PacketManager.h"
#include "AdminToolClient.h"
#include "CharacterDoc.h"
#include "GlobalFunctions.h"
#include <Stream/Buffer/Buffer.h>
#include <Network/XORCrypt/XORCrypt.h>
#include <Network/Packet/WrapPacket.h>
#include <Network/Protocol/RYL_AdminMgrProtocol.h>
#include <Network/SingleSession/ClientSingleSession.h>
#include <Network/Packet/PacketStruct/ServerPacket.h>
#include <Network/Packet/PacketStruct/GuildPacket.h>
#include <Network/Packet/PacketStruct/ServerInfo.h>
#include <Log/ServerLog.h>
CPacketMgr::CPacketMgr()
: m_lpSession(NULL)
{
}
CPacketMgr* CPacketMgr::GetInstance()
{
static CPacketMgr cPacketMgr;
return &cPacketMgr;
}
void CPacketMgr::SetSession(CSingleSession* pSession)
{
m_lpSession = pSession;
}
bool CPacketMgr::StreamSend(CBuffer *pSendBuffer)
{
if(!m_lpSession)
{
ERRLOG0(g_Log, "NULL 세션으로 정보 전송을 시도 했습니다");
return false;
}
return m_lpSession->Send(pSendBuffer);
}
bool CPacketMgr::SendLogin(CString Account, CString Password)
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktLogin ) );
PktAdminMgr::PktLogin* lpPktLogin = reinterpret_cast< PktAdminMgr::PktLogin* >( lpBuffer->begin( ) );
if( Account.GetLength( ) < PktAdminMgr::MAX_ACCOUNT )
{
strncpy( lpPktLogin->m_szAccount, CONV_NETSTRING(Account), Account.GetLength( ) );
lpPktLogin->m_szAccount[ Account.GetLength( ) ] = '\0';
}
if( Password.GetLength( ) < PktAdminMgr::MAX_PASSWORD )
{
strncpy( lpPktLogin->m_szPasswd, CONV_NETSTRING(Password), Password.GetLength( ) );
lpPktLogin->m_szPasswd[ Password.GetLength( ) ] = '\0';
}
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktLogin ), PktAdminMgr::PktCMD::PktLogin, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendPktChangePos(unsigned long dwServer, unsigned long dwRequest, unsigned long dwUID,
unsigned long dwCID, char cZone, float fPosX, float fPosY, float fPosZ)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktChangePos));
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktChangePos* lpPktChangePos =
reinterpret_cast<PktAdminMgr::PktChangePos*>(lpBuffer->begin());
lpPktChangePos->m_dwServerGroup = dwServer;
lpPktChangePos->m_dwRequest = dwRequest;
lpPktChangePos->m_dwCID = dwCID;
lpPktChangePos->m_dwUID = dwUID;
lpPktChangePos->m_cZone = cZone;
lpPktChangePos->m_fPosX = fPosX;
lpPktChangePos->m_fPosY = fPosY;
lpPktChangePos->m_fPosZ = fPosZ;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktChangePos), PktAdminMgr::PktCMD::PktChangePos, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktSkillEdit(unsigned long dwUID, unsigned long dwCID, unsigned long dwServerGroup,
unsigned long dwRequest, unsigned short SkillID, char cLevel,
char cLockCount, unsigned char cType )
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktSkillEdit));
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktSkillEdit* lpPktSkillEdit =
reinterpret_cast<PktAdminMgr::PktSkillEdit*>(lpBuffer->begin());
lpPktSkillEdit->m_dwUID = dwUID;
lpPktSkillEdit->m_dwCID = dwCID;
lpPktSkillEdit->m_dwServerGroup = dwServerGroup;
lpPktSkillEdit->m_dwRequest = dwRequest;
lpPktSkillEdit->m_wSkillID = SkillID;
lpPktSkillEdit->m_SkillLevel = cLevel;
lpPktSkillEdit->m_SkillLockCount = cLockCount;
lpPktSkillEdit->m_cType = cType;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktSkillEdit), PktAdminMgr::PktCMD::PktSkillEdit, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktDepositPwd( unsigned long dwUID, unsigned long dwCID, unsigned long dwServerGroup, unsigned long dwRequestKey, TCHAR* szPasswd )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktDepositPasswd ) );
PktAdminMgr::PktDepositPasswd* lpPktDepositPwd = reinterpret_cast< PktAdminMgr::PktDepositPasswd* >( lpBuffer->begin( ) );
lpPktDepositPwd->m_dwCID = dwCID;
lpPktDepositPwd->m_dwUID = dwUID;
lpPktDepositPwd->m_dwServerGroup = dwServerGroup;
lpPktDepositPwd->m_dwRequest = dwRequestKey;
strncpy( lpPktDepositPwd->m_cPasswd, CONV_NETSTRING(szPasswd), PktAdminMgr::PktDepositPasswd::PASSWORD_LENGTH );
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktDepositPasswd ), PktAdminMgr::PktCMD::PktDepositPasswd, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendDelCharHistory( unsigned char cType, unsigned long dwServerGroup, unsigned long dwValue )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktDelCharList ) );
PktAdminMgr::PktDelCharList* lpPktDelCharList = reinterpret_cast< PktAdminMgr::PktDelCharList* >( lpBuffer->begin( ) );
lpPktDelCharList->m_cType = cType;
lpPktDelCharList->m_dwServerGroup = dwServerGroup;
lpPktDelCharList->m_dwValue = dwValue;
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktDelCharList ), PktAdminMgr::PktCMD::PktDelCharList, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendInvenGold( unsigned long dwUID, unsigned long dwCID, unsigned long dwServerGroup, unsigned long dwRequestKey, unsigned long dwGold )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktInvenGold ) );
PktAdminMgr::PktInvenGold* lpPktInvenGold = reinterpret_cast< PktAdminMgr::PktInvenGold* >( lpBuffer->begin( ) );
lpPktInvenGold->m_dwUID = dwUID;
lpPktInvenGold->m_dwCID = dwCID;
lpPktInvenGold->m_dwServerGroup = dwServerGroup;
lpPktInvenGold->m_dwRequest = dwRequestKey;
lpPktInvenGold->m_dwGold = dwGold;
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktInvenGold ), PktAdminMgr::PktCMD::PktInvenGold, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendBeforeAfter( unsigned int DetailLogID )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktBeforeAfter ) );
PktAdminMgr::PktBeforeAfter* lpBeforeAfter = reinterpret_cast< PktAdminMgr::PktBeforeAfter* >( lpBuffer->begin( ) );
lpBeforeAfter->m_DetailLogID = DetailLogID;
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktBeforeAfter ), PktAdminMgr::PktCMD::PktBeforeAfter, 0 , 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::RequestAdminList( )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktBase ) );
PktBase* lpPktAdminList = reinterpret_cast< PktBase* >( lpBuffer->begin( ) );
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktBase ), PktAdminMgr::PktCMD::PktAdminList, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendDetailLog( unsigned int LogID )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktDetailLog ) );
PktAdminMgr::PktDetailLog* lpPktDetailLog = reinterpret_cast< PktAdminMgr::PktDetailLog* >( lpBuffer->begin( ) );
lpPktDetailLog->m_LogID = LogID;
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktDetailLog ), PktAdminMgr::PktCMD::PktDetailLog, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendNewAdmin(CString szAccount, CString szPassword,
CString szName, CString szLevel, CString szIP)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktNewAdmin));
PktAdminMgr::PktNewAdmin* lpPktNewAdmin = reinterpret_cast<PktAdminMgr::PktNewAdmin*>(lpBuffer->begin());
strncpy(lpPktNewAdmin->m_szAccount, CONV_NETSTRING(szAccount), szAccount.GetLength());
strncpy(lpPktNewAdmin->m_szPasswd, CONV_NETSTRING(szPassword), szPassword.GetLength());
strncpy(lpPktNewAdmin->m_szName, CONV_NETSTRING(szName), szName.GetLength());
strncpy(lpPktNewAdmin->m_szIP, CONV_NETSTRING(szIP), szIP.GetLength());
lpPktNewAdmin->m_szLev = GetAdminLVInitial(szLevel);
if(!lpPktNewAdmin->m_szLev) return false;
lpPktNewAdmin->m_szAccount[szAccount.GetLength()] = '\0';
lpPktNewAdmin->m_szPasswd[szPassword.GetLength()] = '\0';
lpPktNewAdmin->m_szName[szName.GetLength()] = '\0';
lpPktNewAdmin->m_szIP[szIP.GetLength()] = '\0';
PacketWrap::WrapCrypt(lpBuffer, sizeof(PktAdminMgr::PktNewAdmin), PktAdminMgr::PktCMD::PktNewAdmin, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendUpdateLevel(CString szAccount, CString szLevel)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUpdateLevel));
PktAdminMgr::PktUpdateLevel* lpPktUpdateLevel =
reinterpret_cast<PktAdminMgr::PktUpdateLevel*>(lpBuffer->begin());
strncpy(lpPktUpdateLevel->m_szAccount, CONV_NETSTRING(szAccount), szAccount.GetLength());
lpPktUpdateLevel->m_szAccount[szAccount.GetLength()] = '\0';
lpPktUpdateLevel->m_szLevel = GetAdminLVInitial(szLevel);
PacketWrap::WrapCrypt(lpBuffer, sizeof(PktAdminMgr::PktUpdateLevel), PktAdminMgr::PktCMD::PktUpdateLevel, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendUpdateIP(CString szAccount, CString szIP)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUpdateIP));
PktAdminMgr::PktUpdateIP* lpPktUpdateIP = reinterpret_cast<PktAdminMgr::PktUpdateIP*>(lpBuffer->begin());
strncpy(lpPktUpdateIP->m_szAccount, CONV_NETSTRING(szAccount), szAccount.GetLength());
strncpy(lpPktUpdateIP->m_szIP, CONV_NETSTRING(szIP), szIP.GetLength());
lpPktUpdateIP->m_szAccount [ szAccount.GetLength( ) ] = '\0';
lpPktUpdateIP->m_szIP [ szIP.GetLength( ) ] = '\0';
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktUpdateIP ), PktAdminMgr::PktCMD::PktUpdateIP, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendUpdatePassword( CString szAccount, CString szPassword )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktUpdatePasswd ) );
PktAdminMgr::PktUpdatePasswd* lpPktUpdatePwd = reinterpret_cast< PktAdminMgr::PktUpdatePasswd* >( lpBuffer->begin( ) );
strncpy( lpPktUpdatePwd->m_szAccount, CONV_NETSTRING(szAccount), szAccount.GetLength( ) );
strncpy( lpPktUpdatePwd->m_szPasswd, CONV_NETSTRING(szPassword), szPassword.GetLength( ) );
lpPktUpdatePwd->m_szAccount [ szAccount.GetLength( ) ] = '\0';
lpPktUpdatePwd->m_szPasswd [ szPassword.GetLength( ) ] = '\0';
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktUpdatePasswd ), PktAdminMgr::PktCMD::PktUpdatePasswd, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendDeleteAdmin( CString szAccount )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktDelAdmin ) );
PktAdminMgr::PktDelAdmin* lpPktDelAdmin = reinterpret_cast< PktAdminMgr::PktDelAdmin* >( lpBuffer->begin( ) );
strncpy( lpPktDelAdmin->m_szAccount, CONV_NETSTRING(szAccount), szAccount.GetLength( ) );
lpPktDelAdmin->m_szAccount[ szAccount.GetLength( ) ] = '\0';
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktDelAdmin ), PktAdminMgr::PktCMD::PktDelAdmin, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendLogList( TCHAR* szAccount )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktLogList ) );
PktAdminMgr::PktLogList* lpLogList = reinterpret_cast< PktAdminMgr::PktLogList* >( lpBuffer->begin( ) );
strncpy( lpLogList->m_szAccount, CONV_NETSTRING(szAccount), PktAdminMgr::MAX_ACCOUNT );
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktLogList ), PktAdminMgr::PktCMD::PktLogList, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendExitLog( CString szExitLog )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktLogUseMessage ) );
PktAdminMgr::PktLogUseMessage* lpPktExitLog = reinterpret_cast< PktAdminMgr::PktLogUseMessage* >( lpBuffer->begin( ) );
strncpy( lpPktExitLog->m_UseMessage, CONV_NETSTRING(szExitLog), szExitLog.GetLength( ) );
lpPktExitLog->m_UseMessage[ szExitLog.GetLength( ) ] = '\0';
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktLogUseMessage ), PktAdminMgr::PktCMD::PktLogUseMessage, 0, 0 );
return StreamSend( lpBuffer );
}
// ID로 검색했을때 정보 보내기
bool CPacketMgr::SendSearchID(unsigned char cSearchType, unsigned long dwServerGroup,
unsigned long SearchID, unsigned int nOldServerID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktSearchID));
PktAdminMgr::PktSearchID* lpSearchInfo =
reinterpret_cast<PktAdminMgr::PktSearchID*>(lpBuffer->begin());
CCharacterDoc& CharDoc = CCharacterDoc::GetInstance();
CCharacterDoc::CharDocInfo* lpCharDocInfo = new CCharacterDoc::CharDocInfo;
// CID 일때만 서버그룹 저장
if(PktAdminMgr::PktSearchID::SearchCID == cSearchType)
{
lpSearchInfo->m_dwServerGroup = dwServerGroup;
lpSearchInfo->m_SearchType = PktAdminMgr::PktSearchID::SearchCID;
}
else
{
lpSearchInfo->m_SearchType = PktAdminMgr::PktSearchID::SearchUID;
}
lpSearchInfo->m_dwID = SearchID;
lpSearchInfo->m_dwRequestKey = CharDoc.PushCharDocInfo(lpCharDocInfo);
// 서버타입이 UnifiedConst::Part2Selectable 일때 사용.
lpSearchInfo->m_nOldServerID = nOldServerID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktSearchID), PktAdminMgr::PktCMD::PktSearchID, 0, 0);
return StreamSend(lpBuffer);
}
// 이름으로 검색했을때 정보 보내기
bool CPacketMgr::SendSearchName(unsigned char cSearchType, unsigned long dwServerGroup,
CString SearchName, unsigned int nOldServerID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktSearchName));
PktAdminMgr::PktSearchName* lpSearchInfo =
reinterpret_cast<PktAdminMgr::PktSearchName*>(lpBuffer->begin());
CCharacterDoc& CharDoc = CCharacterDoc::GetInstance();
CCharacterDoc::CharDocInfo* lpCharDocInfo = new CCharacterDoc::CharDocInfo;
// 캐릭명일때만 서버그룹 저장
if(PktAdminMgr::PktSearchName::Character == cSearchType)
{
lpSearchInfo->m_dwServerGroup = dwServerGroup;
lpSearchInfo->m_SearchType = PktAdminMgr::PktSearchName::Character;
}
else
{
lpSearchInfo->m_SearchType = PktAdminMgr::PktSearchName::Account;
}
lpSearchInfo->m_dwRequestKey = CharDoc.PushCharDocInfo(lpCharDocInfo);
_snprintf(lpSearchInfo->m_szName, sizeof(lpSearchInfo->m_szName), "%s", CONV_NETSTRING(SearchName));
// 서버타입이 UnifiedConst::Part2Selectable 일때 사용.
lpSearchInfo->m_nOldServerID = nOldServerID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktSearchName), PktAdminMgr::PktCMD::PktSearchName, 0, 0);
return StreamSend(lpBuffer);
}
// 트리에서 선택 한 캐릭터 정보 보내기
bool CPacketMgr::SendSelCharacter(TCHAR* CharName, unsigned long m_dwServerGroup, unsigned char cOldServerGroupID,
unsigned long m_dwUID, unsigned long m_dwCID, unsigned long m_dwRequestKey)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGetCharacter));
PktAdminMgr::PktGetCharacter* lpGetCharacterInfo =
reinterpret_cast<PktAdminMgr::PktGetCharacter*>(lpBuffer->begin());
strncpy(lpGetCharacterInfo->m_szCharName, CONV_NETSTRING(CharName), PktAdminMgr::MAX_NAME);
lpGetCharacterInfo->m_dwServerGroup = m_dwServerGroup;
lpGetCharacterInfo->m_dwUID = m_dwUID;
lpGetCharacterInfo->m_dwCID = m_dwCID;
lpGetCharacterInfo->m_cOldServerGroupID = cOldServerGroupID;
lpGetCharacterInfo->m_dwRequestKey = m_dwRequestKey;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktGetCharacter), PktAdminMgr::PktCMD::PktGetCharacter, 0, 0);
return StreamSend(lpBuffer);
}
// 에디팅 상태 해제 캐릭터 정보 보내기
bool CPacketMgr::SendCloseCharacter(unsigned long m_dwServerGroup, unsigned long m_dwCID, unsigned int dwDocKey)
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof(PktAdminMgr::PktCloseCharacter) );
PktAdminMgr::PktCloseCharacter* lpPktCloseCharacter = reinterpret_cast< PktAdminMgr::PktCloseCharacter* >( lpBuffer->begin() );
lpPktCloseCharacter->m_dwServerGroup = m_dwServerGroup;
lpPktCloseCharacter->m_dwCID = m_dwCID;
lpPktCloseCharacter->m_dwRequestKey = dwDocKey;
PacketWrap::WrapCrypt( lpBuffer, sizeof(PktAdminMgr::PktCloseCharacter), PktAdminMgr::PktCMD::PktCloseCharacter, 0, 0);
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendUpdateStatus( unsigned long m_dwServerGroup, unsigned long m_dwCID, unsigned long m_dwUID,
unsigned long m_dwRequestKey, PktAdminMgr::CHAR_STATUS_ST stStatus )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUpdateStatus) );
PktAdminMgr::PktUpdateStatus* lpPktUpdateStatus = reinterpret_cast< PktAdminMgr::PktUpdateStatus* >( lpBuffer->begin() );
lpPktUpdateStatus->m_dwServerGroup = m_dwServerGroup;
lpPktUpdateStatus->m_dwCID = m_dwCID;
lpPktUpdateStatus->m_dwUID = m_dwUID;
lpPktUpdateStatus->m_dwRequestKey = m_dwRequestKey;
lpPktUpdateStatus->m_stStatus = stStatus;
PacketWrap::WrapCrypt( lpBuffer, sizeof(PktAdminMgr::PktUpdateStatus), PktAdminMgr::PktCMD::PktUpdateStatus, 0, 0);
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendPktBlockUser(unsigned char cServerGroup, unsigned long dwUID, TCHAR* szCharacterName,
unsigned char cBlockTarget, unsigned char cBlockTerm, TCHAR* szFinishDate,
TCHAR* szDescription)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktAddBlockUser));
PktAdminMgr::PktAddBlockUser* lpPktAddBlockUser =
reinterpret_cast<PktAdminMgr::PktAddBlockUser*>(lpBuffer->begin());
lpPktAddBlockUser->m_cServerGroup = cServerGroup;
lpPktAddBlockUser->m_dwUID = dwUID;
lpPktAddBlockUser->m_cBlockTarget = cBlockTarget;
lpPktAddBlockUser->m_cBlockTerm = cBlockTerm;
strncpy(lpPktAddBlockUser->m_szCharacterName, CONV_NETSTRING(szCharacterName), PktAdminMgr::MAX_NAME);
strncpy(lpPktAddBlockUser->m_szBlockFinishDateTime, CONV_NETSTRING(szFinishDate), PktAdminMgr::MAX_TIME);
strncpy(lpPktAddBlockUser->m_szDescription, CONV_NETSTRING(szDescription), PktAdminMgr::PktAddBlockUser::MAX_DESCRIPTION);
lpPktAddBlockUser->m_szCharacterName[PktAdminMgr::MAX_NAME - 1] = 0;
lpPktAddBlockUser->m_szBlockFinishDateTime[PktAdminMgr::MAX_TIME - 1] = 0;
lpPktAddBlockUser->m_szDescription[PktAdminMgr::PktAddBlockUser::MAX_DESCRIPTION - 1] = 0;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktAddBlockUser), PktAdminMgr::PktCMD::PktAddBlockUser, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendDelBlockUser(unsigned char cServerGroup, unsigned long nidx, TCHAR* szCharName)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktDelBlockUser));
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return true;
}
PktAdminMgr::PktDelBlockUser* lpDelBlock =
reinterpret_cast<PktAdminMgr::PktDelBlockUser*>(lpBuffer->begin());
lpDelBlock->m_cServerGroup = cServerGroup;
lpDelBlock->m_nidx = nidx;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktDelBlockUser), PktAdminMgr::PktCMD::PktDelBlockUser, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktSearchBlock(unsigned long dwServerGroup)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktSearchBlock));
PktAdminMgr::PktSearchBlock* lpBlock =
reinterpret_cast<PktAdminMgr::PktSearchBlock*>(lpBuffer->begin());
lpBlock->m_dwServerGroup = dwServerGroup;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktSearchBlock), PktAdminMgr::PktCMD::PktSearchBlock, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendCreateItem( unsigned long m_dwServerGroup, unsigned long m_dwCID, unsigned long m_dwUID,
unsigned long m_dwRequestKey, PktAdminMgr::CreateItemInfo stCreateItemInfo )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof(PktAdminMgr::PktCreateItem) );
PktAdminMgr::PktCreateItem* lpPktCreateItem = reinterpret_cast< PktAdminMgr::PktCreateItem* >( lpBuffer->begin() );
lpPktCreateItem->m_dwServerGroup = m_dwServerGroup;
lpPktCreateItem->m_dwCID = m_dwCID;
lpPktCreateItem->m_dwUID = m_dwUID;
lpPktCreateItem->m_dwRequestKey = m_dwRequestKey;
lpPktCreateItem->m_CreateItemInfo = stCreateItemInfo;
PacketWrap::WrapCrypt( lpBuffer, sizeof(PktAdminMgr::PktCreateItem), PktAdminMgr::PktCMD::PktCreateItem, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendUpdateItem(unsigned long dwServerGroup, unsigned long dwCID, unsigned long dwUID,
unsigned long dwRequestKey, unsigned __int64 dwItemSerial,
unsigned short dwItemProtoTypeID, PktAdminMgr::CreateItemInfo stUpdateItemInfo)
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUpdateItem) );
PktAdminMgr::PktUpdateItem* lpPktUpdateItem = reinterpret_cast< PktAdminMgr::PktUpdateItem* >( lpBuffer->begin() );
lpPktUpdateItem->m_dwServerGroup = dwServerGroup;
lpPktUpdateItem->m_dwCID = dwCID;
lpPktUpdateItem->m_dwUID = dwUID;
lpPktUpdateItem->m_dwRequestKey = dwRequestKey;
lpPktUpdateItem->m_ItemUID = dwItemSerial;
lpPktUpdateItem->m_ItemPrototypeID = dwItemProtoTypeID;
lpPktUpdateItem->m_UpdataItemInfo = stUpdateItemInfo;
PacketWrap::WrapCrypt( lpBuffer, sizeof(PktAdminMgr::PktUpdateItem), PktAdminMgr::PktCMD::PktUpdateItem, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendRemoveItem( unsigned long dwServerGroup, unsigned long dwCID, unsigned long dwUID,
unsigned long dwRequestKey, unsigned __int64 dwItemSerial,
unsigned short dwItemProtoTypeID, Item::ItemPos stItemPos )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof(PktAdminMgr::PktRemoveItem) );
PktAdminMgr::PktRemoveItem* lpPktRemoveItem = reinterpret_cast< PktAdminMgr::PktRemoveItem* >( lpBuffer->begin() );
lpPktRemoveItem->m_dwServerGroup = dwServerGroup;
lpPktRemoveItem->m_dwCID = dwCID;
lpPktRemoveItem->m_dwUID = dwUID;
lpPktRemoveItem->m_dwRequestKey = dwRequestKey;
lpPktRemoveItem->m_ItemUID = dwItemSerial;
lpPktRemoveItem->m_ItemPrototypeID = dwItemProtoTypeID;
lpPktRemoveItem->m_cTakePos = stItemPos.m_cPos;
lpPktRemoveItem->m_cXPos = stItemPos.GetXIndex();
lpPktRemoveItem->m_cYPos = stItemPos.GetYIndex();
lpPktRemoveItem->m_cZPos = stItemPos.GetZIndex();
PacketWrap::WrapCrypt( lpBuffer, sizeof(PktAdminMgr::PktRemoveItem), PktAdminMgr::PktCMD::PktRemoveItem, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendSetCharacter(unsigned long m_dwServerGroup, unsigned long m_dwCID,
unsigned long m_dwUID, unsigned long m_dwRequestKey,
unsigned char cOldServerGroupID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktSetCharacter));
PktAdminMgr::PktSetCharacter* lpPktSetCharacter =
reinterpret_cast<PktAdminMgr::PktSetCharacter*>(lpBuffer->begin());
lpPktSetCharacter->m_dwServerGroup = m_dwServerGroup;
lpPktSetCharacter->m_dwCID = m_dwCID;
lpPktSetCharacter->m_dwUID = m_dwUID;
lpPktSetCharacter->m_dwRequestKey = m_dwRequestKey;
lpPktSetCharacter->m_cOldServerGroupID = cOldServerGroupID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktSetCharacter), PktAdminMgr::PktCMD::PktSetCharacter, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendItemContainerReset(unsigned long dwServerGroup, unsigned long dwUID,
unsigned long dwCID, unsigned long dwRequest, unsigned char cTakePos)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktItemReset));
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return true;
}
PktAdminMgr::PktItemReset* lpItemReset = reinterpret_cast<PktAdminMgr::PktItemReset*>(lpBuffer->begin());
lpItemReset->m_dwServerGroup = dwServerGroup;
lpItemReset->m_dwRequest = dwRequest;
lpItemReset->m_dwUID = dwUID;
lpItemReset->m_dwCID = dwCID;
lpItemReset->m_cTakePos = cTakePos;
PacketWrap::WrapCrypt(lpBuffer, sizeof(PktAdminMgr::PktItemReset), PktAdminMgr::PktCMD::PktItemReset, 0, 0);
return StreamSend(lpBuffer);
};
bool CPacketMgr::SendPktSetZoneList( )
{
CCharacterDoc& CharacterDoc = CCharacterDoc::GetInstance( );
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktSetZoneList ) );
PktAdminMgr::PktSetZoneList* lpPktSetZone = reinterpret_cast< PktAdminMgr::PktSetZoneList* >( lpBuffer->begin( ) );
unsigned short nBufferPos = PktAdminMgr::PktSetZoneList::MAX_BUFFER;
if(CharacterDoc.GetZoneList().Serialize_Out(lpPktSetZone->m_ZoneBuffer, nBufferPos))
{
int PktLength = ( sizeof( PktAdminMgr::PktSetZoneList ) - PktAdminMgr::PktSetZoneList::MAX_BUFFER ) + nBufferPos;
PacketWrap::WrapCrypt( lpBuffer, PktLength, PktAdminMgr::PktCMD::PktSetZoneList, 0, 0 );
return StreamSend( lpBuffer );
}
return true;
}
bool CPacketMgr::SendPktCheckName(unsigned long dwServerGroup, unsigned long dwRequestKey, TCHAR* szName)
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktCheckName ) );
PktAdminMgr::PktCheckName* lpPktCheckName = reinterpret_cast< PktAdminMgr::PktCheckName*> ( lpBuffer->begin( ) );
lpPktCheckName->m_dwServerGroup = dwServerGroup;
lpPktCheckName->m_dwRequest = dwRequestKey;
_snprintf( lpPktCheckName->m_szCharacterName, PktAdminMgr::MAX_NAME, "%s", CONV_NETSTRING(szName) );
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktCheckName ), PktAdminMgr::PktCMD::PktCheckName, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendPktChangeName(unsigned long dwUID, unsigned long dwCID, unsigned long dwServerGroup,
unsigned long dwRequestKey, TCHAR* szName)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktChangeName));
PktAdminMgr::PktChangeName* lpPktChangeName =
reinterpret_cast<PktAdminMgr::PktChangeName*>(lpBuffer->begin());
lpPktChangeName->m_dwUID = dwUID;
lpPktChangeName->m_dwCID = dwCID;
lpPktChangeName->m_dwServerGroup = dwServerGroup;
lpPktChangeName->m_dwRequest = dwRequestKey;
_snprintf(lpPktChangeName->m_szCharacterName, PktAdminMgr::MAX_NAME, "%s", CONV_NETSTRING(szName));
PacketWrap::WrapCrypt(lpBuffer, sizeof(PktAdminMgr::PktChangeName), PktAdminMgr::PktCMD::PktChangeName, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktAdminStoreInsert( unsigned char cServerGroup, TCHAR* szOwnerName, TCHAR* szItemName, char* ItemInfo )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktAdminStoreInsert ) );
PktAdminMgr::PktAdminStoreInsert* lpStore = reinterpret_cast< PktAdminMgr::PktAdminStoreInsert* >( lpBuffer->begin( ) );
lpStore->m_cServerIdx = cServerGroup;
strncpy( lpStore->m_szOwnerName, CONV_NETSTRING(szOwnerName), PktAdminMgr::MAX_NAME );
strncpy( lpStore->m_szItemName, CONV_NETSTRING(szItemName), PktAdminMgr::MAX_ITEM_NAME );
CopyMemory( lpStore->m_binItemInfo, ItemInfo, PktAdminMgr::PktAdminStoreInsert::MAX_ITEM_INFO );
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktAdminStoreInsert ), PktAdminMgr::PktCMD::PktAdminStoreInsert, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendPktAdminStoreDelete( unsigned long dwStoreUID )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktAdminStoreDelete ) );
PktAdminMgr::PktAdminStoreDelete* lpPktStoreDel = reinterpret_cast< PktAdminMgr::PktAdminStoreDelete* >( lpBuffer->begin( ) );
lpPktStoreDel->m_dwStoreUID = dwStoreUID;
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktAdminStoreDelete ), PktAdminMgr::PktCMD::PktAdminStoreDelete, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendPktGetAdminStoreItem(unsigned char cType, unsigned long dwStoreUID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGetAdminStoreItem));
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktGetAdminStoreItem* lpPktGet =
reinterpret_cast<PktAdminMgr::PktGetAdminStoreItem*>(lpBuffer->begin());
lpPktGet->m_cType = cType;
lpPktGet->m_dwStoreUID = dwStoreUID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktGetAdminStoreItem), PktAdminMgr::PktCMD::PktGetAdminStoreItem, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktUpdateAdminStore( )
{
CBuffer* lpBuffer = CREATE_BUFFER( m_DefaultBufferFactory, sizeof( PktAdminMgr::PktUpdateAdminStore ) );
PktAdminMgr::PktUpdateAdminStore* lpUpdateStore = reinterpret_cast< PktAdminMgr::PktUpdateAdminStore* >( lpBuffer->begin( ) );
unsigned long dwLength = 0;
lpUpdateStore->m_dwStoreUID = g_stMyItemInfo.m_dwStoreUID;
g_stMyItemInfo.m_stItemInfo.AdminStore_Out( lpUpdateStore->m_binItemInfo, dwLength );
PacketWrap::WrapCrypt( lpBuffer, sizeof( PktAdminMgr::PktUpdateAdminStore ), PktAdminMgr::PktCMD::PktUpdateAdminStore, 0, 0 );
return StreamSend( lpBuffer );
}
bool CPacketMgr::SendPktCharRestore(unsigned long dwUID, unsigned long dwCID,
unsigned char cNewServerGroupID, unsigned char cOldServerGroupID,
unsigned long dwServerGroup)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktCharRestore));
PktAdminMgr::PktCharRestore* lpCharRestore =
reinterpret_cast<PktAdminMgr::PktCharRestore*>(lpBuffer->begin());
lpCharRestore->m_dwUID = dwUID;
lpCharRestore->m_dwCID = dwCID;
lpCharRestore->m_cNewServerGroupID = cNewServerGroupID;
lpCharRestore->m_cOldServerGroupID = cOldServerGroupID;
lpCharRestore->m_dwServerGroup = dwServerGroup;
PacketWrap::WrapHeader(lpBuffer, sizeof(PktAdminMgr::PktCharRestore), PktAdminMgr::PktCMD::PktCharRestore, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktDelCharacter(unsigned long dwUID, unsigned long dwCID,
unsigned long dwServerGroup, unsigned long dwRequestKey)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktDelCharacter));
PktAdminMgr::PktDelCharacter* lpPktDelChar =
reinterpret_cast<PktAdminMgr::PktDelCharacter*>(lpBuffer->begin());
lpPktDelChar->m_dwUID = dwUID;
lpPktDelChar->m_dwCID = dwCID;
lpPktDelChar->m_dwServerGroup = dwServerGroup;
lpPktDelChar->m_dwRequestKey = dwRequestKey;
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktDelCharacter), PktAdminMgr::PktCMD::PktDelCharacter, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendForcedDis(unsigned long dwUID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktUK));
LPPktUK lpPktUK = reinterpret_cast<LPPktUK>(lpBuffer->begin());
lpPktUK->m_dwUserID = dwUID;
lpPktUK->m_dwServerID = lpPktUK->m_dwCharID = 0;
PacketWrap::WrapCrypt(lpBuffer, sizeof(PktUK), PktAdminMgr::PktCMD::PktForcedDis, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendGuildSearch(unsigned char cSearchType, unsigned long dwServerGroup, TCHAR* szSearchValue)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGuildSearch));
PktAdminMgr::PktGuildSearch* lpPktGuildSearch =
reinterpret_cast<PktAdminMgr::PktGuildSearch*>(lpBuffer->begin());
lpPktGuildSearch->m_cSearchType = cSearchType;
lpPktGuildSearch->m_dwServerGroup = dwServerGroup;
_snprintf(lpPktGuildSearch->m_szSearchValue, MAX_PATH, "%s", CONV_NETSTRING(szSearchValue));
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktGuildSearch), PktAdminMgr::PktCMD::PktGuildSearch, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendRequestGuildMemberList(unsigned long dwGID, unsigned long dwServerGroup)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktRequestGuildMemberList));
PktAdminMgr::PktRequestGuildMemberList* lpPktRequestGuildMemberList =
reinterpret_cast<PktAdminMgr::PktRequestGuildMemberList*>(lpBuffer->begin());
lpPktRequestGuildMemberList->m_dwGID = dwGID;
lpPktRequestGuildMemberList->m_dwServerGroup = dwServerGroup;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktRequestGuildMemberList), PktAdminMgr::PktCMD::PktRequestGuildMemberList, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendGuildRestoreDataList(bool bAllGroupChk, unsigned long dwServerGroup)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGuildRestoreDataList));
PktAdminMgr::PktGuildRestoreDataList* lpPktGuildRestoreDataList =
reinterpret_cast<PktAdminMgr::PktGuildRestoreDataList*>(lpBuffer->begin());
lpPktGuildRestoreDataList->m_dwServerGroup = dwServerGroup;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktGuildRestoreDataList), PktAdminMgr::PktCMD::PktGuildRestoreDataList, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendFortSearch(unsigned char cSearchType, unsigned long dwServerGroup, unsigned long dwZoneGroup, TCHAR* szSearchValue)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktFortSearch));
PktAdminMgr::PktFortSearch* lpPktFortSearch =
reinterpret_cast<PktAdminMgr::PktFortSearch*>(lpBuffer->begin());
lpPktFortSearch->m_cSearchType = cSearchType;
lpPktFortSearch->m_dwServerGroup = dwServerGroup;
lpPktFortSearch->m_dwZoneGroup = dwZoneGroup;
_snprintf(lpPktFortSearch->m_szSearchValue, MAX_PATH, "%s", CONV_NETSTRING(szSearchValue));
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktFortSearch), PktAdminMgr::PktCMD::PktFortSearch, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendMiningCamp(unsigned long dwServerGroup, unsigned long dwCampID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktMiningCamp));
PktAdminMgr::PktMiningCamp* lpPktMiningCamp =
reinterpret_cast<PktAdminMgr::PktMiningCamp*>(lpBuffer->begin());
lpPktMiningCamp->m_dwServerGroup = dwServerGroup;
lpPktMiningCamp->m_dwCampID = dwCampID;
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktMiningCamp), PktAdminMgr::PktCMD::PktMiningCamp, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendShopCamp(unsigned long dwServerGroup, unsigned long dwCampID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktShopCamp));
PktAdminMgr::PktShopCamp* lpPktShopCamp =
reinterpret_cast<PktAdminMgr::PktShopCamp*>(lpBuffer->begin());
lpPktShopCamp->m_dwServerGroup = dwServerGroup;
lpPktShopCamp->m_dwCampID = dwCampID;
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktShopCamp), PktAdminMgr::PktCMD::PktShopCamp, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendShopCampGold(unsigned long dwServerGroup, unsigned long dwCampID, unsigned long dwTempMoney)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktShopCampGold));
PktAdminMgr::PktShopCampGold* lpPktShopCampGold =
reinterpret_cast<PktAdminMgr::PktShopCampGold*>(lpBuffer->begin());
lpPktShopCampGold->m_dwServerGroup = dwServerGroup;
lpPktShopCampGold->m_dwCampID = dwCampID;
lpPktShopCampGold->m_dwTempMoney = dwTempMoney;
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktShopCampGold), PktAdminMgr::PktCMD::PktShopCampGold, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendShopCampTax(unsigned long dwServerGroup, unsigned long dwCampID, unsigned long dwTax)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktShopCampTax));
PktAdminMgr::PktShopCampTax* lpPktShopCampTax =
reinterpret_cast<PktAdminMgr::PktShopCampTax*>(lpBuffer->begin());
lpPktShopCampTax->m_dwServerGroup = dwServerGroup;
lpPktShopCampTax->m_dwCampID = dwCampID;
lpPktShopCampTax->m_dwTax = dwTax;
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktShopCampTax), PktAdminMgr::PktCMD::PktShopCampTax, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendCastleSearch(unsigned char cSearchType, unsigned long dwServerGroup, unsigned long dwZoneGroup, TCHAR* szSearchValue)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktCastleSearch));
PktAdminMgr::PktCastleSearch* lpPktCastleSearch =
reinterpret_cast<PktAdminMgr::PktCastleSearch*>(lpBuffer->begin());
lpPktCastleSearch->m_cSearchType = cSearchType;
lpPktCastleSearch->m_dwServerGroup = dwServerGroup;
lpPktCastleSearch->m_dwZoneGroup = dwZoneGroup;
_snprintf(lpPktCastleSearch->m_szSearchValue, MAX_PATH, "%s", CONV_NETSTRING(szSearchValue));
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktCastleSearch), PktAdminMgr::PktCMD::PktCastleSearch, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendCastleCreature(unsigned long dwServerGroup, unsigned long dwCastleID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktCastleCreature));
PktAdminMgr::PktCastleCreature* lpPktCastleCreature =
reinterpret_cast<PktAdminMgr::PktCastleCreature*>(lpBuffer->begin());
lpPktCastleCreature->m_dwServerGroup = dwServerGroup;
lpPktCastleCreature->m_dwCastleID = dwCastleID;
PacketWrap::WrapCrypt(
lpBuffer,sizeof(PktAdminMgr::PktCastleCreature), PktAdminMgr::PktCMD::PktCastleCreature, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendItemQtyControlData(unsigned char cType, unsigned char cServerGroup, unsigned long dwItemTypeID,
time_t tStartTime, time_t tEndTime, unsigned long dwItemQty)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktItemQtyControl));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktItemQtyControl* lpPktItemQtyControl =
reinterpret_cast<PktAdminMgr::PktItemQtyControl*>(lpBuffer->begin());
lpPktItemQtyControl->m_cType = cType;
lpPktItemQtyControl->m_cServerGroup = cServerGroup;
lpPktItemQtyControl->m_dwItemTypeID = dwItemTypeID;
lpPktItemQtyControl->m_tStartTime = tStartTime;
lpPktItemQtyControl->m_tEndTime = tEndTime;
lpPktItemQtyControl->m_dwItemQty = dwItemQty;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktItemQtyControl), PktAdminMgr::PktCMD::PktItemQtyControl, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendStoreGoldUpdate(unsigned long dwUID, unsigned long dwCID, unsigned long dwServerGroup,
unsigned long dwRequestKey, unsigned long dwGold)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktStoreGoldUpdate));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktStoreGoldUpdate* lpPktStoreGoldUpdate =
reinterpret_cast<PktAdminMgr::PktStoreGoldUpdate*>(lpBuffer->begin());
lpPktStoreGoldUpdate->m_dwUID = dwUID;
lpPktStoreGoldUpdate->m_dwCID = dwCID;
lpPktStoreGoldUpdate->m_dwServerGroup = dwServerGroup;
lpPktStoreGoldUpdate->m_dwRequest = dwRequestKey;
lpPktStoreGoldUpdate->m_dwGold = dwGold;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktStoreGoldUpdate), PktAdminMgr::PktCMD::PktStoreGoldUpdate, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendUserBillingLogRequest(unsigned char cSearchType, CString strSearchValue,
COleDateTime tStartTime, COleDateTime tEndTime)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUserBillingLog));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktUserBillingLog* lpPktUserBillingLog =
reinterpret_cast<PktAdminMgr::PktUserBillingLog*>(lpBuffer->begin());
lpPktUserBillingLog->m_cSearchType = cSearchType;
_snprintf(lpPktUserBillingLog->m_szSearchValue, 100, "%s", CONV_NETSTRING(strSearchValue));
lpPktUserBillingLog->m_tStartTime = tStartTime;
lpPktUserBillingLog->m_tEndTime = tEndTime;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktUserBillingLog), PktAdminMgr::PktCMD::PktUserBillingLog, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendGameAdmin(unsigned char cPktType, unsigned long dwServerGroup, unsigned long dwUID,
unsigned int nAdminLV, TCHAR* szStartIP, TCHAR* szEndIP)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGameAdmin));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktGameAdmin* lpPktGameAdmin =
reinterpret_cast<PktAdminMgr::PktGameAdmin*>(lpBuffer->begin());
lpPktGameAdmin->m_cPktType = cPktType;
lpPktGameAdmin->m_dwServerGroup = dwServerGroup;
lpPktGameAdmin->m_dwUID = dwUID;
// 여기부턴 패킷타입에 따라 초기값이 들어갈수도..
lpPktGameAdmin->m_nAdminLV = nAdminLV;
_snprintf(lpPktGameAdmin->m_szStartIP, PktAdminMgr::MAX_IP, "%s", CONV_NETSTRING(szStartIP));
_snprintf(lpPktGameAdmin->m_szEndIP, PktAdminMgr::MAX_IP, "%s", CONV_NETSTRING(szEndIP));
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktGameAdmin), PktAdminMgr::PktCMD::PktGameAdmin, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendConnectAllServerz(void)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktConnectAllServerz));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktConnectAllServerz), PktAdminMgr::PktCMD::PktConnectAllServerz, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendRefrechConnectedServerList(void)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktConnectAllServerz));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktConnectAllServerz), PktAdminMgr::PktCMD::PktRefreshConnectedList, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktInterestedUser(unsigned char cPktType, TCHAR* szAccount, TCHAR* szReason)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktInterestedUser));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktInterestedUser* lpPktInterestedUser =
reinterpret_cast<PktAdminMgr::PktInterestedUser*>(lpBuffer->begin());
lpPktInterestedUser->m_cPktType = cPktType;
_snprintf(lpPktInterestedUser->m_szAccount, PktAdminMgr::MAX_ACCOUNT, "%s", CONV_NETSTRING(szAccount));
_snprintf(lpPktInterestedUser->m_szReason, MAX_PATH, "%s", CONV_NETSTRING(szReason));
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktInterestedUser), PktAdminMgr::PktCMD::PktInterestedUser, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktConnectionChk(unsigned char cPktType, TCHAR* szAccount)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktConnectionChk));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktConnectionChk* lpPktConnectionChk =
reinterpret_cast<PktAdminMgr::PktConnectionChk*>(lpBuffer->begin());
lpPktConnectionChk->m_cPktType = cPktType;
_snprintf(lpPktConnectionChk->m_szAccount, PktAdminMgr::MAX_ACCOUNT, "%s", CONV_NETSTRING(szAccount));
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktConnectionChk), PktAdminMgr::PktCMD::PktConnectionChk, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::ReqConnectedUserList()
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktBase));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktBase), PktAdminMgr::PktCMD::PktConnectedUserList, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendSearchDupItem(unsigned long dwServerGroup, bool bIsChk)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktDuplicatedItem));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktDuplicatedItem* lpPktDuplicatedItem =
reinterpret_cast<PktAdminMgr::PktDuplicatedItem*>(lpBuffer->begin());
lpPktDuplicatedItem->m_cPktType = PktAdminMgr::PktDuplicatedItem::SEARCH;
lpPktDuplicatedItem->m_dwServerGroup = dwServerGroup;
lpPktDuplicatedItem->m_bChk = bIsChk;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktDuplicatedItem), PktAdminMgr::PktCMD::PktDuplicatedItem, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendChkDupItem(unsigned long dwUID, unsigned long dwCID,
unsigned long dwServerGroup, unsigned __int64 i64ItemSerial)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktDuplicatedItem));
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktDuplicatedItem* lpPktDuplicatedItem =
reinterpret_cast<PktAdminMgr::PktDuplicatedItem*>(lpBuffer->begin());
lpPktDuplicatedItem->m_cPktType = PktAdminMgr::PktDuplicatedItem::CHK;
lpPktDuplicatedItem->m_dwUID = dwUID;
lpPktDuplicatedItem->m_dwCID = dwCID;
lpPktDuplicatedItem->m_dwServerGroup = dwServerGroup;
lpPktDuplicatedItem->m_dwItemUID = i64ItemSerial;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktDuplicatedItem), PktAdminMgr::PktCMD::PktDuplicatedItem, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktItemDistribute(const PktAdminMgr::CreateItemInfo& stCreateItemInfo,
PktAdminMgr::DstUserInfo* lpDstUserInfo, unsigned char cDstUserInfoNum)
{
unsigned short MAX_DISTRIBUTE_PACKET_SIZE =
static_cast<unsigned short>(sizeof(PktAdminMgr::PktItemDistribute) +
sizeof(PktAdminMgr::DstUserInfo) * cDstUserInfoNum);
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, MAX_DISTRIBUTE_PACKET_SIZE);
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktItemDistribute* lpPktItemDistribute =
reinterpret_cast<PktAdminMgr::PktItemDistribute*>(lpBuffer->begin());
lpPktItemDistribute->m_stDistributeItem = stCreateItemInfo;
lpPktItemDistribute->m_cUserNum = cDstUserInfoNum;
PktAdminMgr::DstUserInfo* lpPktDstUserInfo =
reinterpret_cast<PktAdminMgr::DstUserInfo*>(lpPktItemDistribute + 1);
memcpy(lpPktDstUserInfo, lpDstUserInfo, sizeof(PktAdminMgr::DstUserInfo) * cDstUserInfoNum);
PacketWrap::WrapCrypt(lpBuffer,
MAX_DISTRIBUTE_PACKET_SIZE, PktAdminMgr::PktCMD::PktItemDistribute, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktGuildRight(unsigned long dwServerGroup, unsigned long dwGID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGuildRight));
if(NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return true;
}
PktAdminMgr::PktGuildRight* lpPktGuildRight =
reinterpret_cast<PktAdminMgr::PktGuildRight*>(lpBuffer->begin());
lpPktGuildRight->m_dwServerGroup = dwServerGroup;
lpPktGuildRight->m_dwGID = dwGID;
PacketWrap::WrapHeader(lpBuffer,
sizeof(PktAdminMgr::PktGuildRight), PktAdminMgr::PktCMD::PktGuildRight, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktUnifiedCharInfo(unsigned char cPktType, unsigned long dwServerGroup,
unsigned int nOldServerGroup, char* szSearchValue)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUnifiedCharInfo));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktUnifiedCharInfo* lpPktUnifiedCharInfo =
reinterpret_cast<PktAdminMgr::PktUnifiedCharInfo*>(lpBuffer->begin());
lpPktUnifiedCharInfo->m_cPktType = cPktType;
lpPktUnifiedCharInfo->m_dwServerGroup = dwServerGroup;
lpPktUnifiedCharInfo->m_nOldServerGroup = nOldServerGroup;
_snprintf(lpPktUnifiedCharInfo->m_szSearchValue, PktAdminMgr::MAX_ACCOUNT, szSearchValue);
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktUnifiedCharInfo), PktAdminMgr::PktCMD::PktUnifiedCharInfo, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktUnifiedGuildInfo(unsigned char cPktType, unsigned long dwServerGroup,
unsigned int nOldServerGroup)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUnifiedGuildInfo));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktUnifiedGuildInfo* lpPktUnifiedGuildInfo =
reinterpret_cast<PktAdminMgr::PktUnifiedGuildInfo*>(lpBuffer->begin());
lpPktUnifiedGuildInfo->m_cPktType = cPktType;
lpPktUnifiedGuildInfo->m_dwServerGroup = dwServerGroup;
lpPktUnifiedGuildInfo->m_nOldServerGroupID = nOldServerGroup;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktUnifiedGuildInfo), PktAdminMgr::PktCMD::PktUnifiedGuildInfo, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktDetailCharInfo(unsigned long dwServerGroup, unsigned long dwCID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktDetailCharInfo));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktDetailCharInfo* lpPktDetailCharInfo =
reinterpret_cast<PktAdminMgr::PktDetailCharInfo*>(lpBuffer->begin());
lpPktDetailCharInfo->m_dwServerGroup = dwServerGroup;
lpPktDetailCharInfo->m_dwCID = dwCID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktDetailCharInfo), PktAdminMgr::PktCMD::PktDetailCharInfo, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendCancelExecuteQuest(unsigned long dwRequestKey, unsigned long dwServerGroup,
unsigned long dwCID, unsigned short wQuestID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktCancelExecuteQuest));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktCancelExecuteQuest* lpPktCancelExecuteQuest =
reinterpret_cast<PktAdminMgr::PktCancelExecuteQuest*>(lpBuffer->begin());
lpPktCancelExecuteQuest->m_dwRequestKey = dwRequestKey;
lpPktCancelExecuteQuest->m_dwServerGroup = dwServerGroup;
lpPktCancelExecuteQuest->m_dwCID = dwCID;
lpPktCancelExecuteQuest->m_wQuestID = wQuestID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktCancelExecuteQuest), PktAdminMgr::PktCMD::PktCancelExecuteQuest, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendDeleteHistoryQuest(unsigned long dwRequestKey, unsigned long dwServerGroup,
unsigned long dwCID, unsigned short wQuestID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktDeleteHistoryQuest));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktDeleteHistoryQuest* lpPktDeleteHistoryQuest =
reinterpret_cast<PktAdminMgr::PktDeleteHistoryQuest*>(lpBuffer->begin());
lpPktDeleteHistoryQuest->m_dwRequestKey = dwRequestKey;
lpPktDeleteHistoryQuest->m_dwServerGroup = dwServerGroup;
lpPktDeleteHistoryQuest->m_dwCID = dwCID;
lpPktDeleteHistoryQuest->m_wQuestID = wQuestID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktDeleteHistoryQuest), PktAdminMgr::PktCMD::PktDeleteHistoryQuest, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktUserNation(unsigned long dwRequestKey, unsigned long dwServerGroup,
unsigned long dwUID, unsigned long dwCID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktUserNation));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktUserNation* lpPktUserNation =
reinterpret_cast<PktAdminMgr::PktUserNation*>(lpBuffer->begin());
lpPktUserNation->m_dwRequestKey = dwRequestKey;
lpPktUserNation->m_dwServerGroup = dwServerGroup;
lpPktUserNation->m_dwUID = dwUID;
lpPktUserNation->m_dwCID = dwCID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktUserNation), PktAdminMgr::PktCMD::PktUserNation, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktShiftToUID(unsigned char cPktType, const char* szAccount, unsigned long dwUID)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktShiftToUID));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktShiftToUID* lpPktShiftToUID =
reinterpret_cast<PktAdminMgr::PktShiftToUID*>(lpBuffer->begin());
lpPktShiftToUID->m_cPktType = cPktType;
strncpy(lpPktShiftToUID->m_szAccount, szAccount, PktAdminMgr::MAX_ACCOUNT);
lpPktShiftToUID->m_dwUID = dwUID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktShiftToUID), PktAdminMgr::PktCMD::PktShiftToUID, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktStoreTabEdit(unsigned long dwRequestKey, unsigned long dwServerGroup,
unsigned long dwCID, unsigned int nTabNum)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktStoreTabEdit));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktStoreTabEdit* lpPktStoreTabEdit =
reinterpret_cast<PktAdminMgr::PktStoreTabEdit*>(lpBuffer->begin());
lpPktStoreTabEdit->m_dwRequestKey = dwRequestKey;
lpPktStoreTabEdit->m_dwServerGroup = dwServerGroup;
lpPktStoreTabEdit->m_dwCID = dwCID;
lpPktStoreTabEdit->m_nTabNum = nTabNum;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktStoreTabEdit), PktAdminMgr::PktCMD::PktStoreTabEdit, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktAmountOfGold(unsigned long dwServerGroup)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktAmountOfGold));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktAmountOfGold* lpPktAmountOfGold =
reinterpret_cast<PktAdminMgr::PktAmountOfGold*>(lpBuffer->begin());
lpPktAmountOfGold->m_dwServerGroup = dwServerGroup;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktAmountOfGold), PktAdminMgr::PktCMD::PktAmountOfGold, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktGMLogMsg(unsigned char cPktType, unsigned long dwServerGroup,
unsigned long dwUID, unsigned long dwCID,
unsigned long dwLogID, const char* szLogMsg)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGMLogMsg));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktGMLogMsg* lpPktGMLogMsg =
reinterpret_cast<PktAdminMgr::PktGMLogMsg*>(lpBuffer->begin());
lpPktGMLogMsg->m_cPktType = cPktType;
lpPktGMLogMsg->m_dwServerGroup = dwServerGroup;
lpPktGMLogMsg->m_dwUID = dwUID;
lpPktGMLogMsg->m_dwCID = dwCID;
lpPktGMLogMsg->m_dwLogID = dwLogID;
strncpy(lpPktGMLogMsg->m_szLogMsg, szLogMsg, PktAdminMgr::MAX_LOG);
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktGMLogMsg), PktAdminMgr::PktCMD::PktGMLogMsg, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktNameChangeCount(unsigned long dwServerGroup, unsigned long dwCID,
unsigned char cNameChangeCount)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktNameChangeCount));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktNameChangeCount* lpPktNameChangeCount =
reinterpret_cast<PktAdminMgr::PktNameChangeCount*>(lpBuffer->begin());
lpPktNameChangeCount->m_cNameChangeCount = cNameChangeCount;
lpPktNameChangeCount->m_dwServerGroup = dwServerGroup;
lpPktNameChangeCount->m_dwCID = dwCID;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktNameChangeCount), PktAdminMgr::PktCMD::PktNameChangeCount, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendPktGuildMemberEdit(unsigned long dwServerGroup, unsigned long dwGID, unsigned long dwCID,
unsigned char cPosition, unsigned char cType)
{
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktGuildMemberEdit));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktGuildMemberEdit* lpPktGuildMemberEdit =
reinterpret_cast<PktAdminMgr::PktGuildMemberEdit*>(lpBuffer->begin());
lpPktGuildMemberEdit->m_cType = cType;
lpPktGuildMemberEdit->m_dwServerGroup = dwServerGroup;
lpPktGuildMemberEdit->m_dwGID = dwGID;
lpPktGuildMemberEdit->m_dwCID = dwCID;
lpPktGuildMemberEdit->m_cPosition = cPosition;
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktGuildMemberEdit), PktAdminMgr::PktCMD::PktGuildMemberEdit, 0, 0);
return StreamSend(lpBuffer);
}
bool CPacketMgr::SendSearchCharInfoTime(unsigned char sSearchType, unsigned long dwServerGroup, CString strSearchValue)
{
using namespace PktAdminMgr;
CBuffer* lpBuffer = CREATE_BUFFER(m_DefaultBufferFactory, sizeof(PktAdminMgr::PktCharInfoTime));
if (NULL == lpBuffer)
{
ERRLOG0(g_Log, "버퍼 생성 실패");
return false;
}
PktAdminMgr::PktCharInfoTime* lpPktCharInfoTime =
reinterpret_cast<PktAdminMgr::PktCharInfoTime*>(lpBuffer->begin());
lpPktCharInfoTime->m_SearchType = sSearchType;
lpPktCharInfoTime->m_dwServerGroup = dwServerGroup;
if(PktAdminMgr::PktCharInfoTime::Type::SearchCID == sSearchType)
{
lpPktCharInfoTime->m_dwCID = _ttoi(strSearchValue);
ZeroMemory(lpPktCharInfoTime->m_szName, MAX_CHARNAME);
}
else
{
lpPktCharInfoTime->m_dwCID = 0;
strncpy(lpPktCharInfoTime->m_szName, CONV_NETSTRING(strSearchValue), MAX_CHARNAME);
}
PacketWrap::WrapCrypt(lpBuffer,
sizeof(PktAdminMgr::PktCharInfoTime), PktAdminMgr::PktCMD::PktGetCharInfoTime, 0, 0);
return StreamSend(lpBuffer);
}