#include "stdafx.h" #include "Commands.h" #include #include #include #include #include #include #include #include #include CConsoleCommand* CCMDNotify::Clone(const char* szCommand, size_t nCommandLength) { size_t nIndex = 0; // ù¹øÂ° whitespaceÀÎ °÷ ±îÁö. for (; nIndex < nCommandLength; ++nIndex) { if (0 == szCommand[nIndex] || ' ' == szCommand[nIndex] || '\t' == szCommand[nIndex] || '\n' == szCommand[nIndex]) { break; } } ++nIndex; // whitespace°¡ ³¡³ª´Â °÷ ±îÁö for (; nIndex < nCommandLength; ++nIndex) { if (0 != szCommand[nIndex] || ' ' != szCommand[nIndex] || '\t' != szCommand[nIndex] || '\n' != szCommand[nIndex]) { break; } } CCMDNotify* lpNotify = NULL; if(nIndex < nCommandLength) { lpNotify = new CCMDNotify; if(NULL != lpNotify) { if (GameRYL::KOREA == CServerSetup::GetInstance().GetNationType()) { lpNotify->m_nLength = _snprintf(lpNotify->m_szBuffer, PktChat::PktChatMaxSize - 1, "[¿î¿µÀÚ °øÁö] : %s", szCommand + nIndex); } else { lpNotify->m_nLength = _snprintf(lpNotify->m_szBuffer, PktChat::PktChatMaxSize - 1, "%s", szCommand + nIndex); } lpNotify->m_szBuffer[PktChat::PktChatMaxSize - 1] = 0; } } return lpNotify; } bool CCMDNotify::DoProcess() { if(0 < m_nLength) { CChatPacket chatPacket(m_szBuffer, 0, PktChat::NOTICE, 0); if(chatPacket.IsValid()) { CCreatureManager::GetInstance().SendAllCharacter(chatPacket.GetCompressedPacket(), chatPacket.GetCompressedSize(), CmdCharChat); } } return true; }