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>
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
//=============================================================================
|
||||
// File : CSAuth.h
|
||||
// Use : Authentication between Client and Server
|
||||
// using 128-bit Enhanced SEED block cipher
|
||||
// Author : Kim Chan Ho (chkim@inca.co.kr)
|
||||
// Date : 2003/10/15
|
||||
// Modify : 2003/10/20 Refactoring to a class
|
||||
// 2003/10/21 Move random part to the class
|
||||
// 2003/12/01 Add GetAuthResults()
|
||||
// 2003/12/10 Support unix/linux system
|
||||
// 2004/02/11 Add PacketProtect stuff
|
||||
//=============================================================================
|
||||
|
||||
#ifndef __CSAUTH_H__
|
||||
#define __CSAUTH_H__
|
||||
|
||||
|
||||
/// Type definitions
|
||||
#if !defined(_WINDEF_) && !defined(_TYPEDEF_)
|
||||
|
||||
#define _TYPEDEF_
|
||||
|
||||
typedef void* LPVOID;
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned char BYTE;
|
||||
typedef const char* LPCTSTR;
|
||||
typedef DWORD* LPDWORD;
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
#define CSAUTH_EXPORT extern "C"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Functions
|
||||
DWORD __cdecl LoadAuthTable(LPCTSTR lpszPath);
|
||||
DWORD __cdecl InitPacketProtect(LPCTSTR lpszUserKey);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/// Class CSAuth
|
||||
class CCSAuth
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
CCSAuth();
|
||||
|
||||
// Destructor
|
||||
~CCSAuth();
|
||||
|
||||
// Functions
|
||||
void Init();
|
||||
DWORD IsAuth();
|
||||
DWORD GetAuthDword();
|
||||
DWORD CheckAuthDword(DWORD dwReturnValue);
|
||||
DWORD GetAuthResults(DWORD dwAuthValue, LPDWORD lpdwResult, DWORD dwCount);
|
||||
DWORD EncryptPacket(LPVOID lpData, DWORD dwLength);
|
||||
DWORD DecryptPacket(LPVOID lpData, DWORD dwLength);
|
||||
DWORD PPGetLastError();
|
||||
|
||||
protected:
|
||||
DWORD TransAuthDword(DWORD dwAuth, int index);
|
||||
void np_srandom(DWORD initial_seed);
|
||||
DWORD np_random();
|
||||
DWORD CheckLastPacket(DWORD dwSeq);
|
||||
|
||||
private:
|
||||
// No copies
|
||||
CCSAuth(const CCSAuth &rhs);
|
||||
CCSAuth &operator=(const CCSAuth &rhs);
|
||||
|
||||
private:
|
||||
DWORD m_dwSeed;
|
||||
DWORD m_dwAuthValue;
|
||||
DWORD m_bAuth;
|
||||
char m_table[8][5];
|
||||
DWORD m_dwClientSequenceNumber;
|
||||
DWORD m_dwServerSequenceNumber;
|
||||
DWORD m_adwLastSeqs[12];
|
||||
DWORD m_dwPPLastError;
|
||||
};
|
||||
|
||||
|
||||
#endif // __CSAUTH_H__
|
||||
|
||||
@@ -0,0 +1,416 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Utility/Time/Pulse/Pulse.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Skill/SkillMgr.h>
|
||||
|
||||
#include <Network/Packet/PacketStruct/CharMovePacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
||||
#include <Network/Dispatch/GameClient/GameClientDispatch.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include "CheckSpeedHack.h"
|
||||
|
||||
#include <DB/DBComponent.h>
|
||||
#include <DB/GameDBComponent.h>
|
||||
|
||||
CSpeedHackCheck::CSpeedHackCheck()
|
||||
: m_dwServerTotal(0), m_dwServerLast(0), m_dwClientTotal(0),
|
||||
m_dwClinetLast(0),
|
||||
|
||||
m_dwLastServerAttackTime(0),
|
||||
m_dwLastClientAttackTime(0),
|
||||
m_dwHackFoundCount(0),
|
||||
|
||||
m_lpCharacter(NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool CSpeedHackCheck::CheckTimeUpdate(DWORD dwClientTime)
|
||||
{
|
||||
if (CServerSetup::GetInstance().GetHackCheck() &&
|
||||
CheckSpeedHack(timeGetTime(), dwClientTime))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CSpeedHackCheck::CheckAttackReplay(PktAt* lpPktAt)
|
||||
{
|
||||
if (NULL == m_lpCharacter)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20>ϴ<EFBFBD><CFB4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD> <20>α<CEB1> <20><><EFBFBD>´<EFBFBD>.
|
||||
CheckAttackHack(lpPktAt, timeGetTime());
|
||||
|
||||
const unsigned long dwMaxHackFoundCount = 10;
|
||||
|
||||
if (CServerSetup::GetInstance().GetHackCheck() && dwMaxHackFoundCount < m_dwHackFoundCount)
|
||||
{
|
||||
SOCKADDR_IN sockAddr;
|
||||
|
||||
CGameClientDispatch* lpDispatch = m_lpCharacter->GetDispatcher();
|
||||
|
||||
if (0 != lpDispatch)
|
||||
{
|
||||
sockAddr = lpDispatch->GetRemoteAddr().get_addr_in();
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(&sockAddr, 0, sizeof(SOCKADDR_IN));
|
||||
}
|
||||
|
||||
ERRLOG5(g_Log, "/ UID:%10d / CID:%10d / Name:%s / IP:%15s / %dNum Hack found. /",
|
||||
m_lpCharacter->GetUID(), m_lpCharacter->GetCID(), m_lpCharacter->GetCharacterName(),
|
||||
inet_ntoa(sockAddr.sin_addr), dwMaxHackFoundCount);
|
||||
|
||||
m_dwHackFoundCount = 0;
|
||||
|
||||
// DB<44><42> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ƴٰ<C6B4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. (<28><><EFBFBD>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD> DB<44><42> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><CCBE><EFBFBD>.)
|
||||
// DBComponent::GameDB::InsertHackLog(CDBSingleObject::GetInstance(), m_lpCharacter->GetUID(), m_lpCharacter->GetCID(), m_lpCharacter->GetCharacterName());
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
return true;
|
||||
// edith 2008.05.14 <20><><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD> <20>ɸ<EFBFBD><C9B8><EFBFBD> <20><><EFBFBD><EFBFBD>. (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ؼ<EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
// return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CSpeedHackCheck::CheckSpeedHack(unsigned long CurrentServer, unsigned long CurrentClient)
|
||||
{
|
||||
const int HackCheckNum = 2500; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 2.5<EFBFBD><EFBFBD>
|
||||
const int HackCheckNum2 = -3000; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 3<><33>
|
||||
|
||||
if (CPulse::GetInstance().GetTPPOverTwoTime() ||
|
||||
0 == m_dwServerLast || 0 == m_dwClinetLast)
|
||||
{
|
||||
// ó<><C3B3> <20>α<EFBFBD><CEB1><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD>Ϸ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ұ<EFBFBD>
|
||||
m_dwServerLast = CurrentServer;
|
||||
m_dwClinetLast = CurrentClient;
|
||||
return false;
|
||||
}
|
||||
|
||||
int ServerInterval = CurrentServer - m_dwServerLast;
|
||||
int ClientInterval = CurrentClient - m_dwClinetLast;
|
||||
|
||||
if (0 == ServerInterval)
|
||||
{
|
||||
// <20><>Ŷ <20><><EFBFBD>Ϸ<EFBFBD> üũ <20>Ұ<EFBFBD>
|
||||
m_dwServerTotal = 0;
|
||||
m_dwClientTotal = 0;
|
||||
|
||||
m_dwServerLast = CurrentServer;
|
||||
m_dwClinetLast = CurrentClient;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD>
|
||||
m_dwServerTotal += ServerInterval;
|
||||
m_dwClientTotal += ClientInterval;
|
||||
int SCTotal = m_dwClientTotal - m_dwServerTotal;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>缺 üũ
|
||||
if (SCTotal > HackCheckNum)
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// @ <20><><EFBFBD><EFBFBD> <20>缺 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 1. 100% <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//
|
||||
|
||||
unsigned long dwCID = (NULL != m_lpCharacter) ? m_lpCharacter->GetCID() : 0;
|
||||
|
||||
ERRLOG6(g_Log, "CID:%10u/Plus/S:%d/C:%d/ST:%d/CT:%d/CK:%d/SpeedHack found",
|
||||
dwCID, ServerInterval, ClientInterval, m_dwServerTotal, m_dwClientTotal, SCTotal);
|
||||
|
||||
m_dwServerTotal = 0;
|
||||
m_dwClientTotal = 0;
|
||||
|
||||
m_dwServerLast = CurrentServer;
|
||||
m_dwClinetLast = CurrentClient;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> üũ
|
||||
if (SCTotal < HackCheckNum2)
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// @ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 1. <20>α<EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>ٽ<EFBFBD> <20>ʱ<EFBFBD>ȭ
|
||||
//
|
||||
|
||||
unsigned long dwCID = (NULL != m_lpCharacter) ? m_lpCharacter->GetCID() : 0;
|
||||
|
||||
ERRLOG6(g_Log, "CID:%10u/Minus/S:%d/C:%d/ST:%d/CT:%d/CK:%d/SpeedHack found",
|
||||
dwCID, ServerInterval, ClientInterval, m_dwServerTotal, m_dwClientTotal, SCTotal);
|
||||
|
||||
m_dwServerTotal = 0;
|
||||
m_dwClientTotal = 0;
|
||||
|
||||
m_dwServerLast = 0;
|
||||
m_dwClinetLast = 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> ũ<><C5A9> üũ
|
||||
if (m_dwServerTotal > 0xFFFFFFF0 || m_dwClientTotal > 0xFFFFFFF0)
|
||||
{
|
||||
m_dwServerTotal = 0;
|
||||
m_dwClientTotal = 0;
|
||||
|
||||
m_dwServerLast = 0;
|
||||
m_dwClinetLast = 0;
|
||||
}
|
||||
|
||||
m_dwServerLast = CurrentServer;
|
||||
m_dwClinetLast = CurrentClient;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool CSpeedHackCheck::CheckAttackHack(PktAt* lpPktAt, unsigned long dwCurrentServerTime)
|
||||
{
|
||||
static const unsigned long dwAverageAttackTime = 500;
|
||||
static const unsigned long dwMaxAttackInterval = 1500;
|
||||
static const unsigned long dwMaxAttackPerInterval = 5; // dwMaxAttackInterval<61><6C><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>
|
||||
static const unsigned long dwMaxSkillHistorySize = 5;
|
||||
static const long nAdditionalCoolDownTimeInterval = 1000; // <20><><EFBFBD>ٿ<EFBFBD> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD>. (1<>ʱ<EFBFBD><CAB1><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
|
||||
unsigned short usSkill_ID = lpPktAt->m_AtType.m_wType;
|
||||
unsigned short usSkill_LockCount = lpPktAt->m_AtType.m_cSkillLockCount;
|
||||
|
||||
if (0 == (usSkill_ID & AtType::SKILL_BIT))
|
||||
{
|
||||
const long nDiffServerTime = (0 != m_dwLastServerAttackTime) ?
|
||||
dwCurrentServerTime - m_dwLastServerAttackTime : dwAverageAttackTime;
|
||||
|
||||
const long nDiffClientTime = (0 != m_dwLastClientAttackTime) ?
|
||||
lpPktAt->GetServerInfo() - m_dwLastClientAttackTime : dwAverageAttackTime;
|
||||
|
||||
m_dwLastServerAttackTime = dwCurrentServerTime;
|
||||
m_dwLastClientAttackTime = lpPktAt->GetServerInfo();
|
||||
|
||||
m_AttackTimeList.push_back(AttackTime(nDiffServerTime, nDiffClientTime));
|
||||
m_SumAttackTime.add(nDiffServerTime, nDiffClientTime);
|
||||
|
||||
if (dwMaxAttackPerInterval < m_AttackTimeList.size())
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> dwMaxAttackPerInterval<61><6C><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
m_SumAttackTime.minus(m_AttackTimeList.front());
|
||||
m_AttackTimeList.pop_front();
|
||||
}
|
||||
|
||||
// <20>Ϲ<EFBFBD> <20><><EFBFBD><EFBFBD> üũ
|
||||
if (nDiffClientTime <= 120)
|
||||
{
|
||||
++m_dwHackFoundCount;
|
||||
LogAttackHack("Adjusted Client or Attack Hack found");
|
||||
|
||||
m_SumAttackTime.clear();
|
||||
m_AttackTimeList.clear();
|
||||
return false;
|
||||
}
|
||||
else if (dwMaxAttackPerInterval == m_AttackTimeList.size())
|
||||
{
|
||||
if (m_SumAttackTime.m_nSumServerAttackTime < dwMaxAttackInterval ||
|
||||
m_SumAttackTime.m_nSumClientAttackTime < dwMaxAttackInterval)
|
||||
{
|
||||
++m_dwHackFoundCount;
|
||||
LogAttackHack("Attack Hack found");
|
||||
|
||||
m_SumAttackTime.clear();
|
||||
m_AttackTimeList.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (0 == lpPktAt->m_AtType.m_cCasting)
|
||||
{
|
||||
// <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
CoolDownInfoList::iterator itr =
|
||||
std::lower_bound(m_CoolDownInfo.begin(), m_CoolDownInfo.end(), usSkill_ID);
|
||||
|
||||
if (itr != m_CoolDownInfo.end() &&
|
||||
usSkill_ID == itr->m_attackType.m_wType &&
|
||||
usSkill_LockCount < CSkillMgr::MAX_SKILL_LOCKCOUNT)
|
||||
{
|
||||
// <20>ѹ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD> <20>ֹ<EFBFBD><D6B9><EFBFBD>
|
||||
CoolDownInfo& coolDownInfo = *itr;
|
||||
|
||||
++coolDownInfo.m_dwSkillUsedCount;
|
||||
|
||||
const long nServerDiffCoolDownTime = dwCurrentServerTime -
|
||||
coolDownInfo.m_dwServerLastCastingTime;
|
||||
|
||||
const long nClientDiffCoolDownTime = lpPktAt->GetServerInfo() -
|
||||
coolDownInfo.m_dwClientLastCastingTime;
|
||||
|
||||
const long nMinCoolDownTime =
|
||||
static_cast<unsigned long>(coolDownInfo.m_lpSkillProtoType[coolDownInfo.m_attackType.m_cSkillLockCount].m_dwCoolDownTime *
|
||||
m_lpCharacter->GetStatus().m_StatusInfo.m_fCoolDownRevisionRate / 100.0f);
|
||||
|
||||
m_SkillHistoryList.push_back(SkillHistory(lpPktAt->m_AtType, nMinCoolDownTime,
|
||||
nServerDiffCoolDownTime, nClientDiffCoolDownTime));
|
||||
|
||||
if (dwMaxSkillHistorySize < m_SkillHistoryList.size())
|
||||
{
|
||||
m_SkillHistoryList.pop_front();
|
||||
}
|
||||
|
||||
if (nServerDiffCoolDownTime + nAdditionalCoolDownTimeInterval < nMinCoolDownTime
|
||||
|| nClientDiffCoolDownTime + nAdditionalCoolDownTimeInterval < nMinCoolDownTime)
|
||||
{
|
||||
++m_dwHackFoundCount;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20><> <20>ֹ<EFBFBD><D6B9><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ٿ<EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD> <20>۴<EFBFBD>.
|
||||
LogSkillCoolDownTime(*itr, nMinCoolDownTime,
|
||||
nServerDiffCoolDownTime, nClientDiffCoolDownTime);
|
||||
|
||||
coolDownInfo.m_attackType = lpPktAt->m_AtType;
|
||||
coolDownInfo.m_dwServerLastCastingTime = dwCurrentServerTime;
|
||||
coolDownInfo.m_dwClientLastCastingTime = lpPktAt->GetServerInfo();
|
||||
return false;
|
||||
}
|
||||
|
||||
coolDownInfo.m_attackType = lpPktAt->m_AtType;
|
||||
coolDownInfo.m_dwServerLastCastingTime = dwCurrentServerTime;
|
||||
coolDownInfo.m_dwClientLastCastingTime = lpPktAt->GetServerInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20><> <20>ֹ<EFBFBD><D6B9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
const Skill::ProtoType* lpSkillProtoType =
|
||||
CSkillMgr::GetInstance().GetSkillProtoType(usSkill_ID);
|
||||
|
||||
if (NULL != lpSkillProtoType && usSkill_LockCount < CSkillMgr::MAX_SKILL_LOCKCOUNT)
|
||||
{
|
||||
// 0x9305<30><35> FastHit<69>̴<EFBFBD>. (<28><><EFBFBD>Ӱ<EFBFBD><D3B0>ݽ<EFBFBD>ų)
|
||||
if (0 != lpSkillProtoType->m_dwCoolDownTime &&
|
||||
Skill::Type::CHANT != lpSkillProtoType->m_eSkillType &&
|
||||
0x9305 != usSkill_ID)
|
||||
{
|
||||
// <20><><EFBFBD>ٿ<EFBFBD><D9BF><EFBFBD> <20>ִ<EFBFBD> <20>ֹ<EFBFBD><D6B9>̰<EFBFBD>, <20>ѹ<EFBFBD><D1B9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʾҴ<CABE> <20>ֹ<EFBFBD><D6B9><EFBFBD>
|
||||
// FastHit<69><74>ų<EFBFBD><C5B3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
m_CoolDownInfo.insert(itr, CoolDownInfo(lpSkillProtoType,
|
||||
lpPktAt->m_AtType, dwCurrentServerTime, lpPktAt->GetServerInfo()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CSpeedHackCheck::LogAttackHack(const char* szDetailText)
|
||||
{
|
||||
SOCKADDR_IN sockAddr;
|
||||
|
||||
CGameClientDispatch* lpDispatch = m_lpCharacter->GetDispatcher();
|
||||
|
||||
if (0 != lpDispatch)
|
||||
{
|
||||
sockAddr = lpDispatch->GetRemoteAddr().get_addr_in();
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(&sockAddr, 0, sizeof(SOCKADDR_IN));
|
||||
}
|
||||
|
||||
const int MAX_BUFFER = 1023;
|
||||
char szBuffer[MAX_BUFFER + 1];
|
||||
szBuffer[MAX_BUFFER] = 0;
|
||||
|
||||
int nLength = _snprintf(szBuffer, MAX_BUFFER,
|
||||
"/UID:%d/CID:0x%08x/Name:%s/IP:%15s/%s/ServerDiff(ClientDiff):",
|
||||
m_lpCharacter->GetUID(), m_lpCharacter->GetCID(), m_lpCharacter->GetCharacterName(),
|
||||
inet_ntoa(sockAddr.sin_addr), szDetailText);
|
||||
|
||||
AttackTimeList::iterator pos = m_AttackTimeList.begin();
|
||||
AttackTimeList::iterator end = m_AttackTimeList.end();
|
||||
|
||||
for (;pos != end; ++pos)
|
||||
{
|
||||
AttackTime& atTime = *pos;
|
||||
nLength += _snprintf(szBuffer + nLength, MAX_BUFFER - nLength, "%dms(%dms),",
|
||||
atTime.m_nDiffServerInterval, atTime.m_nDiffClientInterval);
|
||||
}
|
||||
|
||||
nLength += _snprintf(szBuffer + nLength, MAX_BUFFER - nLength,
|
||||
"/ServerSum: %dms/ClientSum: %dms/AttackCount: %d/",
|
||||
m_SumAttackTime.m_nSumServerAttackTime,
|
||||
m_SumAttackTime.m_nSumClientAttackTime,
|
||||
m_AttackTimeList.size());
|
||||
|
||||
ERRLOG0(g_Log, szBuffer);
|
||||
|
||||
// DB<44><42> <20><> <20>α<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
}
|
||||
|
||||
|
||||
void CSpeedHackCheck::LogSkillCoolDownTime(const CoolDownInfo& coolDownInfo,
|
||||
long nMinCoolDownTime,
|
||||
long nServerCoolDownTimeInterval,
|
||||
long nClientCoolDownTimeInterval)
|
||||
{
|
||||
SOCKADDR_IN sockAddr;
|
||||
|
||||
CGameClientDispatch* lpDispatch = m_lpCharacter->GetDispatcher();
|
||||
|
||||
if (0 != lpDispatch)
|
||||
{
|
||||
sockAddr = lpDispatch->GetRemoteAddr().get_addr_in();
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(&sockAddr, 0, sizeof(SOCKADDR_IN));
|
||||
}
|
||||
|
||||
const int MAX_BUFFER = 4096;
|
||||
char szBuffer[MAX_BUFFER + 1];
|
||||
szBuffer[MAX_BUFFER] = 0;
|
||||
|
||||
int nLength = _snprintf(szBuffer, MAX_BUFFER,
|
||||
"/UID:%d/CID:0x%08x/Name:%s/IP:%15s/Cooldown Hack found. /"
|
||||
"Skill_ID:0x%04x/Lc:%d/Lv:%d/CharLevel:%d/Dex:%d/"
|
||||
"ServerInterval:%dms/ClientInterval:%dms/MinCoolDownTime:%dms/SkillUsedCount:%d/SkillHistory-",
|
||||
|
||||
m_lpCharacter->GetUID(), m_lpCharacter->GetCID(), m_lpCharacter->GetCharacterName(),
|
||||
inet_ntoa(sockAddr.sin_addr),
|
||||
coolDownInfo.m_attackType.m_wType, coolDownInfo.m_attackType.m_cSkillLockCount,
|
||||
coolDownInfo.m_attackType.m_cSkillLevel,
|
||||
m_lpCharacter->GetStatus().m_nLevel, m_lpCharacter->GetCharStatus().m_nDEX,
|
||||
nServerCoolDownTimeInterval, nClientCoolDownTimeInterval,
|
||||
nMinCoolDownTime, coolDownInfo.m_dwSkillUsedCount);
|
||||
|
||||
SkillHistoryList::iterator pos = m_SkillHistoryList.begin();
|
||||
SkillHistoryList::iterator end = m_SkillHistoryList.end();
|
||||
|
||||
for (;pos != end; ++pos)
|
||||
{
|
||||
SkillHistory& skillHistory = *pos;
|
||||
|
||||
nLength += _snprintf(szBuffer + nLength, MAX_BUFFER - nLength,
|
||||
"ID:0x%04x Lc:%2d Lv:%2d SInterval:%d CInterval:%d MinCoolDownTime:%d/",
|
||||
skillHistory.m_attackType.m_wType, skillHistory.m_attackType.m_cSkillLockCount,
|
||||
skillHistory.m_attackType.m_cSkillLevel, skillHistory.m_nServerInterval,
|
||||
skillHistory.m_nClientInterval, skillHistory.m_nMinCoolDownTime);
|
||||
}
|
||||
|
||||
ERRLOG0(g_Log, szBuffer);
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
#ifndef _CHECK_SPEEDHACK_H_
|
||||
#define _CHECK_SPEEDHACK_H_
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktMU;
|
||||
struct PktAt;
|
||||
class CCharacter;
|
||||
|
||||
namespace Skill
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct ProtoType;
|
||||
};
|
||||
|
||||
// <20><><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD>
|
||||
class CSpeedHackCheck
|
||||
{
|
||||
public:
|
||||
|
||||
CSpeedHackCheck();
|
||||
|
||||
bool CheckTimeUpdate(DWORD dwClientTime);
|
||||
bool CheckAttackReplay(PktAt* lpPktAt);
|
||||
|
||||
inline void SetCharacter(CCharacter* lpCharacter) { m_lpCharacter = lpCharacter; }
|
||||
|
||||
private:
|
||||
|
||||
struct CoolDownInfo
|
||||
{
|
||||
const Skill::ProtoType* m_lpSkillProtoType;
|
||||
AtType m_attackType;
|
||||
unsigned long m_dwServerLastCastingTime;
|
||||
unsigned long m_dwClientLastCastingTime;
|
||||
unsigned long m_dwSkillUsedCount;
|
||||
|
||||
CoolDownInfo(const Skill::ProtoType* lpSkillProtoType, AtType attackType,
|
||||
unsigned long dwServerLastCastingTime, unsigned long dwClientLastCastingTime)
|
||||
: m_lpSkillProtoType(lpSkillProtoType), m_attackType(attackType),
|
||||
m_dwServerLastCastingTime(dwServerLastCastingTime),
|
||||
m_dwClientLastCastingTime(dwClientLastCastingTime),
|
||||
m_dwSkillUsedCount(1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
friend inline bool operator < (const CoolDownInfo& lhs, unsigned short usSkill_ID) { return lhs.m_attackType.m_wType < usSkill_ID; }
|
||||
friend inline bool operator < (unsigned short usSkill_ID, const CoolDownInfo& rhs) { return usSkill_ID < rhs.m_attackType.m_wType; }
|
||||
friend inline bool operator < (const CoolDownInfo& lhs, const CoolDownInfo& rhs) { return lhs.m_attackType.m_wType < rhs.m_attackType.m_wType; }
|
||||
};
|
||||
|
||||
struct SkillHistory
|
||||
{
|
||||
AtType m_attackType;
|
||||
long m_nServerInterval;
|
||||
long m_nClientInterval;
|
||||
long m_nMinCoolDownTime;
|
||||
|
||||
SkillHistory(AtType attackType, long nMinCoolDownTime,
|
||||
long nServerInterval, long nClientInterval)
|
||||
: m_attackType(attackType), m_nMinCoolDownTime(nMinCoolDownTime),
|
||||
m_nServerInterval(nServerInterval), m_nClientInterval(nClientInterval)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
struct AttackTime
|
||||
{
|
||||
long m_nDiffServerInterval;
|
||||
long m_nDiffClientInterval;
|
||||
|
||||
AttackTime() : m_nDiffServerInterval(0), m_nDiffClientInterval(0) { }
|
||||
|
||||
AttackTime(long nDiffServerInterval, long nDiffClientInterval)
|
||||
: m_nDiffServerInterval(nDiffServerInterval), m_nDiffClientInterval(nDiffClientInterval)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
struct SumAttackTime
|
||||
{
|
||||
long m_nSumServerAttackTime;
|
||||
long m_nSumClientAttackTime;
|
||||
|
||||
SumAttackTime() : m_nSumServerAttackTime(0), m_nSumClientAttackTime(0) { }
|
||||
void clear() { m_nSumServerAttackTime = m_nSumClientAttackTime = 0; }
|
||||
|
||||
void add(long nSumServerAttackTime, long nSumClientAttackTime) { m_nSumServerAttackTime += nSumServerAttackTime; m_nSumClientAttackTime += nSumClientAttackTime; }
|
||||
void add(AttackTime& atTime) { m_nSumServerAttackTime += atTime.m_nDiffServerInterval; m_nSumClientAttackTime += atTime.m_nDiffClientInterval; }
|
||||
|
||||
void minus(long nSumServerAttackTime, long nSumClientAttackTime) { m_nSumServerAttackTime -= nSumServerAttackTime; m_nSumClientAttackTime -= nSumClientAttackTime; }
|
||||
void minus(AttackTime& atTime) { m_nSumServerAttackTime -= atTime.m_nDiffServerInterval; m_nSumClientAttackTime -= atTime.m_nDiffClientInterval; }
|
||||
};
|
||||
|
||||
struct ClearAttackHackCheck;
|
||||
|
||||
bool CheckSpeedHack(unsigned long CurrentServer, unsigned long CurrentClient);
|
||||
bool CheckAttackHack(PktAt* lpPktAt, unsigned long dwCurrentServerTime);
|
||||
|
||||
void LogAttackHack(const char* szDetailText);
|
||||
|
||||
void LogSkillCoolDownTime(const CoolDownInfo& coolDownInfo, long nMinCoolDownTime,
|
||||
long nServerCoolDownTimeInterval, long nClientCoolDownTimeInterval);
|
||||
|
||||
unsigned long m_dwServerTotal;
|
||||
unsigned long m_dwServerLast;
|
||||
unsigned long m_dwClientTotal;
|
||||
unsigned long m_dwClinetLast;
|
||||
|
||||
unsigned long m_dwLastServerAttackTime; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20>ð<EFBFBD>
|
||||
unsigned long m_dwLastClientAttackTime; // Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20>ð<EFBFBD>
|
||||
|
||||
unsigned long m_dwHackFoundCount; // <20><> <20>߰<EFBFBD> ȸ<><C8B8>
|
||||
|
||||
typedef std::vector<CoolDownInfo> CoolDownInfoList;
|
||||
typedef std::deque<SkillHistory> SkillHistoryList;
|
||||
typedef std::deque<AttackTime> AttackTimeList;
|
||||
|
||||
SumAttackTime m_SumAttackTime; // <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD> <20><>.
|
||||
AttackTimeList m_AttackTimeList; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
CoolDownInfoList m_CoolDownInfo; // <20><><EFBFBD>ٿ<EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
SkillHistoryList m_SkillHistoryList; // <20><>ų <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>丮 <20><><EFBFBD><EFBFBD>Ʈ
|
||||
CCharacter* m_lpCharacter;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,569 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <boost/pool/pool_alloc.hpp>
|
||||
|
||||
#include <Network/Session/Session.h>
|
||||
#include <Network/XORCrypt/XORCrypt.h>
|
||||
|
||||
#include <Network/Packet/PacketBase.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
|
||||
#include <Stream/Buffer/Buffer.h>
|
||||
#include <Stream/Buffer/BufferFactory.h>
|
||||
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <GameGuardLib/ggerror.h>
|
||||
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include "PacketParse.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
|
||||
// <20>Լ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool LogFailDispatch(CGameClientDispatch& GameClientDispatch,
|
||||
const char* szDetailText, const unsigned char cCmd);
|
||||
|
||||
|
||||
CGameClientDispatchTable& CGameClientDispatchTable::GetInstance()
|
||||
{
|
||||
static CGameClientDispatchTable gameClientDispatchTable;
|
||||
return gameClientDispatchTable;
|
||||
}
|
||||
|
||||
CGameClientDispatchTable::CGameClientDispatchTable()
|
||||
: CPacketDispatchTable<CGameClientDispatch::FnProcess>(UCHAR_MAX)
|
||||
{
|
||||
using namespace GameClientParsePacket;
|
||||
|
||||
// <20>⺻<EFBFBD><E2BABB><EFBFBD><EFBFBD> Process<73><73><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>. ( character<65><72><EFBFBD><EFBFBD>... )
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - ParseCharItem.cpp
|
||||
AddDispatch(CmdCharTakeItem, ParseCharTakeItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̵<EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharSwapItem, ParseCharSwapItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharRepairItem, ParseCharRepairItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharRepairAllItem, ParseCharRepairAllItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
AddDispatch(CmdCharUseItem, ParseCharUseItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharTradeItem, ParseCharTradeItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ŷ<EFBFBD>
|
||||
AddDispatch(CmdCharEquipShopInfo, ParseCharEquipShopInfo); // NPC <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharPickUp, ParseCharPickUp); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharPullDown, ParseCharPullDown); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharSplitItem, ParseCharSplitItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharTakeGold, ParseCharTakeGold); // <20><> <20>ٷ<EFBFBD><D9B7><EFBFBD>
|
||||
AddDispatch(CmdDeposit, ParseCharDepositCmd); // â<><C3A2> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6>
|
||||
AddDispatch(CmdCharAutoRouting, ParseCharAutoRouting); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharUseCashItem, ParseCharUseCashItem); // ij<><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD> <20><><EFBFBD><EFBFBD> - ParseCharUpgradeItem.cpp
|
||||
AddDispatch(CmdCharInstallSocket, ParseCharInstallSocket); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ν<EFBFBD><CEBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharItemChemical, ParseCharItemChemical); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD>
|
||||
AddDispatch(CmdCharUpgradeItem, ParseCharUpgradeItem); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
AddDispatch(CmdCharItemOptionGraft, ParseCharItemOptionGraft); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20>̽<EFBFBD>
|
||||
AddDispatch(CmdCharItemCompensation, ParseCharItemCompensation); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD>
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><>ų <20><><EFBFBD><EFBFBD> - ParseCharSkill.cpp
|
||||
AddDispatch(CmdCharUseSkill, ParseCharUseSkill); // <20><>ų <20><><EFBFBD><EFBFBD>
|
||||
// AddDispatch(CmdCharSkillLock, ParseCharSkillLock); // <20><>ų <20><>
|
||||
// AddDispatch(CmdCharSkillUnLock, ParseCharSkillUnLock); // <20><>ų <20><> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharSkillErase, ParseCharSkillErase); // <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharAttack.cpp
|
||||
AddDispatch(CmdCharAttack, ParseCharAttack); // <20><><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
AddDispatch(CmdCharSwitchEQ, ParseCharSwitchEQ); // <20><><EFBFBD><EFBFBD> <20>ٲٱ<D9B2>
|
||||
AddDispatch(CmdCharRespawn, ParseCharRespawn); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharRespawnWaitQueue, ParseCharRespawnWaitQueue); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ť <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
AddDispatch(CmdCharRespawnInfo, ParseCharRespawnInfo); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ<EFBFBD><C4A1>)
|
||||
AddDispatch(CmdCharRespawnAreaInfo, ParseCharRespawnAreaInfo); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
// AddDispatch(CmdCharMoveUpdate, ParseCharMoveUpdate); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ
|
||||
AddDispatch(CmdCharDuelCmd, ParseCharDuelCmd); // <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharPeaceMode, ParseCharPeaceMode); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharSummonCmd, ParseCharSummonCmd); // <20><>ȯ<EFBFBD><C8AF> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UDP p2p<32><70>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ø<EFBFBD>
|
||||
AddDispatch(CmdCharMove, ParseCharMoveEx);
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharLevelUp.cpp
|
||||
AddDispatch(CmdCharClassUpgrade, ParseCharClassUpgrade); // Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
AddDispatch(CmdCharIncreasePoint, ParseCharIncreasePoint); // IP <20><><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
AddDispatch(CmdCharStateRedistribution, ParseCharStateRedistribution); // IP <20><><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
AddDispatch(CmdCharStatusRetrain, ParseCharStatusRetrain); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD> <20><><EFBFBD>Ʒ<EFBFBD>
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> Ŀ<>´<EFBFBD>Ƽ <20><><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharCommunity.cpp
|
||||
AddDispatch(CmdCharExchangeCmd, ParseCharExchangeCmd); // <20><>ȯ <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharPartyCmd, ParseCharPartyCmd); // <20><>Ƽ <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharPartyFind, ParseCharPartyFind); // <20><>Ƽ ã<><C3A3>
|
||||
|
||||
AddDispatch(CmdCharStallOpen, ParseCharStallOpen); // ijƽ<C4B3><C6BD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharStallRegisterItem, ParseCharStallRegisterItem); // ijƽ<C4B3><C6BD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharStallEnter, ParseCharStallEnter); // ijƽ<C4B3><C6BD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
AddDispatch(CmdFriendAddRequest, ParseCharFriendAdd); // ģ<><C4A3> <20>߰<EFBFBD>
|
||||
AddDispatch(CmdFriendRemoveRequest, ParseCharFriendRemove); // ģ<><C4A3> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdFriendEtcRequest, ParseCharFriendEtc); // <20><>Ÿ
|
||||
|
||||
AddDispatch(CmdCreateGuild, ParseCharCreateGuild); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdGuildCmd, ParseCharGuildCmd); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdGuildMark, ParseCharGuildMark); // <20><><EFBFBD><EFBFBD> <20><>ũ <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdGuildLevel, ParseCharGuildLevel); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdGuildRelation, ParseCharGuildRelation); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdGuildInclination, ParseCharGuildInclination); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdGuildList, ParseCharGuildList); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
AddDispatch(CmdGuildRight, ParseCharGuildRight); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdGuildMemberList, ParseCharGuildMemberList); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
AddDispatch(CmdGuildSafe, ParseCharGuildSafe); // <20><><EFBFBD><EFBFBD> <20>ݰ<EFBFBD>
|
||||
AddDispatch(CmdGuildHostilityList, ParseCharGuildHostilityList); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ȳ <20><><EFBFBD><EFBFBD>Ʈ
|
||||
AddDispatch(CmdGuildRelationInfo, ParseCharGuildRelationInfo); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><>û
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharAdmin.cpp
|
||||
AddDispatch(CmdCharAdminCmd, ParseCharAdminCmd); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŀ<>ǵ<EFBFBD>
|
||||
AddDispatch(CmdCharNameChange, ParseCharNameChange); // ij<><C4B3><EFBFBD><EFBFBD> <20≯<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharQuest.cpp
|
||||
AddDispatch(CmdCharStartQuest, ParseCharStartQuest); // <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharOperateTrigger, ParseCharOperateTrigger); // Ʈ<><C6AE><EFBFBD><EFBFBD> <20>ߵ<EFBFBD>
|
||||
AddDispatch(CmdCharCancelQuest, ParseCharCancelQuest); // <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><>Ÿ <20><>Ŷ - ParseCharEtc.cpp
|
||||
AddDispatch(CmdCharSuicide, ParseCharSuicide); // ij<><C4B3><EFBFBD><EFBFBD> <20>ڻ<EFBFBD>
|
||||
AddDispatch(CmdCharBindPosition, ParseCharBindPosition); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharQuickSlotMove, ParseCharQuickSlotMove); // ij<><C4B3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
AddDispatch(CmdCharControlOption, ParseCharControlOption); // ij<><C4B3><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCharAuthorizePanel, ParseCharAuthorizePanel);
|
||||
AddDispatch(CmdCharFameInfo, ParseCharFameInfo); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>(<28><><EFBFBD>嵵) <20><><EFBFBD><EFBFBD> <20><>û
|
||||
AddDispatch(CmdRankingInfo, ParseCharRankingInfo); // <20><>ŷ <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharBGServer.cpp
|
||||
AddDispatch(CmdBGServerMapList, ParseCharBGServerMapList); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>(<28><>) <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
AddDispatch(CmdBGServerResultList, ParseCharBGServerResultList); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>(<28><>) <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
AddDispatch(CmdBGServerMoveZone, ParseCharBGServerMoveZone); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>̵<EFBFBD> (<28><>(<28><>) <20>̵<EFBFBD>)
|
||||
AddDispatch(CmdBGServerMileageChange, ParseCharBGServerMileageChange); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȯ<><C8AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdBGServerCharSlot, ParseCharBGServerCharSlot); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>û
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharCastle.cpp
|
||||
AddDispatch(CmdCastleCmd, ParseCharCastleCmd); // <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCampCmd, ParseCharCampCmd); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdSiegeArmsCmd, ParseCharSiegeArmsCmd); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCastleRight, ParseCharCastleRight); // <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdCampRight, ParseCharCampRight); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// ä<><C3A4> <20><>Ŷ - ParseCharChat.cpp
|
||||
AddDispatch(CmdCharWhisper, ParseCharWhisper); // <20>ӻ<EFBFBD><D3BB><EFBFBD>
|
||||
AddDispatch(CmdCharChat, ParseCharChat); // ijƽ<C4B3><C6BD> ä<><C3A4>
|
||||
|
||||
AddDispatch(CmdCharCastObjectInfo, ParseCastObjectInfo); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
|
||||
AddDispatch(CmdCharInstallRuneSocket, ParseCharInstallRuneSocket); // <20>鼳ġ, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
|
||||
AddDispatch(CmdTakeMaterial, ParseCharTakeMaterial); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֱ<EFBFBD>/<2F><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdTakeCastleJewel, ParseCharTakeCastleJewel); // <20><> <20><>¡<EFBFBD><C2A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֱ<EFBFBD>/<2F><><EFBFBD><EFBFBD>
|
||||
AddDispatch(CmdWarOnOff, ParseWarOnOff); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> <20>ٲٱ<D9B2>
|
||||
|
||||
AddDispatch(CmdKeyInfo, ParseKeyInfo); // <20><><EFBFBD>̽<EFBFBD>ƽ Ű <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
}
|
||||
|
||||
|
||||
|
||||
CGameClientDispatch::CGameClientDispatch(CSession& Session,
|
||||
CGameClientDispatchTable& GameClientDispatchTable)
|
||||
: CRylServerDispatch(Session, MAX_PACKET_DISPATCH_PER_PULSE),
|
||||
m_lpCharacter(0),
|
||||
m_dwUID(0),
|
||||
m_GameClientDispatchTable(GameClientDispatchTable),
|
||||
m_dwMoveServerID(0)
|
||||
{
|
||||
// edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
// m_CSAuth.Init();
|
||||
m_CSAuth2.Init();
|
||||
|
||||
DETLOG2(g_Log, "DP:0x%p/UID:%u/GameClientDispatch Created", this, m_dwUID);
|
||||
}
|
||||
|
||||
|
||||
CGameClientDispatch::~CGameClientDispatch()
|
||||
{
|
||||
CGameClientDispatch::Disconnected();
|
||||
|
||||
// <20><>ü <20>Ҹ<EFBFBD> <20>α<EFBFBD>
|
||||
DETLOG2(g_Log, "DP:0x%p/UID:%u/GameClientDispatch Destroy", this, m_dwUID);
|
||||
}
|
||||
|
||||
void CGameClientDispatch::Connected()
|
||||
{
|
||||
}
|
||||
|
||||
void CGameClientDispatch::Disconnected()
|
||||
{
|
||||
if (0 != m_lpCharacter)
|
||||
{
|
||||
m_lpCharacter->SetDispatcher(0);
|
||||
}
|
||||
}
|
||||
|
||||
void CGameClientDispatch::Disconnect()
|
||||
{
|
||||
CloseSession();
|
||||
}
|
||||
|
||||
bool CGameClientDispatch::DispatchPacket(PktBase* lpPktBase)
|
||||
{
|
||||
unsigned char cCmd = lpPktBase->GetCmd();
|
||||
bool bHackCheck = true;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20>ð<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ.
|
||||
m_CheckPing.SetLastPingRecvTime(CPulse::GetInstance().GetLastTick());
|
||||
|
||||
switch (cCmd)
|
||||
{
|
||||
case CmdSysPing:
|
||||
bHackCheck = m_CheckSpeedHack.CheckTimeUpdate(static_cast<PktSyP*>(lpPktBase)->m_dwTickTime);
|
||||
return true;
|
||||
|
||||
case CmdCharAttack:
|
||||
bHackCheck = m_CheckSpeedHack.CheckAttackReplay(static_cast<PktAt*>(lpPktBase));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bHackCheck)
|
||||
{
|
||||
ERRLOG3(g_Log, "DP:0x%p/IP:%s/UID:%10d/<2F><><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD> üũ<C3BC><C5A9> <20>ɷȽ<C9B7><C8BD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.",
|
||||
this, GetRemoteAddr().get_addr_string(), m_dwUID);
|
||||
}
|
||||
else if (CXORCrypt::PAGE_VERSION != CXORCrypt::GetInstance().GetPageVer(lpPktBase->GetCodePage()))
|
||||
{
|
||||
// (Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ -> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>ڵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<><31>)<29><> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||
ERRLOG3(g_Log, "DP:0x%p/IP:%s/UID:%d <20>߸<EFBFBD><DFB8><EFBFBD> <20>ڵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD>Դϴ<D4B4>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.",
|
||||
this, GetRemoteAddr().get_addr_string(), m_dwUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
CGameClientDispatch::FnProcess fnProcess =
|
||||
m_GameClientDispatchTable.GetDispatch(cCmd);
|
||||
|
||||
const char* szErrorString = 0;
|
||||
|
||||
if (0 == fnProcess)
|
||||
{
|
||||
szErrorString = "Unknown Gameserver Packet";
|
||||
}
|
||||
else if (!fnProcess(*this, lpPktBase))
|
||||
{
|
||||
szErrorString = "GameServer packet process failed.";
|
||||
}
|
||||
|
||||
if (0 != szErrorString)
|
||||
{
|
||||
LogFailDispatch(*this, szErrorString, cCmd);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CGameClientDispatch::Dispatch()
|
||||
{
|
||||
unsigned long dwCurrentTime = timeGetTime();
|
||||
|
||||
// <20><> üũ
|
||||
if (0 != m_lpCharacter && // ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20>־<EFBFBD><D6BE><EFBFBD> <20>ϰ<EFBFBD>
|
||||
0 == m_lpCharacter->GetAdminLevel() && // <20><EFBFBD>ڰ<EFBFBD> <20>ƴϰ<C6B4>
|
||||
!m_CheckPing.CheckPing(dwCurrentTime)) // Pingüũ<C3BC><C5A9> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD>
|
||||
{
|
||||
const int MAX_BUFFER = 256;
|
||||
char szBuffer[MAX_BUFFER];
|
||||
|
||||
unsigned long dwPingCount = 0;
|
||||
unsigned long dwLastPingRecvTime = 0;
|
||||
unsigned long dwFirstCheckTime = 0;
|
||||
|
||||
unsigned long dwCID = m_lpCharacter->GetCID();
|
||||
const char* szCharacterName = m_lpCharacter->GetCharacterName();
|
||||
|
||||
m_CheckPing.GetPingData(dwPingCount, dwLastPingRecvTime, dwFirstCheckTime);
|
||||
|
||||
_snprintf(szBuffer, MAX_BUFFER - 1,
|
||||
"UID:%u/CID:%u/Name:%s/CurrentTime:%u/LastPingTime:%u/PingCount:%u/FirstCheckTime:%u/"
|
||||
"PingCheck failed. disconnect now.",
|
||||
m_dwUID, dwCID, szCharacterName, dwCurrentTime,
|
||||
dwLastPingRecvTime, dwPingCount, dwFirstCheckTime);
|
||||
|
||||
LogErrorPacket(szBuffer, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
return CRylServerDispatch::Dispatch();
|
||||
}
|
||||
|
||||
void CGameClientDispatch::ProcessTooManyPacket(CBufferQueue& bufferQueue)
|
||||
{
|
||||
if (0 != m_lpCharacter)
|
||||
{
|
||||
typedef std::map<unsigned char, unsigned long, std::greater<unsigned long>,
|
||||
boost::fast_pool_allocator< std::pair<unsigned char, unsigned long> > > PacketStatistics;
|
||||
|
||||
const int MAX_BUFFER = 512;
|
||||
char szBuffer[MAX_BUFFER];
|
||||
|
||||
PacketStatistics packetStatistics;
|
||||
|
||||
const SOCKADDR_IN& sockAddr = GetRemoteAddr().get_addr_in();
|
||||
|
||||
int nLength = _snprintf(szBuffer, MAX_BUFFER,
|
||||
"/UID:%d/CID:0x%08x/Name:%s/IP:%15s/ProcessPkt:%4d/RemainPkt:%4d/",
|
||||
m_lpCharacter->GetUID(), m_lpCharacter->GetCID(), m_lpCharacter->GetCharacterName(),
|
||||
inet_ntoa(sockAddr.sin_addr), m_dwMaxProcessPacketPerPulse, bufferQueue.getBufferNum());
|
||||
|
||||
CBufferQueue tempQueue;
|
||||
tempQueue.splice(bufferQueue);
|
||||
|
||||
const int DROP_PACKET_LIMIT = 20;
|
||||
const int DROP_PACKET_MAX_LIMIT = 40;
|
||||
|
||||
bool bDropPacket = DROP_PACKET_MAX_LIMIT < tempQueue.getBufferNum();
|
||||
|
||||
// <20><>Ŷ <20><><EFBFBD>踦 <20><><EFBFBD>Ѵ<EFBFBD>.
|
||||
CBuffer* lpBuffer = tempQueue.getHead();
|
||||
for(; 0 != lpBuffer; lpBuffer = lpBuffer->next())
|
||||
{
|
||||
unsigned char cCmd = reinterpret_cast<PktBase*>(lpBuffer->rd_ptr())->GetCmd();
|
||||
++packetStatistics[cCmd];
|
||||
}
|
||||
|
||||
const unsigned long dwMaxPrint = 5;
|
||||
unsigned long dwPrinted = 0;
|
||||
|
||||
PktBase::CMDType aryDropCmd[dwMaxPrint];
|
||||
PktBase::CMDType* lpDropCmdEnd = aryDropCmd;
|
||||
|
||||
std::pair<unsigned char, unsigned long> resultPair;
|
||||
|
||||
for(PacketStatistics::iterator itr = packetStatistics.begin();
|
||||
itr != packetStatistics.end() && dwPrinted < dwMaxPrint; ++itr, ++dwPrinted)
|
||||
{
|
||||
resultPair = *itr;
|
||||
|
||||
nLength += _snprintf(szBuffer + nLength, MAX_BUFFER - nLength, "0x%02x:%5d/", resultPair.first, resultPair.second);
|
||||
|
||||
// <20><>Ŷ<EFBFBD><C5B6> <20>ѹ<EFBFBD><D1B9><EFBFBD> <20><><EFBFBD><EFBFBD> <20>̻<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Drop<6F><70> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD>Խ<EFBFBD>Ų<EFBFBD><C5B2>.
|
||||
// <20><><EFBFBD>⼭<EFBFBD><E2BCAD> Top 5<><35> <20><><EFBFBD>ϴ<EFBFBD> <20><>Ŷ <20><> DROP_PACKET_LIMIT <20>̻<EFBFBD> <20>Ǵ<EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
if(DROP_PACKET_LIMIT < resultPair.second)
|
||||
{
|
||||
*lpDropCmdEnd = resultPair.first;
|
||||
++lpDropCmdEnd;
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(aryDropCmd, lpDropCmdEnd);
|
||||
|
||||
ERRLOG0(g_Log, szBuffer);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
lpBuffer = tempQueue.dequeue();
|
||||
if(0 == lpBuffer)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char cCmd = reinterpret_cast<PktBase*>(lpBuffer->rd_ptr())->GetCmd();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>Ŷ<EFBFBD≯<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
if(bDropPacket && std::binary_search(aryDropCmd, lpDropCmdEnd, cCmd))
|
||||
{
|
||||
SAFE_RELEASE_BUFFER(lpBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
bufferQueue.enqueue(lpBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool LogFailDispatch(CGameClientDispatch& GameClientDispatch,
|
||||
const char* szDetailText, const unsigned char cCmd)
|
||||
{
|
||||
unsigned long dwUID = GameClientDispatch.GetUID();
|
||||
|
||||
ERRLOG5(g_Log, "DP:0x%p/UID:%d/PacketCMD:0x%02x/IP:%15s/%s",
|
||||
&GameClientDispatch, dwUID, cCmd,
|
||||
GameClientDispatch.GetRemoteAddr().get_addr_string(), szDetailText);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned long CGameClientDispatch::PopRequestKey()
|
||||
{
|
||||
unsigned long dwRequestKey = 0;
|
||||
if (!m_DBRequestQueue.empty())
|
||||
{
|
||||
dwRequestKey = m_DBRequestQueue.front();
|
||||
m_DBRequestQueue.pop_front();
|
||||
}
|
||||
|
||||
unsigned long dwUID = 0;
|
||||
unsigned long dwCID = 0;
|
||||
|
||||
if (0 != m_lpCharacter)
|
||||
{
|
||||
dwUID = m_lpCharacter->GetUID();
|
||||
dwCID = m_lpCharacter->GetCID();
|
||||
}
|
||||
|
||||
DETLOG7(g_Log, "UID:%u/CID:0x%p(0x%p)/IP:%15s/DP:0x%p/DUID:%u/RequestKey:%d/ "
|
||||
"Pop RequestKey", dwUID, dwCID, m_lpCharacter,
|
||||
GetRemoteAddr().get_addr_string(),
|
||||
this, m_dwUID, dwRequestKey);
|
||||
|
||||
return dwRequestKey;
|
||||
}
|
||||
|
||||
void CGameClientDispatch::PushRequestKey(unsigned long dwRequestKey)
|
||||
{
|
||||
unsigned long dwUID = 0;
|
||||
unsigned long dwCID = 0;
|
||||
|
||||
if (0 != m_lpCharacter)
|
||||
{
|
||||
dwUID = m_lpCharacter->GetUID();
|
||||
dwCID = m_lpCharacter->GetCID();
|
||||
}
|
||||
|
||||
DETLOG7(g_Log, "UID:%u/CID:0x%p(0x%p)/IP:%15s/DP:0x%p/DUID:%u/RequestKey:%d/ "
|
||||
"Push RequestKey", dwUID, dwCID, m_lpCharacter,
|
||||
GetRemoteAddr().get_addr_string(),
|
||||
this, m_dwUID, dwRequestKey);
|
||||
|
||||
m_DBRequestQueue.push_back(dwRequestKey);
|
||||
}
|
||||
|
||||
bool CGameClientDispatch::GetAuthQuery(GG_AUTH_DATA** lppAuthData_Out)
|
||||
{
|
||||
unsigned long dwGGErrCode = m_CSAuth2.GetAuthQuery();
|
||||
if (dwGGErrCode != ERROR_SUCCESS)
|
||||
{
|
||||
PrintGameGuardError(dwGGErrCode);
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>(2) GetAuthQuery <20><><EFBFBD><EFBFBD>", m_lpCharacter->GetCID());
|
||||
return false;
|
||||
}
|
||||
|
||||
*lppAuthData_Out = &m_CSAuth2.m_AuthQuery;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGameClientDispatch::CheckAuthAnswer(void)
|
||||
{
|
||||
unsigned long dwGGErrCode = m_CSAuth2.CheckAuthAnswer();
|
||||
if (dwGGErrCode != ERROR_SUCCESS)
|
||||
{
|
||||
PrintGameGuardError(dwGGErrCode);
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>(2) CheckAuthAnswer <20><><EFBFBD><EFBFBD>", m_lpCharacter->GetCID());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CGameClientDispatch::PrintGameGuardError(void)
|
||||
{
|
||||
/* switch (m_CSAuth.PPGetLastError())
|
||||
{
|
||||
case 1:
|
||||
ERRLOG1(g_Log, "CID:0x%08x Ű<><C5B0> <20><>ġ<EFBFBD><C4A1><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>. "
|
||||
"<22><>ȣȭ<C8A3><C8AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD>̰ų<CCB0>, UserKey<65><79> <20>ٸ<EFBFBD> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD>κ<EFBFBD><CEBA><EFBFBD> <20><> <20><>Ŷ<EFBFBD><C5B6> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.", m_lpCharacter->GetCID());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD> <20>ֱ<EFBFBD><D6B1><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>. "
|
||||
"<22><>Ŷ <20><><EFBFBD>ö<EFBFBD><C3B6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.", m_lpCharacter->GetCID());
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD>ӵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD> <20><>ġ<EFBFBD><C4A1><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>. "
|
||||
"<22><>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ǿ<EFBFBD><C7BE><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. TCP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><DFBB><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.", m_lpCharacter->GetCID());
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><>Ŷ CRC üũ<C3BC><C5A9> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>. "
|
||||
"<22><>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƿ<EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.", m_lpCharacter->GetCID());
|
||||
break;
|
||||
}
|
||||
*/
|
||||
// edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD>ŵ<EFBFBD> <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", m_lpCharacter->GetCID());
|
||||
}
|
||||
|
||||
void CGameClientDispatch::PrintGameGuardError(unsigned long dwGGErrCode)
|
||||
{
|
||||
const char* szErrorString = "<EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>";
|
||||
|
||||
switch (dwGGErrCode)
|
||||
{
|
||||
case ERROR_GGAUTH_FAIL_MEM_ALLOC:
|
||||
szErrorString = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ҵ<EFBFBD> <20><><EFBFBD><EFBFBD>";
|
||||
break;
|
||||
|
||||
case ERROR_GGAUTH_FAIL_LOAD_DLL:
|
||||
szErrorString = "ggauth.dll <20>ε<EFBFBD> <20><><EFBFBD><EFBFBD>";
|
||||
break;
|
||||
|
||||
case ERROR_GGAUTH_FAIL_GET_PROC:
|
||||
szErrorString = "ggauth.dll<6C><6C> Export <20>Լ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>";
|
||||
break;
|
||||
|
||||
case ERROR_GGAUTH_FAIL_BEFORE_INIT:
|
||||
szErrorString = "ggauth.dll<6C><6C> <20>ʱ<EFBFBD>ȭ<EFBFBD>DZ<EFBFBD> <20><><EFBFBD><EFBFBD> Export <20>Լ<EFBFBD> ȣ<><C8A3><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD>";
|
||||
break;
|
||||
|
||||
case ERROR_GGAUTH_INVALID_PARAM:
|
||||
szErrorString = "<EFBFBD>Լ<EFBFBD> ȣ<><C8A3> <20><> invalid parameter <20><><EFBFBD><EFBFBD>";
|
||||
break;
|
||||
|
||||
case ERROR_GGAUTH_NO_REPLY:
|
||||
szErrorString = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Query<72><79> <20><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>";
|
||||
break;
|
||||
|
||||
case ERROR_GGAUTH_INVALID_PROTOCOL_VERSION:
|
||||
szErrorString = "Ŭ<EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ʋ<><C6B2>";
|
||||
break;
|
||||
|
||||
case ERROR_GGAUTH_INVALID_REPLY:
|
||||
szErrorString = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Query<72><79> <20><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD>䰪<EFBFBD><E4B0AA> Ʋ<><C6B2>";
|
||||
break;
|
||||
}
|
||||
|
||||
DWORD dwCID = (0 != m_lpCharacter) ? m_lpCharacter->GetCID() : 0;
|
||||
|
||||
const int MAX_LOG = 256;
|
||||
char szLog[MAX_LOG];
|
||||
|
||||
if (0 < _snprintf(szLog, MAX_LOG - 1, "CID:0x%08x %s : %d / "
|
||||
"AQ.Index:0x%08x, AQ.V1:0x%08x, AQ.V2:0x%08x, AQ.V3:0x%08x, "
|
||||
"AA.Index:0x%08x, AA.V1:0x%08x, AA.V2:0x%08x, AA.V3:0x%08x",
|
||||
|
||||
dwCID, szErrorString, dwGGErrCode,
|
||||
|
||||
m_CSAuth2.m_AuthQuery.dwIndex,
|
||||
m_CSAuth2.m_AuthQuery.dwValue1,
|
||||
m_CSAuth2.m_AuthQuery.dwValue2,
|
||||
m_CSAuth2.m_AuthQuery.dwValue3,
|
||||
|
||||
m_CSAuth2.m_AuthAnswer.dwIndex,
|
||||
m_CSAuth2.m_AuthAnswer.dwValue1,
|
||||
m_CSAuth2.m_AuthAnswer.dwValue2,
|
||||
m_CSAuth2.m_AuthAnswer.dwValue3))
|
||||
{
|
||||
ERRLOG0(g_Log, szLog);
|
||||
}
|
||||
}
|
||||
|
||||
void CGameClientDispatch::SetCharacter(CCharacter* lpCharacter)
|
||||
{
|
||||
m_lpCharacter = lpCharacter;
|
||||
m_CheckSpeedHack.SetCharacter(lpCharacter);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
#ifndef _GAME_CLIENT_DISPATCH_H_
|
||||
#define _GAME_CLIENT_DISPATCH_H_
|
||||
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Dispatch/RylServerDispatch.h>
|
||||
#include <Network/Dispatch/CheckPing.h>
|
||||
#include <Network/Address/INET_Addr.h>
|
||||
#include <Network/Packet/PacketDispatchTable.h>
|
||||
|
||||
// edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
//#include <GameGuardLib/CSAuth.h>
|
||||
#include <GameGuardLib/ggsrv.h>
|
||||
|
||||
#include "CheckSpeedHack.h"
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CCharacter;
|
||||
class CGameClientDispatch;
|
||||
class CGameClientDispatchTable;
|
||||
|
||||
class CGameClientDispatch : public CRylServerDispatch
|
||||
{
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_PACKET_DISPATCH_PER_PULSE = 10,
|
||||
};
|
||||
|
||||
typedef bool (*FnProcess)(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
CGameClientDispatch(CSession& Session, CGameClientDispatchTable& GameClientDispatchTable);
|
||||
virtual ~CGameClientDispatch();
|
||||
|
||||
virtual bool Dispatch(void);
|
||||
virtual bool DispatchPacket(PktBase* lpPktBase);
|
||||
|
||||
virtual void Connected(void);
|
||||
virtual void Disconnected(void);
|
||||
|
||||
void Disconnect(void);
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD>
|
||||
|
||||
// edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
// unsigned long GetAuthCode(void) { return m_CSAuth.GetAuthDword(); }
|
||||
// bool CheckAuthCode(unsigned long dwReturnCode) { return (TRUE == m_CSAuth.CheckAuthDword(dwReturnCode)); }
|
||||
// bool IsAuth(void) { return (0 != m_CSAuth.IsAuth()); }
|
||||
unsigned long GetAuthCode(void) { return 0; }
|
||||
|
||||
bool GetAuthQuery(GG_AUTH_DATA** lpAuthData_Out);
|
||||
void SetAuthAnswer(const GG_AUTH_DATA& authData) { m_CSAuth2.m_AuthAnswer = authData; }
|
||||
bool CheckAuthAnswer(void);
|
||||
|
||||
// edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
// unsigned long DecryptPacket(void* lpData, unsigned long dwLength)
|
||||
// {
|
||||
// return m_CSAuth.DecryptPacket(lpData, dwLength);
|
||||
// }
|
||||
|
||||
void PrintGameGuardError(void);
|
||||
void PrintGameGuardError(unsigned long dwGGErrCode);
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
|
||||
CCharacter* GetCharacter(void) { return m_lpCharacter; }
|
||||
void SetCharacter(CCharacter* lpCharacter);
|
||||
|
||||
unsigned long GetUID(void) { return m_dwUID; }
|
||||
void SetUID(unsigned long dwUID) { m_dwUID = dwUID; }
|
||||
|
||||
void SetMoveAddress(unsigned long dwMoveServerID, const INET_Addr& moveAddress)
|
||||
{
|
||||
m_dwMoveServerID = dwMoveServerID;
|
||||
m_MoveAddress = moveAddress;
|
||||
}
|
||||
|
||||
INET_Addr& GetMoveAddress() { return m_MoveAddress; }
|
||||
unsigned long GetMoveServerID() { return m_dwMoveServerID; }
|
||||
|
||||
unsigned long PopRequestKey(void);
|
||||
void PushRequestKey(unsigned long dwRequestKey);
|
||||
|
||||
protected:
|
||||
|
||||
// <20>ʹ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><>Ŷ <20><><EFBFBD>뿡 <20><><EFBFBD>ؼ<EFBFBD> <20>α<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
virtual void ProcessTooManyPacket(CBufferQueue& bufferQueue);
|
||||
|
||||
private:
|
||||
|
||||
CCharacter* m_lpCharacter; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD>
|
||||
unsigned long m_dwUID; // ij<><C4B3><EFBFBD><EFBFBD> UID
|
||||
CGameClientDispatchTable& m_GameClientDispatchTable; // Dispatch Table
|
||||
|
||||
std::deque<unsigned long> m_DBRequestQueue; // DBRequestQueue
|
||||
|
||||
CCheckPing m_CheckPing; // <20><> üũ
|
||||
CSpeedHackCheck m_CheckSpeedHack; // <20><><EFBFBD><EFBFBD> üũ
|
||||
|
||||
// edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
// CCSAuth m_CSAuth; // GameGuard <20><><EFBFBD><EFBFBD>
|
||||
CCSAuth2 m_CSAuth2; // GameGuard <20><><EFBFBD><EFBFBD>2
|
||||
|
||||
INET_Addr m_MoveAddress;
|
||||
unsigned long m_dwMoveServerID;
|
||||
};
|
||||
|
||||
// <20><>Ŷ ó<><C3B3> <20><><EFBFBD>̺<EFBFBD>
|
||||
class CGameClientDispatchTable :
|
||||
public CPacketDispatchTable<CGameClientDispatch::FnProcess>
|
||||
{
|
||||
public:
|
||||
|
||||
static CGameClientDispatchTable& GetInstance();
|
||||
|
||||
protected:
|
||||
|
||||
CGameClientDispatchTable();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef _PACKET_PARSE_H_
|
||||
#define _PACKET_PARSE_H_
|
||||
|
||||
|
||||
#include "ParseCharItem.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharLoginOut.h" // ij<><C4B3><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20>ƿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharAttack.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharLevelUp.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharEtc.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><>Ÿ <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharSkill.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><>ų <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharCommunity.h" // ij<><C4B3><EFBFBD><EFBFBD> Ŀ<>´<EFBFBD>Ƽ <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharUpgradeItem.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B5>̵<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharAdmin.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharQuest.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharBGServer.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharCastle.h" // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
#include "ParseCharChat.h" // ij<><C4B3><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3> <20>Լ<EFBFBD>
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
#ifndef _PARSE_CHAR_ADMIN_H_
|
||||
#define _PARSE_CHAR_ADMIN_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
struct PktAdmin;
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharAdminCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
|
||||
bool ProcessAdminCmd(CCharacter* lpAdmin, CCharacter* lpTarget, PktAdmin* lpPktAdmin);
|
||||
|
||||
bool AddSpell(CCharacter* lpCaster, CCharacter* lpVictim,
|
||||
unsigned short wSpellID, unsigned short wSpellLevel, unsigned long dwDurationSec);
|
||||
|
||||
bool ParseCharNameChange(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20≯<EFBFBD> <20>ٲٱ<D9B2>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,977 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "ParseCharAttack.h"
|
||||
#include "SendCharAttack.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Dispatch/Chat/ChatDispatch.h>
|
||||
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/WrapPacket.h>
|
||||
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
||||
#include <Network/Packet/PacketStruct/CharMovePacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
|
||||
#include <Creature/CreatureManager.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/Character/CharRespawnMgr.h>
|
||||
#include <Creature/Character/SphereTree/CharSphereTree.h>
|
||||
#include <Creature/Monster/Monster.h>
|
||||
#include <Creature/Siege/SiegeObjectMgr.h>
|
||||
#include <Creature/Siege/SiegeObject.h>
|
||||
|
||||
#include <Map/FieldMap/CellManager.h>
|
||||
#include <Map/FieldMap/VirtualArea/VirtualArea.h>
|
||||
#include <Map/FieldMap/VirtualArea/VirtualAreaMgr.h>
|
||||
|
||||
#include <Community/Party/Party.h>
|
||||
#include <Log/ItemLog.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <Utility/Math/Math.h>
|
||||
|
||||
//#include <Network/Dispatch/PacketDecrypt.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
bool GameClientParsePacket::ParseCharAttack(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
/* // <20><><EFBFBD><EFBFBD> <20><><EFBFBD>忡 <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><>ȣȭ
|
||||
// edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
unsigned long dwOriginalSize =
|
||||
PacketDecrypt(reinterpret_cast<void*>(lpPktBase + 1), lpPktBase->GetLen() - sizeof(PktBase));
|
||||
if (0 == dwOriginalSize)
|
||||
{
|
||||
GameClientDispatch.PrintGameGuardError();
|
||||
return false;
|
||||
}
|
||||
lpPktBase->SetLen(static_cast<PktBase::LengthType>(sizeof(PktBase) + dwOriginalSize));
|
||||
*/
|
||||
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktAt), GameClientDispatch);
|
||||
|
||||
PktAt* lpPktAt = static_cast<PktAt*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
|
||||
unsigned short usError = PktBase::NO_SERVER_ERR;
|
||||
|
||||
unsigned long dwCharID = lpPktAt->m_dwCharID;
|
||||
|
||||
AtType AtType = lpPktAt->m_AtType;
|
||||
AtNode AtNode = lpPktAt->m_AtNode;
|
||||
|
||||
lpCharacter->MoveTo(lpPktAt->m_Postion, false);
|
||||
lpCharacter->SetDirection(lpPktAt->m_fDir);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> ž<><C5BE><EFBFBD>ϰ<EFBFBD> <20>ִٸ<D6B4>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
|
||||
if (Creature::CT_SIEGE_OBJECT == Creature::GetCreatureType(dwCharID) && lpCharacter->IsRideArms())
|
||||
{
|
||||
CSiegeObject* lpArms = CSiegeObjectMgr::GetInstance().GetSiegeObject(dwCharID);
|
||||
if (lpArms)
|
||||
{
|
||||
lpArms->MoveTo(lpPktAt->m_Postion);
|
||||
lpArms->SetDirection(lpPktAt->m_fDir);
|
||||
}
|
||||
|
||||
if (false == lpArms->AttackCID(lpCharacter, AtType, AtNode, usError))
|
||||
{
|
||||
if (PktBase::NO_SERVER_ERR == usError)
|
||||
{
|
||||
usError = PktAtAck::SERVER_ERROR;
|
||||
}
|
||||
|
||||
CSendStream& SendStream = GameClientDispatch.GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktAtAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktAtAck* lpPktAtAck = reinterpret_cast<PktAtAck*>(lpBuffer);
|
||||
|
||||
lpPktAtAck->m_dwCharID = 0;
|
||||
|
||||
lpPktAtAck->m_wHP = 0;
|
||||
lpPktAtAck->m_wMP = 0;
|
||||
lpPktAtAck->m_wMPHeal = 0;
|
||||
|
||||
lpPktAtAck->m_cJudge = 0;
|
||||
lpPktAtAck->m_cDefenserNum = 0;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktAtAck), CmdCharAttack, 0, usError);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// ij<><C4B3><EFBFBD><EFBFBD>
|
||||
if (0 != AtType.m_cCasting)
|
||||
{
|
||||
lpCharacter->Casting(AtType, AtNode);
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD>
|
||||
else
|
||||
{
|
||||
if (false == lpCharacter->AttackCID(AtType, AtNode, usError))
|
||||
{
|
||||
if (PktBase::NO_SERVER_ERR == usError)
|
||||
{
|
||||
usError = PktAtAck::SERVER_ERROR;
|
||||
}
|
||||
|
||||
CSendStream& SendStream = GameClientDispatch.GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktAtAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktAtAck* lpPktAtAck = reinterpret_cast<PktAtAck*>(lpBuffer);
|
||||
|
||||
lpPktAtAck->m_dwCharID = 0;
|
||||
|
||||
lpPktAtAck->m_wHP = 0;
|
||||
lpPktAtAck->m_wMP = 0;
|
||||
lpPktAtAck->m_wMPHeal = 0;
|
||||
|
||||
lpPktAtAck->m_cJudge = 0;
|
||||
lpPktAtAck->m_cDefenserNum = 0;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktAtAck), CmdCharAttack, 0, usError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20>չٲٱ<D9B2>
|
||||
bool GameClientParsePacket::ParseCharSwitchEQ(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSwEQ), GameClientDispatch);
|
||||
|
||||
PktSwEQ* lpPktSwEQ = static_cast<PktSwEQ*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned char cType = lpPktSwEQ->m_cType;
|
||||
unsigned char cSelect = lpPktSwEQ->m_cSelect;
|
||||
|
||||
bool bResult = false;
|
||||
|
||||
if(cType == 0)
|
||||
{
|
||||
bResult = lpCharacter->ChangeWeaponAndShield(cSelect);
|
||||
GAMELOG::LogChangeWeapon(*lpCharacter, cSelect);
|
||||
}
|
||||
else if(cType == 1)
|
||||
{
|
||||
// edith 2008.06.23 <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
bResult = lpCharacter->ChangeRide(cSelect);
|
||||
GAMELOG::LogChangeRide(*lpCharacter, cSelect);
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharRespawn(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktRs), GameClientDispatch);
|
||||
|
||||
PktRs* lpPktRs = static_cast<PktRs*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktRs->m_dwCharID;
|
||||
unsigned char cCmd = lpPktRs->m_cCmd;
|
||||
unsigned long dwTownID = lpPktRs->m_dwTownID;
|
||||
Position DestPos = lpPktRs->m_Position;
|
||||
|
||||
switch (cCmd)
|
||||
{
|
||||
case PktRs::RS_NORMAL:
|
||||
{
|
||||
if (false == lpCharacter->Respawn())
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>.", dwCharID);
|
||||
}
|
||||
else if (0 != lpCharacter->GetPID())
|
||||
{
|
||||
// <20><>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˸<EFBFBD><CBB8><EFBFBD>.
|
||||
GameClientSendPacket::SendCharDeadToParty(lpCharacter, 0, PktDeadInfo::RESPAWN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PktRs::RS_SELECT:
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20>߰<EFBFBD>
|
||||
// ... <20>ùٸ<C3B9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˻<EFBFBD><CBBB><EFBFBD> <20>Ŀ<EFBFBD> <20>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD>!!
|
||||
unsigned char eRet = CCharRespawnMgr::GetInstance().AddCharacter(dwTownID, dwCharID);
|
||||
|
||||
switch (eRet)
|
||||
{
|
||||
case CCharRespawnMgr::RET_TRUE:
|
||||
{
|
||||
// edith 2009.08.26 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>߰<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
lpCharacter->SetRespawnTownID(dwTownID);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٽ<EFBFBD> <20>ѹ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
|
||||
CCharRespawnMgr::GetInstance().SendRespawnAreaInfo(dwCharID, dwTownID, true);
|
||||
}
|
||||
break;
|
||||
|
||||
case CCharRespawnMgr::RET_TOWN:
|
||||
{
|
||||
// <20>ٷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (false == lpCharacter->Respawn(CCharRespawnMgr::RST_TOWN, CCharRespawnMgr::GetInstance().GetRespawnPos(dwTownID)))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>.", dwCharID);
|
||||
}
|
||||
else if (0 != lpCharacter->GetPID())
|
||||
{
|
||||
// <20><>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˸<EFBFBD><CBB8><EFBFBD>.
|
||||
GameClientSendPacket::SendCharDeadToParty(lpCharacter, 0, PktDeadInfo::RESPAWN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case CCharRespawnMgr::RET_FALSE:
|
||||
{
|
||||
ERRLOG2(g_Log, "CID:0x%08x TownID : 0x%08x ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>.", dwCharID, dwTownID);
|
||||
|
||||
CSendStream& SendStream = GameClientDispatch.GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktRsAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktRsAck* lpPktRsAck = reinterpret_cast<PktRsAck*>(lpBuffer);
|
||||
::memset(lpPktRsAck, 0, sizeof(PktRsAck));
|
||||
SendStream.WrapCrypt(sizeof(PktRsAck), CmdCharRespawn, 0, PktRsAck::ERR_NOT_EXIST_CAMP);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PktRs::RS_FORMER_PLACE:
|
||||
{
|
||||
// TODO : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ڸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
break;
|
||||
}
|
||||
|
||||
case PktRs::RS_BG_HUMAN1:
|
||||
case PktRs::RS_BG_HUMAN2:
|
||||
case PktRs::RS_BG_HUMAN3:
|
||||
case PktRs::RS_BG_AKHAN1:
|
||||
case PktRs::RS_BG_AKHAN2:
|
||||
case PktRs::RS_BG_AKHAN3:
|
||||
{
|
||||
if (SERVER_ID::ZONE3 == CServerSetup::GetInstance().GetServerZone())
|
||||
{
|
||||
// TODO : <20>ٸ<EFBFBD> Ŀ<>ǵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȣ<EFBFBD><C8A3> 3<><33> <20>и<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD>. Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> Ŀ<><C4BF>Ʈ <20>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD> <20>ٲ㼭 <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> ó<><C3B3> <20><><EFBFBD><EFBFBD>
|
||||
CCreatureManager::GetInstance().PushRespawnQueue(lpCharacter, cCmd - 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD>尡 <20>ƴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// BG_TODO : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3> (Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20>̰<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ѵ<EFBFBD>.)
|
||||
case PktRs::RS_BGSERVER_RANDOM:
|
||||
{
|
||||
if (lpCharacter->GetRace() > CClass::MAX_RACE)
|
||||
{
|
||||
ERRLOG2(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̻<EFBFBD><CCBB>մϴ<D5B4>. <20><><EFBFBD><EFBFBD>:%d", dwCharID, lpCharacter->GetRace());
|
||||
break;
|
||||
}
|
||||
|
||||
VirtualArea::CVirtualArea* lpVirtualArea = VirtualArea::CVirtualAreaMgr::GetInstance().GetVirtualArea( lpCharacter->GetMapIndex() );
|
||||
if (NULL == lpVirtualArea)
|
||||
{
|
||||
ERRLOG2(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>(MapIndex : %d)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.", dwCharID, lpCharacter->GetMapIndex());
|
||||
break;
|
||||
}
|
||||
|
||||
DestPos = lpVirtualArea->GetRespawnPosition( lpCharacter->GetRace(), Math::Random::ComplexRandom( lpVirtualArea->GetMaxRespawnPos() ) );
|
||||
if (false == lpCharacter->Respawn(CCharRespawnMgr::RST_BATTLE, DestPos))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>.", dwCharID);
|
||||
}
|
||||
else if (0 != lpCharacter->GetPID())
|
||||
{
|
||||
// <20><>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˸<EFBFBD><CBB8><EFBFBD>.
|
||||
GameClientSendPacket::SendCharDeadToParty(lpCharacter, 0, PktDeadInfo::RESPAWN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PktRs::RS_BG_EXIT:
|
||||
{
|
||||
if (SERVER_ID::ZONE3 == CServerSetup::GetInstance().GetServerZone())
|
||||
{
|
||||
unsigned char cZone = SERVER_ID::NONE;
|
||||
switch (lpCharacter->GetRace())
|
||||
{
|
||||
case CClass::HUMAN:
|
||||
cZone = SERVER_ID::ZONE1;
|
||||
break;
|
||||
|
||||
case CClass::AKHAN:
|
||||
cZone = SERVER_ID::ZONE2;
|
||||
break;
|
||||
|
||||
default:
|
||||
ERRLOG2(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̻<EFBFBD><CCBB>մϴ<D5B4>. <20><><EFBFBD><EFBFBD>:%d", dwCharID, lpCharacter->GetRace());
|
||||
return true;
|
||||
}
|
||||
|
||||
lpCharacter->GetStatus().m_nNowHP = lpCharacter->GetStatus().m_StatusInfo.m_nMaxHP;
|
||||
lpCharacter->GetStatus().m_nNowMP = lpCharacter->GetStatus().m_StatusInfo.m_nMaxMP;
|
||||
|
||||
// ä<><C3A4><EFBFBD><EFBFBD> 2<><32> <20>̻<EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> ä<><C3A4>â<EFBFBD><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD>ְ<EFBFBD> <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
||||
// <20><> <20><><EFBFBD><EFBFBD> ä<><C3A4>â<EFBFBD><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> 1ä<31>η<EFBFBD> <20><><EFBFBD><EFBFBD> <20>̵<EFBFBD><CCB5><EFBFBD>Ű<EFBFBD><C5B0> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>. (2004-09-20 by <20>ε<EFBFBD>)
|
||||
if (false == lpCharacter->MoveZone(lpPktRs->m_Position, cZone, 0))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> Ż<> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD>尡 <20>ƴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> Ż<><C5BB><EFBFBD><EFBFBD> <20>õ<EFBFBD><C3B5>մϴ<D5B4>.", dwCharID);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŀ<>ǵ<EFBFBD><C7B5>Դϴ<D4B4>.", dwCharID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ť <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
bool GameClientParsePacket::ParseCharRespawnWaitQueue(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktRsWaitQueue), GameClientDispatch);
|
||||
|
||||
PktRsWaitQueue* lpRsWQ = static_cast<PktRsWaitQueue *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpRsWQ->m_dwCharID;
|
||||
|
||||
return CCreatureManager::GetInstance().SendRespawnQueue(dwCharID);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ<EFBFBD><C4A1>)
|
||||
bool GameClientParsePacket::ParseCharRespawnInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktRsInfo), GameClientDispatch);
|
||||
|
||||
PktRsInfo* lpRsInfo = static_cast<PktRsInfo *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpRsInfo->m_dwCharID;
|
||||
|
||||
return CCharRespawnMgr::GetInstance().SendRespawnInfo(dwCharID);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharRespawnAreaInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktRsAreaInfo), GameClientDispatch);
|
||||
|
||||
PktRsAreaInfo* lpRsAreaInfo = static_cast<PktRsAreaInfo *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpRsAreaInfo->m_dwCharID;
|
||||
unsigned long dwTownID = lpRsAreaInfo->m_dwTownID;
|
||||
|
||||
return CCharRespawnMgr::GetInstance().SendRespawnAreaInfo(dwCharID, dwTownID);
|
||||
}
|
||||
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ
|
||||
/*
|
||||
bool GameClientParsePacket::ParseCharMoveUpdate(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktMU), GameClientDispatch);
|
||||
|
||||
PktMU* lpPktMU = static_cast<PktMU*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
POS Pos = lpPktMU->m_Position;
|
||||
bool bSitMode = lpPktMU->m_bSitMode;
|
||||
|
||||
Position DestPos = Pos;
|
||||
switch (lpCharacter->MoveTo(DestPos, bSitMode))
|
||||
{
|
||||
case CCreature::S_CELL_CHANGED: break; // <20><> ü<><C3BC><EFBFBD><EFBFBD>
|
||||
case CCreature::S_CELL_UNCHANGED: break; // <20>̵<EFBFBD>
|
||||
case CCreature::F_CELL_CANNOTCHANGE: break; // <20><> ü<><C3BC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
case CCreature::F_TOO_FAST: break; // <20>̵<EFBFBD> Ʀ
|
||||
}
|
||||
|
||||
if (lpCharacter->IsRideArms())
|
||||
{
|
||||
CSiegeObject* lpArms = CSiegeObjectMgr::GetInstance().GetSiegeObject(lpCharacter->GetRideArmsCID());
|
||||
if (lpArms)
|
||||
{
|
||||
lpArms->MoveTo(DestPos);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharDuelCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktDuC), GameClientDispatch);
|
||||
|
||||
PktDuC* lpPktDuC = static_cast<PktDuC*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwSenderID = lpPktDuC->m_dwSenderID;
|
||||
unsigned long dwRecverID = lpPktDuC->m_dwRecverID;
|
||||
unsigned char cCmd = lpPktDuC->m_cCmd;
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
CCharacter* lpSCharacter = CCreatureManager::GetInstance().GetCharacter(dwSenderID);
|
||||
CCharacter* lpRCharacter = CCreatureManager::GetInstance().GetCharacter(dwRecverID);
|
||||
if (NULL == lpSCharacter || NULL == lpRCharacter)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::SERVER_ERROR);
|
||||
ERRLOG2(g_Log, "CID:0x%08x (Recver), SenderCID:0x%08x ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.", dwRecverID, dwSenderID);
|
||||
return true;
|
||||
}
|
||||
|
||||
CGameClientDispatch* lpSendDispatch = lpSCharacter->GetDispatcher();
|
||||
CGameClientDispatch* lpRecvDispatch = lpRCharacter->GetDispatcher();
|
||||
|
||||
switch (cCmd)
|
||||
{
|
||||
case PktDuC::DUC_PROPOSE: // <20><><EFBFBD><EFBFBD>
|
||||
{
|
||||
if (NULL != lpSCharacter->GetDuelOpponent() || NULL != lpRCharacter->GetDuelOpponent())
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_DUELING_CHAR);
|
||||
break;
|
||||
}
|
||||
|
||||
if (lpRCharacter->GetRejectOption().Reject.m_Duel ||
|
||||
lpRCharacter->GetBanList().IsBan(lpCharacter->GetCID(), lpCharacter->GetCharacterName()))
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_REJECT);
|
||||
break;
|
||||
}
|
||||
|
||||
if (NULL != lpRecvDispatch)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(lpRecvDispatch->GetSendStream(),
|
||||
dwSenderID, dwRecverID, cCmd, PktDuC::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
case PktDuC::DUC_READY: // <20><><EFBFBD><EFBFBD>
|
||||
{
|
||||
if (NULL != lpSCharacter->GetDuelOpponent() || NULL != lpRCharacter->GetDuelOpponent())
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_DUELING_CHAR);
|
||||
break;
|
||||
}
|
||||
|
||||
lpSCharacter->SetDuelOpponent(lpRCharacter);
|
||||
lpRCharacter->SetDuelOpponent(lpSCharacter);
|
||||
|
||||
if (NULL != lpSendDispatch)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(lpSendDispatch->GetSendStream(),
|
||||
dwSenderID, dwRecverID, cCmd, PktDuC::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
if (NULL != lpRecvDispatch)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(lpRecvDispatch->GetSendStream(),
|
||||
dwSenderID, dwRecverID, cCmd, PktDuC::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
case PktDuC::DUC_REFUSE: // <20><><EFBFBD><EFBFBD>
|
||||
{
|
||||
if (NULL != lpRecvDispatch)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(lpRecvDispatch->GetSendStream(),
|
||||
dwSenderID, dwRecverID, cCmd, PktDuC::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
case PktDuC::DUC_REQUEST_PARTY_INFO: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ƽ <20><><EFBFBD><EFBFBD> <20><>û
|
||||
{
|
||||
CCharacterParty* lpSParty = reinterpret_cast<CCharacterParty* >(lpSCharacter->GetParty());
|
||||
CCharacterParty* lpRParty = reinterpret_cast<CCharacterParty* >(lpRCharacter->GetParty());
|
||||
if (NULL == lpSParty || NULL == lpRParty)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_NOT_PARTY);
|
||||
break;
|
||||
}
|
||||
|
||||
if (false == lpSParty->IsLeader(lpSCharacter->GetCID()))
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_NOT_LEADER);
|
||||
break;
|
||||
}
|
||||
|
||||
if (NULL != lpSParty->GetHostileParty() || NULL != lpRParty->GetHostileParty())
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_DUELING_CHAR);
|
||||
break;
|
||||
}
|
||||
|
||||
const int MAX_BUFFER = sizeof(PktTBInfo) + PARTY::MAX_MEM * (sizeof(unsigned long) + sizeof(unsigned char));
|
||||
char Buffer[MAX_BUFFER];
|
||||
unsigned short dwBufferSize = 0;
|
||||
|
||||
if (true == lpRParty->MakeTeamBattleInfo(Buffer, dwBufferSize, lpRCharacter, cCmd))
|
||||
{
|
||||
if (NULL != lpSendDispatch)
|
||||
{
|
||||
lpSendDispatch->GetSendStream().PutBuffer(Buffer, dwBufferSize, CmdCharTeamBattleInfo);
|
||||
}
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
case PktDuC::DUC_PARTY_PROPOSE: // <20><>Ƽ <20><><EFBFBD><EFBFBD> <20><>û
|
||||
{
|
||||
CCharacterParty* lpSParty = reinterpret_cast<CCharacterParty* >(lpSCharacter->GetParty());
|
||||
CCharacterParty* lpRParty = reinterpret_cast<CCharacterParty* >(lpRCharacter->GetParty());
|
||||
if (NULL == lpSParty || NULL == lpRParty)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_NOT_PARTY);
|
||||
break;
|
||||
}
|
||||
|
||||
if (NULL != lpSParty->GetHostileParty() || NULL != lpRParty->GetHostileParty())
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_DUELING_CHAR);
|
||||
break;
|
||||
}
|
||||
|
||||
const int MAX_BUFFER = sizeof(PktTBInfo) + PARTY::MAX_MEM * (sizeof(unsigned long) + sizeof(unsigned char));
|
||||
char Buffer[MAX_BUFFER];
|
||||
unsigned short dwBufferSize = 0;
|
||||
|
||||
if (true == lpSParty->MakeTeamBattleInfo(Buffer, dwBufferSize, lpSCharacter, cCmd))
|
||||
{
|
||||
CCharacter* pLeader = CCreatureManager::GetInstance().GetCharacter(lpRParty->GetLeader());
|
||||
if (NULL == pLeader)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::SERVER_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
CGameClientDispatch* pDispatch = pLeader->GetDispatcher();
|
||||
if (NULL != pDispatch)
|
||||
{
|
||||
pDispatch->GetSendStream().PutBuffer(Buffer, dwBufferSize, CmdCharTeamBattleInfo);
|
||||
}
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
case PktDuC::DUC_PARTY_READY: // <20><>Ƽ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
{
|
||||
CCharacterParty* lpSParty = reinterpret_cast<CCharacterParty* >(lpSCharacter->GetParty());
|
||||
CCharacterParty* lpRParty = reinterpret_cast<CCharacterParty* >(lpRCharacter->GetParty());
|
||||
if (NULL == lpSParty || NULL == lpRParty)
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_NOT_PARTY);
|
||||
break;
|
||||
}
|
||||
|
||||
if (NULL != lpSParty->GetHostileParty() || NULL != lpRParty->GetHostileParty())
|
||||
{
|
||||
GameClientSendPacket::SendCharDuelCmd(GameClientDispatch.GetSendStream(), dwSenderID, dwRecverID, cCmd, PktDuC::FAIL_DUELING_CHAR);
|
||||
break;
|
||||
}
|
||||
|
||||
lpSParty->StartTeamBattle(lpRParty);
|
||||
lpRParty->StartTeamBattle(lpSParty);
|
||||
|
||||
} break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharPeaceMode(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
// DELETE_ME : <20><><EFBFBD>̻<EFBFBD> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ұ<EFBFBD><D2B0><EFBFBD><EFBFBD>ϴ<EFBFBD>. <20><><EFBFBD>丸 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>. (2005-05-31 by <20>ε<EFBFBD>)
|
||||
/*
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktPeace), GameClientDispatch);
|
||||
|
||||
PktPeace* lpPktPeace = static_cast<PktPeace *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktPeace->m_dwCharID;
|
||||
bool bPeace = lpPktPeace->m_bPeace;
|
||||
|
||||
unsigned short wError = PktPeace::NO_SERVER_ERR;
|
||||
char cLeftTime = -1;
|
||||
|
||||
char cServerZone = CServerSetup::GetInstance().GetServerZone();
|
||||
if (SERVER_ID::ZONE3 == cServerZone)
|
||||
{
|
||||
wError = PktPeace::FAIL_BATTLE_GROUND;
|
||||
goto SEND_PACKET;
|
||||
}
|
||||
|
||||
if (0 != lpCharacter->GetGID())
|
||||
{
|
||||
wError = PktPeace::FAIL_GUILD_MEMBER;
|
||||
goto SEND_PACKET;
|
||||
}
|
||||
|
||||
cLeftTime = lpCharacter->SetPeaceMode(bPeace);
|
||||
if (-1 == cLeftTime)
|
||||
{
|
||||
wError = PktPeace::FAIL_WRONG_SYNC;
|
||||
}
|
||||
|
||||
SEND_PACKET:
|
||||
|
||||
return GameClientSendPacket::SendCharPeaceMode(GameClientDispatch.GetSendStream(), dwCharID,
|
||||
cLeftTime, bPeace, wError);
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><>ȯ<EFBFBD><C8AF> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharSummonCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSummonCmd), GameClientDispatch);
|
||||
|
||||
PktSummonCmd* lpPktSuC = static_cast<PktSummonCmd *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktSuC->m_dwCharID;
|
||||
unsigned char cCmd = lpPktSuC->m_cCmd;
|
||||
unsigned long dwTargetID = lpPktSuC->m_dwTargetID;
|
||||
|
||||
CMonster* lpSummonee = lpCharacter->GetSummonee();
|
||||
if (NULL == lpSummonee)
|
||||
{
|
||||
ERRLOG3(g_Log, "CID:0x%08x <20><>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD> <20><>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20><>ȯ<EFBFBD><C8AF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƚ<EFBFBD><C8BD>ϴ<EFBFBD>. cCmd:%d, dwTargetID:0x%08x",
|
||||
dwCharID, cCmd, dwTargetID);
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (cCmd)
|
||||
{
|
||||
case PktSummonCmd::SUC_ATTACK:
|
||||
{
|
||||
CAggresiveCreature* lpTarget = CCreatureManager::GetInstance().GetAggresiveCreature(dwTargetID);
|
||||
if (NULL == lpTarget)
|
||||
{
|
||||
ERRLOG2(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> ID<49><44> Ÿ<><C5B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƚ<EFBFBD><C8BD>ϴ<EFBFBD>. TargetID:0x%08x",
|
||||
dwCharID, dwTargetID);
|
||||
break;
|
||||
}
|
||||
|
||||
lpSummonee->GetThreat().ClearThreatList();
|
||||
lpSummonee->AttackCmd(lpTarget, 1);
|
||||
|
||||
} break;
|
||||
|
||||
case PktSummonCmd::SUC_RETURN:
|
||||
{
|
||||
lpSummonee->CancelTarget();
|
||||
|
||||
} break;
|
||||
|
||||
case PktSummonCmd::SUC_DIE:
|
||||
{
|
||||
// <20>Ҹ<EFBFBD><D2B8><EFBFBD> <20><><EFBFBD>ε<EFBFBD>ij<EFBFBD><C4B3><EFBFBD>õȴ<C3B5>.
|
||||
return lpSummonee->Dead(NULL);
|
||||
|
||||
} break;
|
||||
|
||||
case PktSummonCmd::SUC_GUARD_ON:
|
||||
{
|
||||
lpSummonee->SetGuard(true);
|
||||
|
||||
} break;
|
||||
|
||||
case PktSummonCmd::SUC_GUARD_OFF:
|
||||
{
|
||||
lpSummonee->SetGuard(false);
|
||||
|
||||
} break;
|
||||
}
|
||||
|
||||
return GameClientSendPacket::SendCharSummonCmd(lpCharacter, lpSummonee, cCmd, dwTargetID);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientParsePacket::ParseCharMoveEx(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
const unsigned long CA_WAIT = 0;
|
||||
const unsigned long CA_RUN = 1;
|
||||
const unsigned long CA_ATTACK = 2;
|
||||
const unsigned long CA_MOVEATTACK = 3;
|
||||
const unsigned long CA_WALKBACK = 4;
|
||||
const unsigned long CA_WALKLEFT = 5;
|
||||
const unsigned long CA_WALKRIGHT = 6;
|
||||
const unsigned long CA_BASH = 7;
|
||||
const unsigned long CA_WALK = 8;
|
||||
const unsigned long CA_FALLDOWN = 9;
|
||||
const unsigned long CA_REST = 10;
|
||||
const unsigned long CA_SITDOWN = 11;
|
||||
const unsigned long CA_STANDUP = 12;
|
||||
const unsigned long CA_ATTACKADVANCE = 13;
|
||||
const unsigned long CA_ATTACKLEFT = 14;
|
||||
const unsigned long CA_ATTACKRIGHT = 15;
|
||||
const unsigned long CA_ATTACKRETREAT = 16;
|
||||
const unsigned long CA_ATTACK2 = 17;
|
||||
const unsigned long CA_ATTACK3 = 18;
|
||||
const unsigned long CA_ATTACK4 = 19;
|
||||
const unsigned long CA_RESPAWN = 20;
|
||||
const unsigned long CA_JUMP = 21;
|
||||
const unsigned long CA_LEFTDASH = 22;
|
||||
const unsigned long CA_RIGHTDASH = 23;
|
||||
const unsigned long CA_CASTING = 24;
|
||||
const unsigned long CA_FIRE1 = 25;
|
||||
const unsigned long CA_FIRE2 = 26;
|
||||
const unsigned long CA_COMBINATIONBLOW = 27;
|
||||
const unsigned long CA_BACKSTAB = 28;
|
||||
const unsigned long CA_AIMEDSHOT2 = 29;
|
||||
const unsigned long CA_ATTACK5 = 30;
|
||||
const unsigned long CA_ATTACK6 = 31;
|
||||
const unsigned long CA_BACKDASH = 32;
|
||||
const unsigned long CA_AIMEDSHOT1 = 33;
|
||||
const unsigned long CA_JUMPATTACK = 34;
|
||||
const unsigned long CA_JUMPATTACK2 = 35;
|
||||
const unsigned long CA_FRONTDASH = 36;
|
||||
const unsigned long CA_LAND = 37;
|
||||
const unsigned long CA_FORWARDJUMP = 38;
|
||||
const unsigned long CA_BACKJUMP = 40;
|
||||
const unsigned long CA_SHOT = 41;
|
||||
const unsigned long CA_JUMPSHOT = 42;
|
||||
const unsigned long CA_OVERBASH1 = 43;
|
||||
const unsigned long CA_OVERBASH2 = 44;
|
||||
const unsigned long CA_OVERBASH3 = 45;
|
||||
const unsigned long CA_OVERBASH4 = 46;
|
||||
const unsigned long CA_OVERBASH5 = 47;
|
||||
const unsigned long CA_POWERDRAIN = 48;
|
||||
const unsigned long CA_TURNPUNCH1 = 49;
|
||||
const unsigned long CA_TURNPUNCH2 = 50;
|
||||
const unsigned long CA_TURNPUNCH3 = 51;
|
||||
const unsigned long CA_JUMPATTACK3 = 52;
|
||||
const unsigned long CA_AIMEDSHOT3 = 53;
|
||||
const unsigned long CA_STUN = 54;
|
||||
const unsigned long CA_ROUNDSWING = 55;
|
||||
const unsigned long CA_SUMMON = 56;
|
||||
const unsigned long CA_HIT1 = 57;
|
||||
const unsigned long CA_WAITH1 = 58;
|
||||
const unsigned long CA_HIT2 = 59;
|
||||
const unsigned long CA_WAITH2 = 60;
|
||||
const unsigned long CA_SWIM = 100;
|
||||
const unsigned long CA_FORWARD = 101; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD>
|
||||
const unsigned long CA_BACKWARD = 102; // <20><><EFBFBD><EFBFBD> <20>ڷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD>
|
||||
|
||||
const unsigned long CA_GATHERSTART = 111;
|
||||
const unsigned long CA_GATHER01 = 111;
|
||||
const unsigned long CA_GATHER02 = 112;
|
||||
const unsigned long CA_GATHER03 = 113;
|
||||
const unsigned long CA_GATHER04 = 114;
|
||||
const unsigned long CA_GATHER05 = 115;
|
||||
const unsigned long CA_GATHER06 = 116;
|
||||
const unsigned long CA_GATHER07 = 117;
|
||||
const unsigned long CA_GATHER08 = 118;
|
||||
const unsigned long CA_GATHER09 = 119;
|
||||
const unsigned long CA_GATHER10 = 120;
|
||||
const unsigned long CA_GATHEREND = 120;
|
||||
|
||||
const unsigned long CA_SOCIALSTART = 151;
|
||||
const unsigned long CA_SOCIAL_LAUGH = 151;
|
||||
const unsigned long CA_SOCIAL_DESPAIR = 152;
|
||||
const unsigned long CA_SOCIAL_SHY = 153;
|
||||
const unsigned long CA_SOCIAL_SURPRISE = 154;
|
||||
const unsigned long CA_SOCIAL_ROAR = 155;
|
||||
const unsigned long CA_SOCIAL_WAVE = 156;
|
||||
const unsigned long CA_SOCIAL_THANK = 157;
|
||||
const unsigned long CA_SOCIAL_SORRY = 158;
|
||||
const unsigned long CA_SOCIAL_SALUTE = 159;
|
||||
const unsigned long CA_SOCIAL_CHEER = 160;
|
||||
const unsigned long CA_SOCIAL_NOD = 161;
|
||||
const unsigned long CA_SOCIAL_NO = 162;
|
||||
const unsigned long CA_SOCIAL_CHARGE = 163;
|
||||
const unsigned long CA_SOCIAL_COMFORT = 164;
|
||||
const unsigned long CA_SOCIAL_TALK = 165;
|
||||
const unsigned long CA_SOCIALEND = 165;
|
||||
|
||||
PktMVEx* lpPktMVEx = static_cast<PktMVEx*>(lpPktBase);
|
||||
|
||||
unsigned long dwCID = lpPktMVEx->GetServerInfo();
|
||||
unsigned char cUAct = lpPktMVEx->m_cUAct;
|
||||
unsigned char cLAct = lpPktMVEx->m_cLAct;
|
||||
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> CID<49><44>, <20>ڱ<EFBFBD> CID<49>ų<EFBFBD>, <20>ڽ<EFBFBD><DABD><EFBFBD> Ÿ<><C5B8><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CID<49><44> <20><><EFBFBD>쿡<EFBFBD><ECBFA1> <20>ֺ<EFBFBD><D6BA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
if (0 != lpCharacter &&
|
||||
(dwCID == lpCharacter->GetCID() || dwCID == lpCharacter->GetRideArmsCID()))
|
||||
{
|
||||
CNetworkPos& netPos = lpPktMVEx->m_NetworkPos;
|
||||
Position Pos(netPos.GetXPos(), netPos.GetYPos(), netPos.GetZPos());
|
||||
|
||||
if(lpCharacter->IsLogined())
|
||||
{
|
||||
Position oldPos = lpCharacter->GetCurrentPos();
|
||||
unsigned long dis = Pos.GetDistance(oldPos);
|
||||
|
||||
if(dis > 100 && 0 == lpCharacter->GetAdminLevel())
|
||||
{
|
||||
// ILLEGAL_WARPPOS
|
||||
// edtih 2009.07.21 <20>ҹ<EFBFBD><D2B9>̵<EFBFBD> <20><><EFBFBD><EFBFBD> <20>α<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GAMELOG::LogIllegalWarpPos(*lpCharacter, oldPos, Pos);
|
||||
}
|
||||
|
||||
// CA_REST == 10<31>̴<EFBFBD>.
|
||||
lpCharacter->MoveTo(Pos, (cUAct == CA_REST) && (cLAct == CA_REST));
|
||||
lpCharacter->IncrementMoveUpdateCount();
|
||||
lpCharacter->SetDirection(netPos.GetDirection());
|
||||
|
||||
// CharSphereTree <20><> <20><><EFBFBD><EFBFBD> <20><>ǥ <20><><EFBFBD><EFBFBD>
|
||||
CCharSphereTree::GetInstance().MoveTo( lpCharacter->GetCID(), Pos );
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ž<>½<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
CSiegeObject* lpArms = NULL;
|
||||
if (lpCharacter->IsRideArms() && dwCID == lpCharacter->GetRideArmsCID())
|
||||
{
|
||||
lpArms = CSiegeObjectMgr::GetInstance().GetSiegeObject(dwCID);
|
||||
if (lpArms)
|
||||
{
|
||||
lpArms->MoveTo(Pos);
|
||||
lpArms->SetDirection(netPos.GetDirection());
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char cLastUpdateCount = lpCharacter->GetMoveUpdateCount();
|
||||
unsigned long dwCurrentTime = timeGetTime();
|
||||
unsigned long dwLastMoveUpdateTime = lpCharacter->GetLastMoveUpdateTime();
|
||||
|
||||
lpCharacter->SetLastMoveUpdateTime(dwCurrentTime);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ڷ<EFBFBD> 150ms<6D>̻<EFBFBD> <20>귶<EFBFBD><EAB7B6> <20><>.
|
||||
|
||||
bool bForceSend = true;
|
||||
|
||||
switch(cUAct)
|
||||
{
|
||||
case CA_WAIT:
|
||||
case CA_WALK:
|
||||
case CA_RUN:
|
||||
case CA_REST:
|
||||
bForceSend = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if(50 < dwCurrentTime - dwLastMoveUpdateTime || bForceSend)
|
||||
{
|
||||
// <20>ֺ<EFBFBD> <20><> <20>ο<EFBFBD><CEBF><EFBFBD> <20>ľ<EFBFBD>.
|
||||
CCell* lpCell = lpCharacter->GetCellPos().m_lpCell;
|
||||
|
||||
if(0 != lpCell)
|
||||
{
|
||||
size_t nCharacterNum = lpCell->GetNearCellCharacterNum();
|
||||
bool bSendData = false;
|
||||
|
||||
if(nCharacterNum < 100)
|
||||
{
|
||||
// 100<30≯<EFBFBD> (<28>Ź<EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
bSendData = true;
|
||||
}
|
||||
else if(nCharacterNum < 200)
|
||||
{
|
||||
// 100~200<30><30><EFBFBD><EFBFBD> (4<><34><EFBFBD><EFBFBD> 1<><31> <20>Ⱥ<EFBFBD><C8BA><EFBFBD>)
|
||||
bSendData = (0 != (cLastUpdateCount % 4));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 200<30><30> <20>̻<EFBFBD> (4<><34><EFBFBD><EFBFBD> 2<><32> <20>Ⱥ<EFBFBD><C8BA><EFBFBD>)
|
||||
bSendData = (0 != (cLastUpdateCount % 2));
|
||||
}
|
||||
|
||||
if(bSendData || bForceSend)
|
||||
{
|
||||
PktMVEx pktMVEx;
|
||||
memset(&pktMVEx, 0, sizeof(PktMVEx));
|
||||
|
||||
pktMVEx.m_NetworkPos = netPos;
|
||||
pktMVEx.m_cUAct = lpPktMVEx->m_cUAct;
|
||||
pktMVEx.m_cLAct = lpPktMVEx->m_cLAct;
|
||||
|
||||
char* szPacketData = reinterpret_cast<char*>(&pktMVEx);
|
||||
|
||||
if (PacketWrap::WrapCrypt(szPacketData,
|
||||
sizeof(PktMVEx), CmdCharMove, dwCID))
|
||||
{
|
||||
if (lpCharacter->IsRideArms() && 0 != lpArms)
|
||||
{
|
||||
lpArms->SendToRange(Siege::BROADCAST_RADIUS,
|
||||
szPacketData, sizeof(PktMVEx), CmdCharMove);
|
||||
}
|
||||
else
|
||||
{
|
||||
lpCell->SendNowAllNearCellCharacter(
|
||||
szPacketData, sizeof(PktMVEx), CmdCharMove);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef _PARSE_CHAR_ATTACK_H_
|
||||
#define _PARSE_CHAR_ATTACK_H_
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharAttack(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
bool ParseCharSwitchEQ(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD>ٲٱ<D9B2>
|
||||
bool ParseCharRespawn(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool ParseCharRespawnWaitQueue(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ť <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
bool ParseCharRespawnInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ<EFBFBD><C4A1>)
|
||||
bool ParseCharRespawnAreaInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharDuelCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharPeaceMode(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharSummonCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>ȯ<EFBFBD><C8AF> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// Tcp<63><70> <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20>̵<EFBFBD>.
|
||||
// bool ParseCharMoveUpdate(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ
|
||||
bool ParseCharMoveEx(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // TCP ij<><C4B3><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,118 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Log/ItemLog.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Dispatch/DBAgent/RegularAgentDispatch.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/BGServerPacket.h>
|
||||
|
||||
#include <Creature/CreatureManager.h>
|
||||
#include <Map/FieldMap/VirtualArea/VirtualAreaMgr.h>
|
||||
|
||||
#include "ParseCharBGServer.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>Ʈ <20><>û
|
||||
bool GameClientParsePacket::ParseCharBGServerMapList(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
PktBGServerMapList* lpPktBGServerMapList = reinterpret_cast<PktBGServerMapList *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
VirtualArea::CVirtualAreaMgr::GetInstance().SendBGServerMapList(lpCharacter);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
bool GameClientParsePacket::ParseCharBGServerResultList(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
PktBGServerResultList* lpPktBGServerResultList = reinterpret_cast<PktBGServerResultList *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
VirtualArea::CVirtualAreaMgr::GetInstance().SendBGServerResultList(lpCharacter);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>̵<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharBGServerMoveZone(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
PktBGServerMoveZone* lpPktBGServerMoveZone = reinterpret_cast<PktBGServerMoveZone *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
if (0 == lpPktBGServerMoveZone->m_wMapNumber)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> <20>̵<EFBFBD>
|
||||
VirtualArea::CVirtualAreaMgr::GetInstance().LeaveVirtualArea(lpCharacter);
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20>ش<EFBFBD> <20><>(<28><>) <20><>ȣ<EFBFBD><C8A3> <20>ش<EFBFBD><D8B4>ϴ<EFBFBD> <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
unsigned short wMapIndex = lpPktBGServerMoveZone->m_wMapNumber | VirtualArea::BGSERVERMAP; // <20>̵<EFBFBD><CCB5>Ϸ<EFBFBD><CFB7><EFBFBD> MapIndex
|
||||
unsigned char cMoveType = lpPktBGServerMoveZone->m_cMoveType;
|
||||
|
||||
VirtualArea::CVirtualAreaMgr::GetInstance().EnterVirtualArea(lpCharacter, wMapIndex, cMoveType);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȯ<><C8AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharBGServerMileageChange(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
PktBGServerMileageChange* lpPktBGServerMileageChange = reinterpret_cast<PktBGServerMileageChange *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCID = lpPktBGServerMileageChange->m_dwCID;
|
||||
unsigned char cGroup = lpPktBGServerMileageChange->m_cGroup;
|
||||
unsigned char cCmd = lpPktBGServerMileageChange->m_cCmd;
|
||||
unsigned long dwMileage = lpPktBGServerMileageChange->m_dwMileage;
|
||||
|
||||
switch (cCmd)
|
||||
{
|
||||
case PktBGServerMileageChange::MC_REQUEST:
|
||||
break;
|
||||
|
||||
case PktBGServerMileageChange::MC_CHANGE:
|
||||
RegularAgentPacketParse::SendSetCharData(dwCID, dwMileage, cGroup);
|
||||
break;
|
||||
|
||||
default:
|
||||
ERRLOG2(g_Log, "CID:0x%08x <20>߸<EFBFBD><DFB8><EFBFBD> ȯ<><C8AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>. Cmd:%d", dwCID, cCmd);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>û
|
||||
bool GameClientParsePacket::ParseCharBGServerCharSlot(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
PktBGServerCharSlot* lpPktBGServerCharSlot = reinterpret_cast<PktBGServerCharSlot *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCID = lpPktBGServerCharSlot->m_dwCID;
|
||||
unsigned char cGroup = lpPktBGServerCharSlot->m_cGroup;
|
||||
|
||||
RegularAgentPacketParse::SendGetCharSlot(dwCID, cGroup);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef _PARSE_CHAR_BATTLEGROUND_SERVER_PACKET_H_
|
||||
#define _PARSE_CHAR_BATTLEGROUND_SERVER_PACKET_H_
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CGameClientDispatch;
|
||||
struct PktBase;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharBGServerMapList(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>(<28><>) <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
bool ParseCharBGServerResultList(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>(<28><>) <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
bool ParseCharBGServerMoveZone(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>̵<EFBFBD> (<28><>(<28><>) <20>̵<EFBFBD>)
|
||||
bool ParseCharBGServerMileageChange(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȯ<><C8AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharBGServerCharSlot(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>û
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
#ifndef _PARSE_CHAR_CASTLE_PACKET_H_
|
||||
#define _PARSE_CHAR_CASTLE_PACKET_H_
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CGameClientDispatch;
|
||||
struct PktBase;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3>
|
||||
bool ParseCharCastleCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3>
|
||||
bool ParseCharCampCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3>
|
||||
bool ParseCharSiegeArmsCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3>
|
||||
bool ParseCharCastleRight(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3>
|
||||
bool ParseCharCampRight(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
|
||||
// <20><> <20><>¡<EFBFBD><C2A1><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֱ<EFBFBD>/<2F><><EFBFBD><EFBFBD>
|
||||
bool ParseCharTakeCastleJewel(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֱ<EFBFBD>/<2F><><EFBFBD><EFBFBD>
|
||||
bool ParseCharTakeMaterial(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> On, Off <20><><EFBFBD><EFBFBD>.
|
||||
bool ParseWarOnOff(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,525 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Dispatch/Chat/ChatDispatch.h>
|
||||
|
||||
#include <Network/Packet/ChatPacket.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharCommunityPacket.h>
|
||||
|
||||
#include <Creature/CreatureManager.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
|
||||
#include <Map/FieldMap/Cell.h>
|
||||
|
||||
#include <Utility/Math/Math.h>
|
||||
|
||||
#include "SendCharCommunity.h"
|
||||
#include "ParseCharChat.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
|
||||
bool GameClientParsePacket::ParseCharWhisper(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
int nPacketLength = lpPktBase->GetLen();
|
||||
if (nPacketLength <= sizeof(PktWh))
|
||||
{
|
||||
ERRLOG3(g_Log, "UID:%10u/IP:%15s/<2F>ӼӸ<D3BC> <20><>Ŷ <20><><EFBFBD><EFBFBD> <20>̻<EFBFBD>. <20><><EFBFBD><EFBFBD>:%d",
|
||||
GameClientDispatch.GetUID(), GameClientDispatch.GetRemoteAddr().get_addr_string(), nPacketLength);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20>ӼӸ<D3BC><D3B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ٷ<EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> Relay<61>Ѵ<EFBFBD>.
|
||||
PktWh* lpPktWh = reinterpret_cast<PktWh*>(lpPktBase);
|
||||
char* szMessagePos = reinterpret_cast<char*>(lpPktWh + 1);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>÷ο츦 <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ؼ<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>ڸ<EFBFBD> <20><><EFBFBD>δ<EFBFBD>.
|
||||
szMessagePos[nPacketLength - sizeof(PktWh) - 1] = 0;
|
||||
|
||||
CCharacter* lpSender = GameClientDispatch.GetCharacter();
|
||||
if (NULL != lpSender)
|
||||
{
|
||||
// ä<><C3A4> <20><><EFBFBD><EFBFBD>
|
||||
if (true == lpSender->IsChatBan())
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpSender->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
char* lpBuffer = lpDispatch->GetSendStream().GetBuffer(sizeof(PktWh));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktWh* lpPktWhAck = reinterpret_cast<PktWh*>(lpBuffer);
|
||||
|
||||
strncpy(lpPktWhAck->m_SenderName, lpPktWh->m_SenderName, CHAR_INFOST::MAX_NAME_LEN);
|
||||
strncpy(lpPktWhAck->m_RecverName, lpPktWh->m_RecverName, CHAR_INFOST::MAX_NAME_LEN);
|
||||
|
||||
return lpDispatch->GetSendStream().WrapCrypt(
|
||||
sizeof(PktWh), CmdCharWhisper, 0, PktWh::FAIL_CHAT_BAN);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned long dwOwnerCID = lpSender->GetCID();
|
||||
CCharacter* lpRecver = CCreatureManager::GetInstance().GetCharacter(lpPktWh->m_RecverName);
|
||||
if(lpRecver)
|
||||
{
|
||||
// edith 2009.04.04 <20><><EFBFBD><EFBFBD> Ban<61><6E><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD>ϵǾ<CFB5><C7BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ä<><C3A4> <20>ź<EFBFBD><C5BA>ϰ<EFBFBD> ó<><C3B3>
|
||||
// lpRecver->GetRejectOption().Reject.m_Friend ||
|
||||
if ( lpRecver->GetBanList().IsBan(dwOwnerCID, lpPktWh->m_SenderName ) )
|
||||
{
|
||||
// <20>긮<EFBFBD><EAB8AE>Ʈ<EFBFBD><C6AE> <20><><EFBFBD>ϵǾ<CFB5><C7BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ӹ<EFBFBD><D3B8>ź<EFBFBD>
|
||||
CGameClientDispatch* lpDispatch = lpSender->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
char* lpBuffer = lpDispatch->GetSendStream().GetBuffer(sizeof(PktWh));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktWh* lpPktWhAck = reinterpret_cast<PktWh*>(lpBuffer);
|
||||
|
||||
strncpy(lpPktWhAck->m_SenderName, lpPktWh->m_SenderName, CHAR_INFOST::MAX_NAME_LEN);
|
||||
strncpy(lpPktWhAck->m_RecverName, lpPktWh->m_RecverName, CHAR_INFOST::MAX_NAME_LEN);
|
||||
|
||||
return lpDispatch->GetSendStream().WrapCrypt(
|
||||
sizeof(PktWh), CmdCharWhisper, 0, PktWh::FAIL_REJECT);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// ä<><C3A4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>մϴ<D5B4>.
|
||||
// (ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ǹ<DEB5> <20>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>ϴ°<CFB4> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.)
|
||||
|
||||
GET_SINGLE_DISPATCH(lpChatDispatch, CChatDispatch,
|
||||
CChatDispatch::GetDispatchTable());
|
||||
|
||||
if (0 != lpChatDispatch)
|
||||
{
|
||||
const Position& pos = lpSender->GetCurrentPos();
|
||||
|
||||
CChatRequestPacket chatReqPacket(szMessagePos,
|
||||
PktChat::WHISPER, 0, lpSender->GetUID(), lpSender->GetCID(),
|
||||
static_cast<unsigned short>(pos.m_fPointX),
|
||||
static_cast<unsigned short>(pos.m_fPointY),
|
||||
static_cast<unsigned short>(pos.m_fPointZ),
|
||||
lpPktWh->m_RecverName, 1);
|
||||
|
||||
if (chatReqPacket.IsValid())
|
||||
{
|
||||
return lpChatDispatch->GetSendStream().PutBuffer(
|
||||
chatReqPacket.GetCompressedPacket(),
|
||||
chatReqPacket.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientParsePacket::ParseCharChat(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʿ<EFBFBD> <20><><EFBFBD><EFBFBD> ä<><C3A4> (<28>α<CEB1> <20><><EFBFBD><EFBFBD>)
|
||||
|
||||
// NORMAL = 0, // <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20><>ǥ<EFBFBD><C7A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ǵ<EFBFBD>.
|
||||
// ADMIN_NORMAL_CHAT = 8, // <20><EFBFBD><EEBFB5> <20><><EFBFBD><EFBFBD> ä<><C3A4> (Ack<63>θ<EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
// STALL = 6, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ϱ<EFBFBD> (<28≯<EFBFBD> char[16] * m_cNum - MAX 10<31><30>)
|
||||
// CLIENT_LOG = 5,
|
||||
// FIND_PARTY = 14 // <20><>Ƽ ã<><C3A3>
|
||||
// DICE = 16 // <20>ֻ<EFBFBD><D6BB><EFBFBD>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD> ä<><C3A4>
|
||||
|
||||
// PARTY = 1, // <20><>Ƽ <20><><EFBFBD>ϱ<EFBFBD>
|
||||
// FRIEND = 2, // ģ<><C4A3> <20><><EFBFBD>ϱ<EFBFBD> (<28≯<EFBFBD> char[16] * m_cNum - MAX 100<30><30>)
|
||||
// GUILD = 3, // <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ϱ<EFBFBD>
|
||||
// SHOUT = 7, // <20><>ü <20><><EFBFBD>ϱ<EFBFBD>
|
||||
|
||||
// ADMIN_SHOUT = 9, // <20><EFBFBD><EEBFB5> <20><>ġ<EFBFBD><C4A1> (Ack<63>θ<EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
// WHISPER = 10, // <20><> <20><>ȣ<EFBFBD><C8A3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.Whisper<65><72> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̴<EFBFBD>. <20><>, <20>αÿ<D7BD> <20><><EFBFBD>δ<EFBFBD>.
|
||||
|
||||
int nPacketLength = lpPktBase->GetLen();
|
||||
if (nPacketLength <= sizeof(PktChat))
|
||||
{
|
||||
ERRLOG3(g_Log, "UID:%10u/IP:%15s <20><>Ŷ <20><><EFBFBD>̰<EFBFBD> <20>̻<EFBFBD><CCBB>մϴ<D5B4>. <20><><EFBFBD><EFBFBD>:%d",
|
||||
GameClientDispatch.GetUID(), GameClientDispatch.GetRemoteAddr().get_addr_string(), nPacketLength);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
PktChat* lpPktChat = reinterpret_cast<PktChat*>(lpPktBase);
|
||||
|
||||
int nMinPacketSize = sizeof(PktChat) + sizeof(char) * CHAR_INFOST::MAX_NAME_LEN * lpPktChat->m_cNum;
|
||||
int nMaxPacketSize = nMinPacketSize + PktChat::PktChatMaxSize;
|
||||
|
||||
if (nPacketLength < nMinPacketSize || nMaxPacketSize < nPacketLength)
|
||||
{
|
||||
ERRLOG3(g_Log, "UID:%10u/IP:%15s <20><>Ŷ <20><><EFBFBD>̰<EFBFBD> <20>̻<EFBFBD><CCBB>մϴ<D5B4>. <20><><EFBFBD><EFBFBD>:%d",
|
||||
GameClientDispatch.GetUID(), GameClientDispatch.GetRemoteAddr().get_addr_string(), nPacketLength);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
char* szNames = reinterpret_cast<char*>(lpPktChat + 1);
|
||||
char* szMessage = szNames + sizeof(char) * CHAR_INFOST::MAX_NAME_LEN * lpPktChat->m_cNum;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>÷ο츦 <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ؼ<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>ڸ<EFBFBD> <20><><EFBFBD>δ<EFBFBD>.
|
||||
szMessage[nPacketLength - nMinPacketSize - 1] = 0;
|
||||
|
||||
CCharacter* lpSender = GameClientDispatch.GetCharacter();
|
||||
|
||||
if (NULL == lpSender)
|
||||
return true;
|
||||
|
||||
// ä<><C3A4> <20><><EFBFBD><EFBFBD>
|
||||
if (lpSender->IsChatBan())
|
||||
{
|
||||
if (lpPktChat->m_cCmd != PktChat::CLIENT_LOG)
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpSender->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
CChatPacket ErrorResult(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd), 0, 0, PktChat::CHAT_BAN);
|
||||
|
||||
if (ErrorResult.IsValid())
|
||||
{
|
||||
lpDispatch->GetSendStream().PutBuffer(
|
||||
ErrorResult.GetCompressedPacket(),
|
||||
ErrorResult.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
switch (lpPktChat->m_cCmd)
|
||||
{
|
||||
case PktChat::DICE: // <20>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
{
|
||||
// <20>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20><><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>Ȯ<EFBFBD><C8AE><EFBFBD>Ѵ<EFBFBD>.
|
||||
CHAR seps[] = " ,\t\n" ;
|
||||
CHAR *token, strCommand[ MAX_PATH ] ;
|
||||
|
||||
strcpy( strCommand, szMessage ) ;
|
||||
|
||||
token = strtok( strCommand, seps ) ;
|
||||
ULONG len = strlen( token ) + 1 ;
|
||||
|
||||
int iTotal = Math::Convert::Atoi( &strCommand[ len ] );
|
||||
int iDice = Math::Random::ComplexRandom(iTotal)+1;
|
||||
|
||||
sprintf(szMessage, "%s %d %d", token, iTotal, iDice);
|
||||
|
||||
// <20><>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
if( lpSender->GetPID() != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
const unsigned long MAX_SQUARED_DISTANCE = 32 * 32;
|
||||
CCell* lpSenderCell = lpSender->GetCellPos().m_lpCell;
|
||||
|
||||
if (0 != lpSenderCell)
|
||||
{
|
||||
CChatPacket chatPacket(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd), lpPktChat->m_usLang);
|
||||
|
||||
if (chatPacket.IsValid())
|
||||
{
|
||||
for(int nCount = 0; nCount < CCell::CONNECT_NUM; ++nCount)
|
||||
{
|
||||
CCell* lpSendCell = lpSenderCell->GetConnectCell(nCount);
|
||||
|
||||
if (0 != lpSendCell)
|
||||
{
|
||||
CCharacter* lpReceiver = lpSendCell->GetFirstCharacter();
|
||||
|
||||
while (0 != lpReceiver)
|
||||
{
|
||||
// <20><><EFBFBD>ڽŵ<DABD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ϴ°<CFB4> Ʋ<><C6B2><EFBFBD><EFBFBD>.
|
||||
if (lpSender->GetCurrentPos().GetSquaredDistance(
|
||||
lpReceiver->GetCurrentPos()) < MAX_SQUARED_DISTANCE)
|
||||
{
|
||||
if (0 != lpSender->GetAdminLevel() ||
|
||||
lpSender->GetNation() == lpReceiver->GetNation())
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpReceiver->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
|
||||
lpDispatch->GetSendStream().PutBuffer(
|
||||
chatPacket.GetCompressedPacket(),
|
||||
chatPacket.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lpReceiver = lpSendCell->GetNextCharacter();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
lpPktChat->m_cNum = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
// <20><> <20><><EFBFBD>쿡<EFBFBD><ECBFA1>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>Ѵ<EFBFBD>.
|
||||
case PktChat::NORMAL:
|
||||
case PktChat::ADMIN_NORMAL_CHAT:
|
||||
{
|
||||
const unsigned long MAX_SQUARED_DISTANCE = 32 * 32;
|
||||
|
||||
CCell* lpSenderCell = lpSender->GetCellPos().m_lpCell;
|
||||
|
||||
if (0 != lpSenderCell)
|
||||
{
|
||||
CChatPacket chatPacket(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd), lpPktChat->m_usLang);
|
||||
|
||||
if (chatPacket.IsValid())
|
||||
{
|
||||
for(int nCount = 0; nCount < CCell::CONNECT_NUM; ++nCount)
|
||||
{
|
||||
CCell* lpSendCell = lpSenderCell->GetConnectCell(nCount);
|
||||
|
||||
if (0 != lpSendCell)
|
||||
{
|
||||
CCharacter* lpReceiver = lpSendCell->GetFirstCharacter();
|
||||
|
||||
while (0 != lpReceiver)
|
||||
{
|
||||
if (lpSender != lpReceiver &&
|
||||
lpSender->GetCurrentPos().GetSquaredDistance(
|
||||
lpReceiver->GetCurrentPos()) < MAX_SQUARED_DISTANCE)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD>, <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<><30> <20>ƴϰų<CFB0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȭ <20><><EFBFBD><EFBFBD>
|
||||
if (0 != lpSender->GetAdminLevel() || 0 != lpReceiver->GetAdminLevel() ||
|
||||
lpSender->GetNation() == lpReceiver->GetNation())
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpReceiver->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
|
||||
lpDispatch->GetSendStream().PutBuffer(
|
||||
chatPacket.GetCompressedPacket(),
|
||||
chatPacket.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lpReceiver = lpSendCell->GetNextCharacter();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
lpPktChat->m_cNum = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
// <20><> <20><><EFBFBD>쿡<EFBFBD><ECBFA1>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>Ѵ<EFBFBD>.
|
||||
case PktChat::STALL:
|
||||
case PktChat::CAMP_SHOP:
|
||||
{
|
||||
CChatPacket chatPacket(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd), lpPktChat->m_usLang);
|
||||
|
||||
if (chatPacket.IsValid())
|
||||
{
|
||||
for(; szNames < szMessage; szNames += sizeof(char) * CHAR_INFOST::MAX_NAME_LEN)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>÷ο<C3B7> <20><><EFBFBD><EFBFBD>
|
||||
szNames[CHAR_INFOST::MAX_NAME_LEN - 1] = 0;
|
||||
|
||||
CCharacter* lpReceiver =
|
||||
CCreatureManager::GetInstance().GetCharacter(szNames);
|
||||
|
||||
if (0 != lpReceiver && lpSender->GetNation() == lpReceiver->GetNation())
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpReceiver->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
lpDispatch->GetSendStream().PutBuffer(
|
||||
chatPacket.GetCompressedPacket(),
|
||||
chatPacket.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
lpPktChat->m_cNum = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
// <20><> <20><><EFBFBD>쿡<EFBFBD><ECBFA1>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>Ѵ<EFBFBD>.
|
||||
case PktChat::FIND_PARTY:
|
||||
{
|
||||
CChatPacket chatPacket(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd), lpPktChat->m_usLang);
|
||||
|
||||
if (chatPacket.IsValid())
|
||||
{
|
||||
CCreatureManager::GetInstance().SendFindPartyMsg(
|
||||
lpSender->GetCID(), chatPacket.GetCompressedPacket(), chatPacket.GetCompressedSize());
|
||||
}
|
||||
|
||||
// <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
lpPktChat->m_cNum = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
// <20>α<CEB1> <20><><EFBFBD>´<EFBFBD>.
|
||||
case PktChat::CLIENT_LOG:
|
||||
{
|
||||
RULLOG3(g_Log, "UID:%10u/CID:%10u/Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ <20>α<EFBFBD> : %s",
|
||||
lpSender->GetUID(), lpSender->GetCID(), szMessage);
|
||||
|
||||
// <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
lpPktChat->m_cNum = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD>쿣 ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ָ<EFBFBD> <20>ȴ<EFBFBD>.
|
||||
case PktChat::PARTY:
|
||||
case PktChat::FRIEND:
|
||||
case PktChat::GUILD:
|
||||
case PktChat::ADMIN_SHOUT:
|
||||
break;
|
||||
|
||||
case PktChat::GMREPORT:
|
||||
break;
|
||||
|
||||
case PktChat::TRADE:
|
||||
case PktChat::SHOUT:
|
||||
// edith 2008.05.27 <20><>ġ<EFBFBD><C4A1>, Trade <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (0 == lpSender->GetAdminLevel() && !lpSender->CanShout())
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpSender->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
CChatPacket ErrorResult(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd), 0, 0, PktChat::SHOUT_TIMEOUT);
|
||||
|
||||
if (ErrorResult.IsValid())
|
||||
{
|
||||
lpDispatch->GetSendStream().PutBuffer(
|
||||
ErrorResult.GetCompressedPacket(),
|
||||
ErrorResult.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
{
|
||||
// edith 2008.05.27 <20><>ġ<EFBFBD><C4A1>, Trade <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (0 == lpSender->GetAdminLevel() && !lpSender->CanShout())
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpSender->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
CChatPacket ErrorResult(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd), 0, PktChat::SHOUT_TIMEOUT);
|
||||
|
||||
if (ErrorResult.IsValid())
|
||||
{
|
||||
lpDispatch->GetSendStream().PutBuffer(
|
||||
ErrorResult.GetCompressedPacket(),
|
||||
ErrorResult.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CCell* lpSenderCell = lpSender->GetCellPos().m_lpCell;
|
||||
|
||||
if (0 != lpSenderCell)
|
||||
{
|
||||
CChatPacket chatPacket(szMessage, lpSender->GetCID(),
|
||||
static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd));
|
||||
|
||||
if (chatPacket.IsValid())
|
||||
{
|
||||
for(int nCount = 0; nCount < CCell::CONNECT_NUM; ++nCount)
|
||||
{
|
||||
CCell* lpSendCell = lpSenderCell->GetConnectCell(nCount);
|
||||
|
||||
if (0 != lpSendCell)
|
||||
{
|
||||
CCharacter* lpReceiver = lpSendCell->GetFirstCharacter();
|
||||
|
||||
while (0 != lpReceiver)
|
||||
{
|
||||
if (0 != lpSender->GetAdminLevel() ||
|
||||
lpSender->GetNation() == lpReceiver->GetNation())
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = lpReceiver->GetDispatcher();
|
||||
if (NULL != lpDispatch)
|
||||
{
|
||||
lpDispatch->GetSendStream().PutBuffer(
|
||||
chatPacket.GetCompressedPacket(),
|
||||
chatPacket.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
|
||||
lpReceiver = lpSendCell->GetNextCharacter();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
lpPktChat->m_cNum = 0;
|
||||
|
||||
lpSender->Shouted();
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
// <20>ϴ<EFBFBD> ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD>δ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
GET_SINGLE_DISPATCH(lpChatDispatch, CChatDispatch, CChatDispatch::GetDispatchTable());
|
||||
|
||||
if (0 != lpChatDispatch)
|
||||
{
|
||||
const Position& pos = lpSender->GetCurrentPos();
|
||||
|
||||
CChatRequestPacket chatReqPacket(szMessage, static_cast<PktChat::PktChatCmd>(lpPktChat->m_cCmd),
|
||||
lpPktChat->m_usLang, lpSender->GetUID(), lpSender->GetCID(),
|
||||
static_cast<unsigned short>(pos.m_fPointX),
|
||||
static_cast<unsigned short>(pos.m_fPointY),
|
||||
static_cast<unsigned short>(pos.m_fPointZ),
|
||||
szNames, lpPktChat->m_cNum);
|
||||
|
||||
// ä<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
if (chatReqPacket.IsValid())
|
||||
{
|
||||
lpChatDispatch->GetSendStream().PutBuffer(
|
||||
chatReqPacket.GetCompressedPacket(),
|
||||
chatReqPacket.GetCompressedSize(), CmdCharChat);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef _PARSE_CHAR_CHAT_PACKET_H_
|
||||
#define _PARSE_CHAR_CHAT_PACKET_H_
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CGameClientDispatch;
|
||||
struct PktBase;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharWhisper(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20>ӻ<EFBFBD><D3BB><EFBFBD>
|
||||
bool ParseCharChat(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ijƽ<C4B3><C6BD> ä<><C3A4>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
#ifndef _PARSE_CHAR_COMMUNITY_PACKET_H_
|
||||
#define _PARSE_CHAR_COMMUNITY_PACKET_H_
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CGameClientDispatch;
|
||||
struct PktBase;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> Ŀ<>´<EFBFBD>Ƽ <20><><EFBFBD><EFBFBD> <20><>Ŷ - ParseCharCommunity.cpp -------------------------------------------
|
||||
|
||||
bool ParseCharExchangeCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>ȯ <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharPartyCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ƽ <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharPartyFind(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ƽ ã<><C3A3>
|
||||
|
||||
bool ParseCharStallOpen(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharStallRegisterItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharStallEnter(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
bool ParseCharFriendAdd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ģ<><C4A3>(<28>ź<EFBFBD>)<29><><EFBFBD><EFBFBD>Ʈ <20>߰<EFBFBD>
|
||||
bool ParseCharFriendRemove(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ģ<><C4A3>(<28>ź<EFBFBD>)<29><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharFriendEtc(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>Ÿ ó<><C3B3>(<28><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>)
|
||||
|
||||
bool ParseCharCreateGuild(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharGuildCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharGuildMark(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><>ũ <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharGuildLevel(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharGuildRelation(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharGuildInclination(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharGuildList(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
bool ParseCharGuildRight(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharGuildMemberList(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||||
bool ParseCharGuildSafe(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20>ݰ<EFBFBD>
|
||||
bool ParseCharGuildHostilityList(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ȳ <20><><EFBFBD><EFBFBD>Ʈ
|
||||
bool ParseCharGuildRelationInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><>û
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,291 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Creature/CreatureManager.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/Character/ExpTable.h>
|
||||
#include <Creature/Character/CharRespawnMgr.h>
|
||||
|
||||
#include <Map/FieldMap/VirtualArea/VirtualArea.h>
|
||||
#include <Map/FieldMap/VirtualArea/VirtualAreaMgr.h>
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Dispatch/Chat/ChatDispatch.h>
|
||||
|
||||
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
||||
#include <Network/Packet/PacketStruct/CharStatusPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacketStruct.h>
|
||||
#include <Network/Packet/PacketStruct/CharCommunityPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharConfigPacket.h>
|
||||
#include <Network/Packet/PacketStruct/RankingPacket.h>
|
||||
|
||||
#include <Network/Dispatch/GameClient/SendCharAttack.h>
|
||||
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <Ranking/RankingMgr.h>
|
||||
|
||||
#include "GameClientDispatch.h"
|
||||
#include "SendCharEtc.h"
|
||||
#include "ParseCharEtc.h"
|
||||
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20>ڻ<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharSuicide(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSC), GameClientDispatch);
|
||||
|
||||
PktSC* lpPktSC = static_cast<PktSC*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktSC->m_dwCharID;
|
||||
Position Pos = Position::Position();
|
||||
|
||||
lpCharacter->Dead(NULL);
|
||||
if (0 != lpCharacter->GetMapIndex())
|
||||
{
|
||||
VirtualArea::CVirtualArea* lpVirtualArea = VirtualArea::CVirtualAreaMgr::GetInstance().GetVirtualArea( lpCharacter->GetMapIndex() );
|
||||
if (NULL != lpVirtualArea)
|
||||
{
|
||||
Pos = lpVirtualArea->GetRespawnPosition(lpCharacter->GetRace(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
lpCharacter->Respawn(CCharRespawnMgr::RST_TOWN, Pos);
|
||||
lpCharacter->SaveToDBData();
|
||||
|
||||
if (0 != lpCharacter->GetPID())
|
||||
{
|
||||
// <20><>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˸<EFBFBD><CBB8><EFBFBD>.
|
||||
GameClientSendPacket::SendCharDeadToParty(lpCharacter, 0, PktDeadInfo::RESPAWN);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharBindPosition(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktBP), GameClientDispatch);
|
||||
|
||||
PktBP* lpPktBP = static_cast<PktBP*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwNPCID = lpPktBP->m_dwNPCID;
|
||||
unsigned char cCmd = lpPktBP->m_cCmd;
|
||||
POS &Pos = lpPktBP->m_Pos;
|
||||
char cZone = lpPktBP->m_cZone;
|
||||
|
||||
Position DestPos = Pos;
|
||||
|
||||
switch (cCmd)
|
||||
{
|
||||
case PktBP::BP_SAVE_POSITION: // <20><> <20><>ġ <20><><EFBFBD><EFBFBD>
|
||||
lpCharacter->BindPositionToNPC(dwNPCID);
|
||||
break;
|
||||
|
||||
case PktBP::BP_WARP: // <20><><EFBFBD><EFBFBD>
|
||||
DETLOG5(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>. NewPos : %.1f, %.1f, %.1f, Zone : %d",
|
||||
lpCharacter->GetCID(), Pos.fPointX, Pos.fPointY, Pos.fPointZ, cZone);
|
||||
lpCharacter->MoveTo(DestPos, false);
|
||||
break;
|
||||
}
|
||||
|
||||
return GameClientSendPacket::SendCharBindPosition(*lpCharacter,
|
||||
dwNPCID, cCmd, Pos, cZone, 0);
|
||||
}
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharQuickSlotMove(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktQSM), GameClientDispatch);
|
||||
|
||||
PktQSM* lpPktQSM = static_cast<PktQSM*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
TakeType takeType = lpPktQSM->m_TakeType;
|
||||
unsigned short usSkillID = lpPktQSM->m_usSkillID;
|
||||
unsigned char cLockCount = lpPktQSM->m_cLockCount;
|
||||
unsigned char cSkillLevel = lpPktQSM->m_cSkillLevel;
|
||||
|
||||
unsigned short usError = 0;
|
||||
|
||||
if (false == lpCharacter->MoveQuickSlot(takeType, usSkillID, cLockCount, cSkillLevel))
|
||||
{
|
||||
usError = PktQSM::FAIL_MOVE;
|
||||
}
|
||||
|
||||
return GameClientSendPacket::SendCharQuickSlotMove(
|
||||
GameClientDispatch.GetSendStream(), takeType, usSkillID, usError);
|
||||
}
|
||||
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharControlOption(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktCOp), GameClientDispatch);
|
||||
|
||||
PktCOp* lpPktCOp = static_cast<PktCOp*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktCOp->m_dwCharID;
|
||||
RejectOption Reject = lpPktCOp->m_RejectOption;
|
||||
|
||||
unsigned short usError = 0;
|
||||
|
||||
// <20>ź<EFBFBD> <20>ɼ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (false == lpCharacter->ControlOption(Reject, false))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD><EFBFBD> <20>ź<EFBFBD> <20>ɼ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.", dwCharID);
|
||||
return false;
|
||||
}
|
||||
|
||||
return GameClientSendPacket::SendCharControlOption(GameClientDispatch.GetSendStream(), dwCharID, Reject);
|
||||
}
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>dzڿ<C7B3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharAuthorizePanel(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktAP), GameClientDispatch);
|
||||
|
||||
PktAP* lpPktAP = static_cast<PktAP *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwAffectedID = lpPktAP->m_dwAffectedID;
|
||||
unsigned long dwCasterID = lpPktAP->m_dwCasterID;
|
||||
unsigned char cCmd = lpPktAP->m_cCmd;
|
||||
|
||||
switch (cCmd)
|
||||
{
|
||||
case PktAP::AP_RESURRECTION:
|
||||
{
|
||||
if (0 == lpCharacter->GetStatus().m_nNowHP)
|
||||
{
|
||||
if (SERVER_ID::ZONE3 == CServerSetup::GetInstance().GetServerZone())
|
||||
{
|
||||
CCreatureManager::GetInstance().PopRespawnQueue(lpCharacter);
|
||||
}
|
||||
|
||||
if (false == lpCharacter->Respawn(CCharRespawnMgr::RST_RESURRECTION, lpCharacter->GetCurrentPos()))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>.", dwAffectedID);
|
||||
}
|
||||
|
||||
if (0 != lpCharacter->GetPID())
|
||||
{
|
||||
// <20><>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˸<EFBFBD><CBB8><EFBFBD>.
|
||||
GameClientSendPacket::SendCharDeadToParty(lpCharacter,
|
||||
CCreatureManager::GetInstance().GetCharacter(dwCasterID), PktDeadInfo::RESURRECT);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case PktAP::AP_RECALL:
|
||||
{
|
||||
CCharacter* lpCaster = CCreatureManager::GetInstance().GetCharacter(dwCasterID);
|
||||
if (NULL == lpCaster)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD>ݿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCasterID);
|
||||
break;
|
||||
}
|
||||
|
||||
const Position& Pos = lpCaster->GetCastingPos();
|
||||
lpCharacter->MoveTo(Pos, false);
|
||||
|
||||
// edith 2009.03.07 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
POS DestPos;
|
||||
DestPos.fPointX = Pos.m_fPointX;
|
||||
DestPos.fPointY = Pos.m_fPointY+0.3f;
|
||||
DestPos.fPointZ = Pos.m_fPointZ;
|
||||
|
||||
return GameClientSendPacket::SendCharBindPosition(*lpCharacter,
|
||||
dwCasterID, PktBP::BP_RECALL, DestPos, CServerSetup::GetInstance().GetServerZone(), 0);
|
||||
|
||||
} break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>(<28><><EFBFBD>嵵) <20><><EFBFBD><EFBFBD> <20><>û
|
||||
bool GameClientParsePacket::ParseCharFameInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktFI), GameClientDispatch);
|
||||
|
||||
PktFI* lpPktFI = static_cast<PktFI *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktFI->m_dwCharID;
|
||||
|
||||
return GameClientSendPacket::SendCharFameInfo(GameClientDispatch.GetSendStream(),
|
||||
lpCharacter, "", "", 0, 0, PktFIAck::FAME_INFO, PktBase::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
|
||||
// <20><>ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharRankingInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktRankingInfo), GameClientDispatch);
|
||||
|
||||
PktRankingInfo* lpRankingInfo = static_cast<PktRankingInfo *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpRankingInfo->m_dwCharID;
|
||||
unsigned char cClass = lpRankingInfo->m_cClass;
|
||||
unsigned char cPage = lpRankingInfo->m_cPage;
|
||||
|
||||
return CRankingMgr::GetInstance().SendRankingInfo(dwCharID, cClass, cPage);
|
||||
}
|
||||
|
||||
bool GameClientParsePacket::ParseCastObjectInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktCOInfo), GameClientDispatch);
|
||||
|
||||
PktCOInfo* lpPktCOInfo = static_cast<PktCOInfo*>(lpPktBase);
|
||||
CCharacter*lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
if(lpCharacter->GetCID() == lpPktCOInfo->m_dwSenderID)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID<49><44> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>쿡<EFBFBD><ECBFA1> <20><><EFBFBD><EFBFBD>.
|
||||
CCell* lpCell = lpCharacter->GetCellPos().m_lpCell;
|
||||
|
||||
if(0 != lpCell)
|
||||
{
|
||||
lpCell->SendCastObjectInfo(lpPktCOInfo->m_dwSenderID,
|
||||
lpPktCOInfo->m_dwReceiverID, lpPktCOInfo->m_sCastObject);
|
||||
}
|
||||
}
|
||||
else if (lpCharacter->IsRideArms() && lpCharacter->GetRideArmsCID() == lpPktCOInfo->m_dwSenderID)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID<49><44> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>쿡<EFBFBD><ECBFA1> <20><><EFBFBD><EFBFBD>.
|
||||
CCell* lpCell = lpCharacter->GetCellPos().m_lpCell;
|
||||
|
||||
if(0 != lpCell)
|
||||
{
|
||||
lpCell->SendCastObjectInfo(lpPktCOInfo->m_dwSenderID,
|
||||
lpPktCOInfo->m_dwReceiverID, lpPktCOInfo->m_sCastObject);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef _PARSE_CHAR_ETC_H_
|
||||
#define _PARSE_CHAR_ETC_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharSuicide(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20>ڻ<EFBFBD>
|
||||
bool ParseCharBindPosition(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bool ParseCharQuickSlotMove(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
bool ParseCharControlOption(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharAuthorizePanel(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20>dzڿ<C7B3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
bool ParseCharFameInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>(<28><><EFBFBD>嵵) <20><><EFBFBD><EFBFBD> <20><>û
|
||||
bool ParseCharRankingInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>ŷ <20><><EFBFBD><EFBFBD>
|
||||
|
||||
bool ParseCastObjectInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
#ifndef _PARSE_CHAR_ITEM_H_
|
||||
#define _PARSE_CHAR_ITEM_H_
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
struct PktTr;
|
||||
|
||||
namespace Item
|
||||
{
|
||||
struct ItemPos;
|
||||
class CItem;
|
||||
};
|
||||
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharTakeItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̵<EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharSwapItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharRepairItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharRepairAllItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
bool ParseCharUseItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharUseCashItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
bool ParseCharTradeItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ŷ<EFBFBD>
|
||||
bool ParseCharEquipShopInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // NPC <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
bool ParseCharPickUp(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharPullDown(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool ParseCharSplitItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
bool ParseCharTakeGold(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><> <20>ٷ<EFBFBD><D9B7><EFBFBD>
|
||||
bool ParseCharDepositCmd(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // â<><C3A2> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6>
|
||||
bool ParseCharAutoRouting(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ParseCharLevelUp.h"
|
||||
#include "SendCharLevelUp.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Packet/PacketStruct/CharStatusPacket.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
|
||||
|
||||
// Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharClassUpgrade(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktCU), GameClientDispatch);
|
||||
|
||||
PktCU* lpPktCU = static_cast<PktCU *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktCU->m_dwCharID;
|
||||
unsigned char cClass = lpPktCU->m_cClass;
|
||||
|
||||
return lpCharacter->ChangeClass(cClass);
|
||||
}
|
||||
|
||||
|
||||
// IP <20><><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
bool GameClientParsePacket::ParseCharIncreasePoint(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktIP), GameClientDispatch);
|
||||
|
||||
PktIP* lpPktIP = static_cast<PktIP *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktIP->m_dwCharID;
|
||||
unsigned char cStateType = lpPktIP->m_cStateType;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
ChState State = {0,};
|
||||
unsigned short usError = lpCharacter->AddState(cStateType, State);
|
||||
|
||||
return GameClientSendPacket::SendCharIncreasePoint(GameClientDispatch.GetSendStream(), dwCharID, State, usError);
|
||||
}
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD>й<EFBFBD> (Ŭ<><C5AC><EFBFBD><EFBFBD> ó<><C3B3> <20><><EFBFBD>·<EFBFBD>)
|
||||
bool GameClientParsePacket::ParseCharStateRedistribution(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSR), GameClientDispatch);
|
||||
|
||||
PktSR* lpPktSR = static_cast<PktSR *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
ChState State = lpPktSR->m_State;
|
||||
|
||||
return lpCharacter->StateRedistribution(State);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD> <20><><EFBFBD>Ʒ<EFBFBD> (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٽ<EFBFBD> <20>й<EFBFBD>)
|
||||
bool GameClientParsePacket::ParseCharStatusRetrain(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSRT), GameClientDispatch);
|
||||
|
||||
PktSRT* lpPktSRT = static_cast<PktSRT *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
ChState State = lpPktSRT->m_State;
|
||||
Item::ItemPos InvenPos = lpPktSRT->m_ItemPos;
|
||||
|
||||
return lpCharacter->StatusRetrain(State, InvenPos);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef _PARSE_CHAR_LEVELUP_H_
|
||||
#define _PARSE_CHAR_LEVELUP_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharClassUpgrade(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
bool ParseCharIncreasePoint(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // IP <20><><EFBFBD><EFBFBD> <20><>Ŷ
|
||||
bool ParseCharStateRedistribution(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD>й<EFBFBD>(Ŭ<><C5AC><EFBFBD><EFBFBD> ó<><C3B3> <20><><EFBFBD>·<EFBFBD>)
|
||||
|
||||
bool ParseCharStatusRetrain(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD> <20><><EFBFBD>Ʒ<EFBFBD>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,259 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Creature/CreatureManager.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
|
||||
#include <Network/Session/Session.h>
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Dispatch/DBAgent/DBAgentRequest.h>
|
||||
#include <Network/Dispatch/DBAgent/DBAgentDispatch.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharLoginOutPacket.h>
|
||||
|
||||
#include <Network/Packet/PacketStruct/GuildPacket.h>
|
||||
|
||||
#include <GameTime/GameTimeConstants.h>
|
||||
#include <GameTime/GameTimeMgr.h>
|
||||
|
||||
#include "ParseCharLoginOut.h"
|
||||
#include "GameClientDispatch.h"
|
||||
#include "SendCharLoginOut.h"
|
||||
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
|
||||
bool GameClientParsePacket::ParseCharLogin(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktCLi), GameClientDispatch);
|
||||
|
||||
PktCLi* lpPktCLi = static_cast<PktCLi *>(lpPktBase);
|
||||
unsigned long dwSID = lpPktCLi->m_dwSessionID;
|
||||
unsigned long dwUID = lpPktCLi->m_dwUserID;
|
||||
unsigned long dwCID = lpPktCLi->m_dwCharID;
|
||||
|
||||
GameClientDispatch.SetUID(dwUID);
|
||||
|
||||
// ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20>Ŵ<EFBFBD><C5B4><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD><D6B4><EFBFBD> Ȯ<><C8AE>
|
||||
CCharacter* lpCharacter = CCreatureManager::GetInstance().GetCharacter(dwCID);
|
||||
if (NULL != lpCharacter)
|
||||
{
|
||||
// ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20>ڵ带 <20>ѱ<EFBFBD><D1B1>ϴ<EFBFBD>.
|
||||
lpCharacter = NULL;
|
||||
|
||||
LOG_INOUT(DETLOG3(g_Log, "UID:%d / CID:0x%08x / SID:0x%08x ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.",
|
||||
dwUID, dwCID, dwSID));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_INOUT(DETLOG3(g_Log, "UID:%d / CID:0x%08x / SID:0x%08x <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>մϴ<D5B4>. DBAgent<6E><74> <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.",
|
||||
dwUID, dwCID, dwSID));
|
||||
|
||||
CDBRequest DBRequest(GameClientDispatch, 600);
|
||||
|
||||
if (DBRequest.IsValid())
|
||||
{
|
||||
if (GameClientSendPacket::SendLoginToDBAgent(DBRequest.GetSendStream(),
|
||||
DBRequest.GetRequestKey(), dwSID, dwUID, dwCID,
|
||||
GameClientDispatch.GetRemoteAddr().get_addr_in().sin_addr))
|
||||
{
|
||||
GameClientDispatch.PushRequestKey(DBRequest.GetRequestKey());
|
||||
|
||||
LOG_INOUT(DETLOG5(g_Log, "UID:%d / CID:0x%08x / SID:0x%08x / RequestKey:%d / DispatchPointer:0x%p <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>մϴ<D5B4>."
|
||||
"DBAgent<EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.",
|
||||
dwUID, dwCID, dwSID, DBRequest.GetRequestKey(), &GameClientDispatch));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DBRequest.CancelRequest();
|
||||
}
|
||||
}
|
||||
|
||||
return GameClientSendPacket::SendCharLogin(GameClientDispatch.GetSendStream(), lpCharacter,
|
||||
&GameClientDispatch.GetRemoteAddr().get_addr_in(), PktBase::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientParsePacket::ParseCharMoveZone(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSZMv), GameClientDispatch);
|
||||
|
||||
PktSZMv* lpPktSZMv = static_cast<PktSZMv *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
// Admin ij<><C4B3><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD> <20><><EFBFBD><EFBFBD>ó<EFBFBD><C3B3> (QA <20><> <20><>û).
|
||||
if(lpCharacter->GetAdminLevel())
|
||||
{
|
||||
goto lb_move;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ͼ<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ͼ<EFBFBD> üũ
|
||||
if (CGameTimeMgr::GetInstance().IsGuildWarTime() &&
|
||||
(lpCharacter->GetGuildWarFlag() == Creature::WAR_ON || lpCharacter->GetGuildWarFlag() == Creature::WAR_INSTANCE))
|
||||
{
|
||||
return GameClientSendPacket::SendCharMoveZone(
|
||||
GameClientDispatch.GetSendStream(), NULL, 0, 0, 1);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <20><>ũ ī<><C4AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (true == CServerSetup::GetInstance().UseContents(GameRYL::STONE_BATTLE))
|
||||
{
|
||||
if ((CGameTimeMgr::GetInstance().IsRealmWarReadyTime() || CGameTimeMgr::GetInstance().IsRealmWarTime()) &&
|
||||
(lpCharacter->GetRealmWarFlag() == Creature::WAR_ON || lpCharacter->GetRealmWarFlag() == Creature::WAR_INSTANCE))
|
||||
{
|
||||
return GameClientSendPacket::SendCharMoveZone(
|
||||
GameClientDispatch.GetSendStream(), NULL, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
lb_move:
|
||||
|
||||
if (lpCharacter->MoveZone(lpPktSZMv->m_NewPos, lpPktSZMv->m_cZone, lpPktSZMv->m_cChannel)) // ä<><C3A4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> -1
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ERRLOG0(g_Log, "MoveZone<EFBFBD><EFBFBD>Ŷ<EFBFBD><EFBFBD> DBAgent<6E><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.");
|
||||
|
||||
return GameClientSendPacket::SendCharMoveZone(
|
||||
GameClientDispatch.GetSendStream(), NULL, 0, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientParsePacket::ParseCharLogout(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktCLo), GameClientDispatch);
|
||||
|
||||
PktCLo* lpPktCLo = static_cast<PktCLo *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCID = lpPktCLo->m_dwCharID;
|
||||
|
||||
if (dwCID == lpCharacter->GetCID())
|
||||
{
|
||||
lpCharacter->SetDispatcher(NULL);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientParsePacket::ParseServerZone(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSZ), GameClientDispatch);
|
||||
|
||||
PktSZ* lpPktSZ = reinterpret_cast<PktSZ *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
if (lpCharacter->IsOperationFlagSet(CCharacter::SERVERZONE_PROCESSED))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CDBRequest DBRequest(GameClientDispatch, 600);
|
||||
|
||||
if (DBRequest.IsValid())
|
||||
{
|
||||
if (GameClientSendPacket::SendServerZoneToDBAgent(DBRequest.GetSendStream(),
|
||||
DBRequest.GetRequestKey(), GameClientDispatch.GetUID(),
|
||||
lpPktSZ->m_cZone, static_cast<unsigned char>(lpPktSZ->m_cChannel)))
|
||||
{
|
||||
DETLOG5(g_Log, "UID:%d/CID:0x%08x(0x%p)/RequestKey:%d/DispatchPointer:0x%p ServerZone<6E><65>Ŷ<EFBFBD><C5B6> <20><><EFBFBD>½<EFBFBD><C2BD>ϴ<EFBFBD>.",
|
||||
lpCharacter->GetUID(), lpCharacter->GetCID(), lpCharacter,
|
||||
DBRequest.GetRequestKey(), &GameClientDispatch);
|
||||
|
||||
lpCharacter->SetOperationFlag(CCharacter::SERVERZONE_PROCESSED);
|
||||
GameClientDispatch.PushRequestKey(DBRequest.GetRequestKey());
|
||||
return true;
|
||||
}
|
||||
|
||||
DBRequest.CancelRequest();
|
||||
}
|
||||
|
||||
ERRLOG0(g_Log, "ServerZone <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.");
|
||||
|
||||
return GameClientSendPacket::SendCharMoveZone(
|
||||
GameClientDispatch.GetSendStream(), NULL, 0, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientParsePacket::ParseCSAuth(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktCSAuth), GameClientDispatch);
|
||||
|
||||
PktCSAuth* lpPktCSAuth = reinterpret_cast<PktCSAuth *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
switch(lpPktCSAuth->m_AuthCodeType)
|
||||
{
|
||||
case 1:
|
||||
/* // edith 2009.08.11 <20><><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD> 2.5 <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
if (false == GameClientDispatch.CheckAuthCode(lpPktCSAuth->m_dwAuthCode))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ڵ尡 <20>߸<EFBFBD><DFB8>Ǿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
GameClientDispatch.Disconnect();
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
break;
|
||||
|
||||
case 2:
|
||||
GameClientDispatch.SetAuthAnswer(lpPktCSAuth->m_AuthCode2);
|
||||
|
||||
if (false == GameClientDispatch.CheckAuthAnswer())
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>(2)<29><> <20>߸<EFBFBD><DFB8>Ǿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
GameClientDispatch.Disconnect();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ERRLOG2(g_Log, "CID:0x%08x Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8>(%d) <20><> <20><><EFBFBD>½<EFBFBD><C2BD>ϴ<EFBFBD>",
|
||||
lpCharacter->GetCID(), lpPktCSAuth->m_AuthCodeType);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GameClientParsePacket::ParseKeyInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktKeyInfo), GameClientDispatch);
|
||||
|
||||
PktKeyInfo* lpPktKeyInfo = reinterpret_cast<PktKeyInfo*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
GET_SINGLE_DISPATCH(lpDBAgentDispatch,
|
||||
CDBAgentDispatch, CDBAgentDispatch::GetDispatchTable());
|
||||
|
||||
if(0 != lpDBAgentDispatch)
|
||||
{
|
||||
CSendStream& SendStream = lpDBAgentDispatch->GetSendStream();
|
||||
|
||||
char* szBuffer = SendStream.GetBuffer(sizeof(PktKeyInfo));
|
||||
|
||||
if (0 != szBuffer)
|
||||
{
|
||||
PktKeyInfo* pPktKeyInfo = reinterpret_cast<PktKeyInfo*>(szBuffer);
|
||||
|
||||
pPktKeyInfo->m_dwCID = lpPktKeyInfo->m_dwCID;
|
||||
memcpy(pPktKeyInfo->m_dwKeyInfo, lpPktKeyInfo->m_dwKeyInfo, sizeof(unsigned long)*PktKeyInfo::MAX_KEY_INFO);
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktKeyInfo), CmdKeyInfo, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef _PARSE_CHAR_LOGIN_OUT_H_
|
||||
#define _PARSE_CHAR_LOGIN_OUT_H_
|
||||
|
||||
struct PktBase;
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
// <20>Ϲ<EFBFBD><CFB9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
bool ParseCharLogin(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> - DBAgent<6E><74> ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>û
|
||||
bool ParseCharLogout(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20>αƿ<D7BE>
|
||||
bool ParseCharMoveZone(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // ij<><C4B3><EFBFBD><EFBFBD> <20><> <20>̵<EFBFBD>
|
||||
bool ParseServerZone(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
bool ParseCSAuth(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD> <20>ڵ<EFBFBD> (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
|
||||
bool ParseKeyInfo(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD>̽<EFBFBD>ƽ Ű <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>? --;;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,228 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ParseCharQuest.h"
|
||||
#include "SendCharQuest.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Packet/PacketStruct/CharQuestPacket.h>
|
||||
|
||||
#include <Creature/CreatureManager.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/NPC/NPC.h>
|
||||
|
||||
#include <Quest/QuestStruct.h>
|
||||
#include <Quest/QuestMgr.h>
|
||||
|
||||
#include <Community/Party/Party.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharStartQuest(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktStartQuest), GameClientDispatch);
|
||||
|
||||
PktStartQuest* lpPktSQ = static_cast<PktStartQuest*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktSQ->m_dwCharID;
|
||||
unsigned long dwNPCID = lpPktSQ->m_dwNPCID;
|
||||
unsigned short wQuestID = lpPktSQ->m_wQuestID;
|
||||
|
||||
unsigned short wError = PktStartQuest::NO_SERVER_ERR;
|
||||
|
||||
Quest::QuestNode* lpQuestNode = CQuestMgr::GetInstance().GetQuestNode(wQuestID);
|
||||
if (lpQuestNode)
|
||||
{
|
||||
switch (lpQuestNode->GetQuestType())
|
||||
{
|
||||
case Quest::NPC_QUEST:
|
||||
{
|
||||
CNPC* lpNPC = CCreatureManager::GetInstance().GetNPC(dwNPCID);
|
||||
if (NULL == lpNPC)
|
||||
{
|
||||
ERRLOG2(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> NPC<50>Դϴ<D4B4>. NID:0x%08x", lpCharacter->GetCID(), dwNPCID);
|
||||
wError = PktStartQuest::FAIL_NOT_NPC;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpQuestNode = NULL;
|
||||
if (false == lpNPC->GetQuest(lpCharacter, wQuestID, &lpQuestNode))
|
||||
{
|
||||
wError = PktStartQuest::FAIL_NOT_HAVE_QUEST;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if (lpQuestNode->IsPartyQuest() && NULL != lpCharacter->GetParty())
|
||||
// {
|
||||
// CCharacterParty* lpParty = reinterpret_cast<CCharacterParty*>(lpCharacter->GetParty());
|
||||
// if (lpParty)
|
||||
// {
|
||||
// return lpParty->StartQuest(lpQuestNode, lpNPC->GetCurrentPos(), dwNPCID);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
{
|
||||
if (true == lpCharacter->CheckQuest(lpQuestNode, wError))
|
||||
{
|
||||
if (false == lpCharacter->GiveQuest(lpQuestNode))
|
||||
{
|
||||
wError = PktStartQuest::FAIL_FULL_QUEST;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Quest::ITEM_QUEST:
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>z UseItem <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
ERRLOG1(g_Log, "CID:0x%08x ITEM_QUEST <20><> StartQuest <20><>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD> <20><>û<EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
wError = PktStartQuest::SERVER_ERROR;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case Quest::AREA_QUEST:
|
||||
{
|
||||
if (lpQuestNode->m_dwZoneID == CServerSetup::GetInstance().GetServerZone())
|
||||
{
|
||||
const Position QuestPos(lpQuestNode->m_fPosX, lpQuestNode->m_fPosY, lpQuestNode->m_fPosZ);
|
||||
unsigned long dwDist = lpCharacter->GetCurrentPos().GetDistance(QuestPos);
|
||||
|
||||
if (dwDist <= lpQuestNode->m_fDistance + Quest::ERROR_OF_DIST)
|
||||
{
|
||||
// if (lpQuestNode->IsPartyQuest() && NULL != lpCharacter->GetParty())
|
||||
// {
|
||||
// CCharacterParty* lpParty = reinterpret_cast<CCharacterParty*>(lpCharacter->GetParty());
|
||||
// if (lpParty)
|
||||
// {
|
||||
// return lpParty->StartQuest(lpQuestNode, QuestPos, 0);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
{
|
||||
if (true == lpCharacter->CheckQuest(lpQuestNode, wError))
|
||||
{
|
||||
if (false == lpCharacter->GiveQuest(lpQuestNode))
|
||||
{
|
||||
wError = PktStartQuest::FAIL_FULL_QUEST;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wError = PktStartQuest::FAIL_TOO_FAR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wError = PktStartQuest::SERVER_ERROR;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRLOG2(g_Log, "CID:0x%08x QuestID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> Quest<73>Դϴ<D4B4>.", lpCharacter->GetCID(), wQuestID);
|
||||
wError = PktStartQuest::NOT_EXIST_QUEST;
|
||||
}
|
||||
|
||||
bool bResult = GameClientSendPacket::SendCharStartQuest(GameClientDispatch.GetSendStream(),
|
||||
dwCharID, dwNPCID, wQuestID, wError);
|
||||
if (PktStartQuest::NO_SERVER_ERR == wError)
|
||||
{
|
||||
lpCharacter->StartPhase(wQuestID, 1);
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
// Ʈ<><C6AE><EFBFBD><EFBFBD> <20>ߵ<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharOperateTrigger(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktOperateTrigger), GameClientDispatch);
|
||||
|
||||
PktOperateTrigger* lpPktOT = static_cast<PktOperateTrigger*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktOT->m_dwCharID;
|
||||
unsigned short wQuestID = lpPktOT->m_wQuestID;
|
||||
unsigned char cPhase = lpPktOT->m_cPhase;
|
||||
unsigned char cTriggerKind = lpPktOT->m_cTriggerKind;
|
||||
unsigned char cTrigger = lpPktOT->m_cTrigger;
|
||||
unsigned char cCount = lpPktOT->m_cCount;
|
||||
|
||||
Quest::QuestNode* lpQuestNode = CQuestMgr::GetInstance().GetQuestNode(wQuestID);
|
||||
if (lpQuestNode)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD>! : TRIGGER_LEVEL_TALK<4C><4B> TRIGGER_LEVEL_TALK <20><> TRIGGER_TALK <20><> <20><>Ƽ <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD>̴<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȥ<>ڸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>.
|
||||
if (Quest::TRIGGER_LEVEL_TALK == cTriggerKind || Quest::TRIGGER_TALK == cTriggerKind ||
|
||||
Quest::TRIGGER_FAME_TALK == cTriggerKind || Quest::TRIGGER_ABILITY_TALK == cTriggerKind )
|
||||
{
|
||||
lpCharacter->OperateTrigger(wQuestID, cPhase, cTrigger, cCount-1, lpCharacter->GetCurrentPos());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lpQuestNode->IsPartyQuest() && NULL != lpCharacter->GetParty())
|
||||
{
|
||||
CCharacterParty* lpParty = reinterpret_cast<CCharacterParty*>(lpCharacter->GetParty());
|
||||
if (lpParty)
|
||||
{
|
||||
lpParty->OperateTrigger(wQuestID, cPhase, cTrigger, cCount-1, lpCharacter->GetCurrentPos());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short wError = lpCharacter->OperateTrigger(wQuestID, cPhase, cTrigger, cCount-1, lpCharacter->GetCurrentPos());
|
||||
if (PktOperateTrigger::NO_SERVER_ERR != wError)
|
||||
{
|
||||
ERRLOG3(g_Log, "CID:0x%08x Ʈ<><C6AE><EFBFBD><EFBFBD> <20>ߵ<EFBFBD><DFB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DFBB>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>. [3] <20><><EFBFBD><EFBFBD>Ʈ:%d, <20><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>:%d", dwCharID, wQuestID, wError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharCancelQuest(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktCancelQuest), GameClientDispatch);
|
||||
|
||||
PktCancelQuest* lpPktCQ = static_cast<PktCancelQuest*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktCQ->m_dwCharID;
|
||||
unsigned short wQuestID = lpPktCQ->m_wQuestID;
|
||||
|
||||
unsigned short wError = PktBase::NO_SERVER_ERR;
|
||||
if (wQuestID & Quest::DISABLE_CANCEL_QUEST_BIT)
|
||||
{
|
||||
wError = PktCancelQuest::FAIL_DISABLE_CANCEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (false == lpCharacter->CancelQuest(wQuestID))
|
||||
{
|
||||
wError = PktCancelQuest::FAIL_NOT_HAVE_QUEST;
|
||||
}
|
||||
}
|
||||
|
||||
return GameClientSendPacket::SendCharCancelQuest(GameClientDispatch.GetSendStream(),
|
||||
dwCharID, wQuestID, wError);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef _PARSE_CHAR_QUEST_H_
|
||||
#define _PARSE_CHAR_QUEST_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharStartQuest(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharOperateTrigger(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // Ʈ<><C6AE><EFBFBD><EFBFBD> <20>ߵ<EFBFBD>
|
||||
bool ParseCharCancelQuest(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ParseCharSkill.h"
|
||||
#include "SendCharSkill.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Item/ItemStructure.h>
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharStatusPacket.h>
|
||||
|
||||
|
||||
// <20><>ų <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharUseSkill(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharSkillErase(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktSk), GameClientDispatch);
|
||||
|
||||
PktSk* lpPktSk = static_cast<PktSk*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktSk->m_dwCharID;
|
||||
unsigned short usSkill = lpPktSk->m_wSkill;
|
||||
unsigned char cIndex = lpPktSk->m_cIndex;
|
||||
Item::ItemPos ItemPos = lpPktSk->m_ItemPos; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ġ
|
||||
|
||||
if(0x1000 <= usSkill && usSkill < 0x2000)
|
||||
{
|
||||
if (false == lpCharacter->AbilityErase(cIndex, ItemPos))
|
||||
{
|
||||
GameClientSendPacket::SendCharSkillCommand(GameClientDispatch.GetSendStream(), dwCharID,
|
||||
CmdCharSkillErase, cIndex, usSkill, PktSk::SERVER_ERROR);
|
||||
|
||||
ERRLOG3(g_Log, "CID:0x%08x <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>. Skill: %d, Index: %d", dwCharID, usSkill, cIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// edith 2008.02.14 <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>־<EFBFBD><D6BE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ְ<EFBFBD> <20><><EFBFBD><EFBFBD>??)
|
||||
if (false == lpCharacter->SkillErase(cIndex, ItemPos))
|
||||
{
|
||||
GameClientSendPacket::SendCharSkillCommand(GameClientDispatch.GetSendStream(), dwCharID,
|
||||
CmdCharSkillErase, cIndex, usSkill, PktSk::SERVER_ERROR);
|
||||
|
||||
ERRLOG3(g_Log, "CID:0x%08x <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ ó<><C3B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>. Skill: %d, Index: %d", dwCharID, usSkill, cIndex);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef _PARSE_CHAR_SKILL_H_
|
||||
#define _PARSE_CHAR_SKILL_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharUseSkill(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>ų <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharSkillErase(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,715 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "ParseCharUpgradeItem.h"
|
||||
#include "SendCharUpgradeItem.h"
|
||||
#include "GameClientDispatch.h"
|
||||
|
||||
#include <Network/Dispatch/ParseUtils.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacket.h>
|
||||
|
||||
#include <Log/ItemLog.h>
|
||||
#include <Log/LogStruct.h>
|
||||
|
||||
#include <Item/Item.h>
|
||||
#include <Item/ItemStructure.h>
|
||||
#include <Item/ItemFactory.h>
|
||||
#include <Item/ItemMgr.h>
|
||||
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/Npc/NPC.h>
|
||||
|
||||
#include <Castle/Castle.h>
|
||||
#include <Castle/CastleConstants.h>
|
||||
#include <Castle/CastleMgr.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ν<EFBFBD><CEBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharInstallSocket(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktIS), GameClientDispatch);
|
||||
|
||||
PktIS* lpPktIS = static_cast<PktIS *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktIS->m_dwCharID;
|
||||
Item::ItemPos EquipPos = lpPktIS->m_equipPos;
|
||||
Item::ItemPos GemPos = lpPktIS->m_gemPos;
|
||||
|
||||
Item::CEquipment* lpEquipment = Item::CEquipment::DowncastToEquipment(lpCharacter->GetItem(EquipPos));
|
||||
Item::CItem* lpGem = lpCharacter->GetItem(GemPos);
|
||||
|
||||
unsigned short wError = PktBase::NO_SERVER_ERR;
|
||||
if (NULL != lpEquipment)
|
||||
{
|
||||
if (NULL != lpGem)
|
||||
{
|
||||
wError = lpEquipment->InstallSocket(*lpGem);
|
||||
}
|
||||
else
|
||||
{
|
||||
wError = Item::CEquipment::E_GET_GEM_FAILED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wError = Item::CEquipment::E_GET_EQUIP_FAILED;
|
||||
}
|
||||
|
||||
GAMELOG::LogInstallSocket(*lpCharacter, TakeType(GemPos, EquipPos, 1),
|
||||
lpGem, lpEquipment, static_cast<GAMELOG::ERRType>(wError));
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<≯<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||
if (NULL != lpGem)
|
||||
{
|
||||
if (0 == lpGem->GetNumOrDurability())
|
||||
{
|
||||
if (lpCharacter->RemoveItem(GemPos))
|
||||
{
|
||||
DELETE_ITEM(lpGem);
|
||||
}
|
||||
else
|
||||
{
|
||||
wError = Item::CEquipment::E_REMOVE_GEM_FAILED;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (PktBase::NO_SERVER_ERR == wError && TakeType::TS_EQUIP == EquipPos.m_cPos)
|
||||
{
|
||||
lpCharacter->CalculateStatusData(false);
|
||||
}
|
||||
|
||||
if (PktBase::NO_SERVER_ERR != wError)
|
||||
{
|
||||
lpEquipment = NULL;
|
||||
}
|
||||
|
||||
return GameClientSendPacket::SendCharInstallSocket(GameClientDispatch.GetSendStream(), dwCharID,
|
||||
EquipPos, GemPos, lpEquipment, wError);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharItemChemical(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktItemChemical), GameClientDispatch);
|
||||
|
||||
PktItemChemical* lpPktIC = static_cast<PktItemChemical *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktIC->m_dwCharID;
|
||||
Item::ItemPos PickkingPos = lpPktIC->m_pickkingPos;
|
||||
Item::ItemPos TargetPos = lpPktIC->m_targetPos;
|
||||
unsigned char cPickkingNum = lpPktIC->m_cPickkingNum;
|
||||
|
||||
unsigned short wError = PktBase::NO_SERVER_ERR;
|
||||
|
||||
Item::CItem* lpPickkingItem = lpCharacter->GetItem(PickkingPos);
|
||||
Item::CItem* lpTargetItem = lpCharacter->GetItem(TargetPos);
|
||||
Item::CItem* lpResultItem = NULL;
|
||||
|
||||
Item::ChemicalInfo chemicalInfo;
|
||||
|
||||
unsigned short wPickkingItemID = 0;
|
||||
unsigned char cPickkingItemNum = 0;
|
||||
|
||||
if (NULL == lpPickkingItem || NULL == lpTargetItem)
|
||||
{
|
||||
ERRLOG5(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>. "
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ : (%d, 0x%04x), <20>ռ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ : (%d, 0x%04x)",
|
||||
dwCharID, PickkingPos.m_cPos, PickkingPos.m_cIndex, TargetPos.m_cPos, TargetPos.m_cIndex);
|
||||
lpCharacter->GetInventory().DumpItemInfo();
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20><><EFBFBD>ø<EFBFBD> <20><> <20>ٷ<EFBFBD> <20>ռ<EFBFBD><D5BC>Ϸ<EFBFBD><CFB7><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ӽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD>ش<EFBFBD>.
|
||||
if (0 < cPickkingNum && cPickkingNum < lpPickkingItem->GetNumOrDurability())
|
||||
{
|
||||
Item::ItemPos HoldPos(TakeType::TS_TEMP, Item::ExtraSpacePos::HOLDITEM_POS);
|
||||
Item::CItem* lpHoldItem = lpCharacter->GetItem(HoldPos);
|
||||
if (NULL != lpHoldItem)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD> <20><><EFBFBD>ø<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD><D5BC><EFBFBD> <20>õ<EFBFBD><C3B5>մϴ<D5B4>.",
|
||||
dwCharID);
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
goto SEND_PACKET;
|
||||
}
|
||||
|
||||
Item::CItem* lpSplitItem = Item::CItemFactory::GetInstance().CreateItem(lpPickkingItem->GetItemInfo());
|
||||
if (NULL == lpSplitItem)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
goto SEND_PACKET;
|
||||
}
|
||||
|
||||
lpSplitItem->SetNumOrDurability(cPickkingNum);
|
||||
|
||||
if (false == lpCharacter->SetItem(HoldPos, lpSplitItem))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20>ӽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
|
||||
DELETE_ITEM(lpSplitItem);
|
||||
|
||||
goto SEND_PACKET;
|
||||
}
|
||||
|
||||
lpPickkingItem->SetNumOrDurability(lpPickkingItem->GetNumOrDurability() - cPickkingNum);
|
||||
|
||||
// <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ<EFBFBD>ؼ<EFBFBD> <20>ռ<EFBFBD><D5BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
lpPickkingItem = lpSplitItem;
|
||||
PickkingPos = lpPickkingItem->GetPos();
|
||||
}
|
||||
|
||||
chemicalInfo.m_wPickkingItemID = lpPickkingItem->GetPrototypeID();
|
||||
chemicalInfo.m_cPickkingItemNum = lpPickkingItem->GetNumOrDurability();
|
||||
|
||||
chemicalInfo.m_wTargetItemID = lpTargetItem->GetPrototypeID();
|
||||
chemicalInfo.m_cTargetItemNum = lpTargetItem->GetNumOrDurability();
|
||||
|
||||
wError = Item::CItemMgr::GetInstance().GetChemicalResult(chemicalInfo);
|
||||
|
||||
// <20><><EFBFBD>⼭ <20>Ϸ<EFBFBD><CFB7><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC> <20>˻<EFBFBD><CBBB>Ѵ<EFBFBD>.
|
||||
if (PktBase::NO_SERVER_ERR == wError && chemicalInfo.m_usQuestID != 0)
|
||||
{
|
||||
// <20>Ϸ<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20>˻<EFBFBD>
|
||||
if( !lpCharacter->HasHistoryQuest(chemicalInfo.m_usQuestID) )
|
||||
wError = Item::Chemical::F_NOT_QUEST;
|
||||
}
|
||||
if (PktBase::NO_SERVER_ERR == wError && chemicalInfo.m_usAbilityID != 0)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ <20>˻<EFBFBD>
|
||||
short sLockCount = lpCharacter->GetSkillLockCount(chemicalInfo.m_usAbilityID);
|
||||
if(chemicalInfo.m_cAbilityLevel <= sLockCount)
|
||||
wError = PktBase::NO_SERVER_ERR;
|
||||
else
|
||||
wError = Item::Chemical::F_NOT_ABILITY;
|
||||
}
|
||||
|
||||
if (PktBase::NO_SERVER_ERR == wError)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
if (0 == chemicalInfo.m_cPickkingItemNum)
|
||||
{
|
||||
if (true == lpCharacter->RemoveItem(PickkingPos))
|
||||
{
|
||||
DELETE_ITEM(lpPickkingItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ſ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
goto SEND_PACKET;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPickkingItem->SetNumOrDurability(chemicalInfo.m_cPickkingItemNum);
|
||||
|
||||
wPickkingItemID = chemicalInfo.m_wPickkingItemID;
|
||||
cPickkingItemNum = chemicalInfo.m_cPickkingItemNum;
|
||||
}
|
||||
|
||||
// <20>ռ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
if (0 == chemicalInfo.m_cTargetItemNum)
|
||||
{
|
||||
if (true == lpCharacter->RemoveItem(TargetPos))
|
||||
{
|
||||
DELETE_ITEM(lpTargetItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20>ռ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ſ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
goto SEND_PACKET;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lpTargetItem->SetNumOrDurability(chemicalInfo.m_cTargetItemNum);
|
||||
|
||||
lpCharacter->RemoveItem(TargetPos);
|
||||
lpCharacter->SetItem(PickkingPos, lpTargetItem);
|
||||
|
||||
wPickkingItemID = chemicalInfo.m_wTargetItemID;
|
||||
cPickkingItemNum = chemicalInfo.m_cTargetItemNum;
|
||||
}
|
||||
|
||||
// <20>ռ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
lpResultItem = Item::CItemFactory::GetInstance().CreateItem(chemicalInfo.m_wResultItemID);
|
||||
lpResultItem->SetNumOrDurability(chemicalInfo.m_cResultItemNum);
|
||||
lpCharacter->SetItem(TargetPos, lpResultItem);
|
||||
}
|
||||
}
|
||||
|
||||
SEND_PACKET:
|
||||
|
||||
return GameClientSendPacket::SendCharItemChemical(GameClientDispatch.GetSendStream(), dwCharID,
|
||||
PickkingPos, TargetPos, wPickkingItemID, cPickkingItemNum, lpResultItem, wError);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharUpgradeItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktUgI), GameClientDispatch);
|
||||
|
||||
PktUgI* lpPktUgl = static_cast<PktUgI *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
using namespace Item;
|
||||
|
||||
unsigned long dwCID = lpCharacter->GetCID();
|
||||
unsigned long dwNPCID = lpPktUgl->m_dwNPCID;
|
||||
unsigned short wError = Item::CEquipment::S_SUCCESS;
|
||||
unsigned long dwUsedGold = 0;
|
||||
unsigned char cCurrentMineralNum = 0;
|
||||
unsigned char cValue = 0;
|
||||
|
||||
Item::CItem* lpDstItem = lpCharacter->GetItem(ItemPos(TakeType::TS_EXTRA, ExtraSpacePos::UPGRADE_EQUIPMENT_POS));
|
||||
Item::CItem* lpMineral = lpCharacter->GetItem(ItemPos(TakeType::TS_EXTRA, ExtraSpacePos::UPGRADE_MATERIAL_POS));
|
||||
|
||||
Item::CEquipment* lpEquipment = Item::CEquipment::DowncastToEquipment(lpDstItem);
|
||||
|
||||
unsigned char cLastUpgradeLevel = 0;
|
||||
|
||||
if (NULL == lpDstItem)
|
||||
{
|
||||
wError = Item::CEquipment::E_GET_EQUIP_FAILED;
|
||||
}
|
||||
else if (NULL == lpMineral)
|
||||
{
|
||||
wError = Item::CEquipment::E_GET_MINERAL_FAILED;
|
||||
}
|
||||
else if (NULL == lpEquipment || !lpEquipment->IsUpgradable())
|
||||
{
|
||||
wError = Item::CEquipment::E_NOT_EQUIP;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(lpMineral->GetPrototypeID() == Item::EtcItemID::AWAKENCORE)
|
||||
cLastUpgradeLevel = lpEquipment->GetCoreLevel();
|
||||
else
|
||||
cLastUpgradeLevel = lpEquipment->GetUpgradeLevel();
|
||||
|
||||
// lpEquipment<6E><74> <20><><EFBFBD>⼭<EFBFBD><E2BCAD> <20><><EFBFBD><EFBFBD>
|
||||
wError = lpEquipment->UpgradeItem(*lpMineral, lpCharacter->GetGold(), dwUsedGold, cValue);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> NPC <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
CNPC* lpNPC = CCreatureManager::GetInstance().GetNPC(dwNPCID);
|
||||
if (NULL != lpNPC && lpNPC->IsBelongToCastle())
|
||||
{
|
||||
Castle::CCastle* lpCastle = Castle::CCastleMgr::GetInstance().GetCastleByNameID(lpNPC->GetCastleNameID());
|
||||
if (NULL != lpCastle)
|
||||
{
|
||||
const unsigned long dwResmeltTax = static_cast<unsigned long>(dwUsedGold * (lpCastle->GetTax(Castle::RESMELT_TAX) / 100.0f));
|
||||
|
||||
if (dwResmeltTax > 0)
|
||||
{
|
||||
lpCastle->AddTempTaxMoney(Castle::RESMELT_TAX, dwResmeltTax);
|
||||
dwUsedGold += dwResmeltTax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < dwUsedGold)
|
||||
{
|
||||
if (dwUsedGold > lpCharacter->GetGold())
|
||||
{
|
||||
wError = Item::CEquipment::E_NOT_ENOUGH_MONEY;
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
lpCharacter->DeductGold(dwUsedGold, false);
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
cCurrentMineralNum = lpMineral->GetNumOrDurability();
|
||||
if (0 == cCurrentMineralNum)
|
||||
{
|
||||
if (false == lpCharacter->RemoveItem(lpMineral->GetPos()))
|
||||
{
|
||||
wError = Item::CEquipment::E_REMOVE_GEM_FAILED;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD><CCB5><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ſ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCID);
|
||||
}
|
||||
else
|
||||
{
|
||||
DELETE_ITEM(lpMineral);
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD> <20><><EFBFBD>нÿ<D0BD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ְ<EFBFBD> <20><>ö <20><><EFBFBD><EFBFBD>
|
||||
if (wError == Item::CEquipment::S_BROKEN_EQUIP)
|
||||
{
|
||||
if (false == lpCharacter->RemoveItem(ItemPos(TakeType::TS_EXTRA,
|
||||
ExtraSpacePos::UPGRADE_EQUIPMENT_POS)))
|
||||
{
|
||||
wError = Item::CEquipment::E_REMOVE_EQUIP_FAILED;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD> <20><><EFBFBD>н<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ſ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCID);
|
||||
}
|
||||
else
|
||||
{
|
||||
DELETE_ITEM(lpDstItem);
|
||||
lpDstItem = Item::CItemFactory::GetInstance().CreateItem(EtcItemID::SCRAPS);
|
||||
|
||||
if (NULL == lpDstItem)
|
||||
{
|
||||
wError = Item::CEquipment::E_CREATE_SCRAP_FAILED;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD> <20><><EFBFBD>н<EFBFBD> <20><>ö <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCID);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (false == lpCharacter->SetItem(ItemPos(TakeType::TS_EXTRA,
|
||||
ExtraSpacePos::UPGRADE_EQUIPMENT_POS), lpDstItem))
|
||||
{
|
||||
wError = Item::CEquipment::E_SET_SCRAP_FAILED;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ö<EFBFBD><C3B6> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>â<EFBFBD><C3A2> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCID);
|
||||
|
||||
DELETE_ITEM(lpDstItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wError == Item::CEquipment::S_BROKEN_EQUIP || wError == Item::CEquipment::S_SUCCESS)
|
||||
{
|
||||
wError = Item::CEquipment::S_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpDstItem = NULL;
|
||||
lpMineral = NULL;
|
||||
}
|
||||
|
||||
GAMELOG::LogUpgradeItem(*lpCharacter, lpCharacter->GetGold(), dwUsedGold,
|
||||
cLastUpgradeLevel, lpDstItem, lpMineral, cValue, wError);
|
||||
|
||||
return GameClientSendPacket::SendCharUpgradeItem(GameClientDispatch.GetSendStream(),
|
||||
dwCID, lpCharacter->GetGold(), lpDstItem, cCurrentMineralNum, cValue, wError);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20>̽<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharItemOptionGraft(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktItemOptionGraft), GameClientDispatch);
|
||||
|
||||
PktItemOptionGraft* lpPktIOG = static_cast<PktItemOptionGraft *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCID = lpPktIOG->m_dwCharID;
|
||||
unsigned char cAttributeType = lpPktIOG->m_cAttributeType;
|
||||
|
||||
unsigned short wError = PktBase::NO_SERVER_ERR;
|
||||
unsigned long dwUsedGold = 0;
|
||||
|
||||
using namespace Item;
|
||||
|
||||
Item::CEquipment* lpOriginalItem = Item::CEquipment::DowncastToEquipment(
|
||||
lpCharacter->GetItem(Item::ItemPos(TakeType::TS_EXTRA, Item::ExtraSpacePos::GRAFT_ORIGINAL_POS)));
|
||||
Item::CEquipment* lpSacrificeItem = Item::CEquipment::DowncastToEquipment(
|
||||
lpCharacter->GetItem(Item::ItemPos(TakeType::TS_EXTRA, Item::ExtraSpacePos::GRAFT_SACRIFICE_POS)));
|
||||
|
||||
size_t nOldItemSize = 0;
|
||||
size_t nUseItemSize = 0;
|
||||
|
||||
char szOldItemData[Item::MAX_ITEM_SIZE];
|
||||
char szUseItemData[Item::MAX_ITEM_SIZE];
|
||||
|
||||
unsigned long dwOldGold = lpCharacter->GetGold();
|
||||
|
||||
if (NULL == lpOriginalItem || NULL == lpSacrificeItem)
|
||||
{
|
||||
// <20>ɼ<EFBFBD> <20>̽<EFBFBD><CCBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
// edith <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ɼ<EFBFBD><C9BC>̽<EFBFBD> <20><>Ŷ
|
||||
|
||||
// <20>α<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> item serialize<7A><65> <20>Ѵ<EFBFBD>.
|
||||
nOldItemSize = Item::MAX_ITEM_SIZE;
|
||||
if(!lpOriginalItem->SerializeOut(szOldItemData, nOldItemSize))
|
||||
{
|
||||
nOldItemSize = 0;
|
||||
}
|
||||
|
||||
nUseItemSize = Item::MAX_ITEM_SIZE;
|
||||
if(!lpSacrificeItem->SerializeOut(szUseItemData, nUseItemSize))
|
||||
{
|
||||
nUseItemSize = 0;
|
||||
}
|
||||
|
||||
bool bUpgradeLevelLimit = false;
|
||||
|
||||
wError = lpOriginalItem->OptionGraft(lpSacrificeItem, bUpgradeLevelLimit, cAttributeType, lpCharacter->GetGold(), dwUsedGold);
|
||||
|
||||
if (PktBase::NO_SERVER_ERR == wError || wError == 5) // 5<><35> <20>ɼ<EFBFBD><C9BC>̽<EFBFBD> <20><><EFBFBD>з<EFBFBD> <20>ݾװ<DDBE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20>ݾ<EFBFBD>
|
||||
lpCharacter->DeductGold(dwUsedGold, false);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (false == lpCharacter->RemoveItem(lpSacrificeItem->GetPos()))
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20>̽<EFBFBD> <20><><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ſ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCID);
|
||||
}
|
||||
else
|
||||
{
|
||||
DELETE_ITEM(lpSacrificeItem);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
lpCharacter->MoveItem(TakeType(lpOriginalItem->GetPos(),
|
||||
ItemPos(TakeType::TS_EXTRA, ExtraSpacePos::GRAFT_RESULT_POS), 1));
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>α<EFBFBD>
|
||||
GAMELOG::LogItemAttachOption(*lpCharacter, dwOldGold, cAttributeType,
|
||||
szOldItemData, nOldItemSize, szUseItemData, nUseItemSize, lpOriginalItem, wError);
|
||||
|
||||
return GameClientSendPacket::SendCharItemOptionGraft(GameClientDispatch.GetSendStream(),
|
||||
dwCID, lpCharacter->GetGold(), lpOriginalItem, wError);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD>
|
||||
bool GameClientParsePacket::ParseCharItemCompensation(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktItemCompensation), GameClientDispatch);
|
||||
|
||||
PktItemCompensation* lpPktPIC = static_cast<PktItemCompensation *>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCID = lpPktPIC->m_dwCharID;
|
||||
unsigned short wError = PktBase::NO_SERVER_ERR;
|
||||
|
||||
Item::CItem* lpOriginalItem = lpCharacter->GetItem(Item::ItemPos(TakeType::TS_EXTRA, Item::ExtraSpacePos::COMPENSATION_POS));
|
||||
unsigned long dwOldGold = lpCharacter->GetGold();
|
||||
|
||||
Item::CEquipment* lpOriginalEquip = Item::CEquipment::DowncastToEquipment(lpOriginalItem);
|
||||
if (NULL == lpOriginalEquip)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD><C7B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
Item::CEquipment* lpResultItem = NULL;
|
||||
long lResultGold = 0;
|
||||
|
||||
wError = lpOriginalEquip->Compensation(
|
||||
static_cast<unsigned char>(lpCharacter->GetClass()), static_cast<unsigned char>(lpCharacter->GetLevel()),
|
||||
lpCharacter->GetCharStatus(), &lpResultItem, lResultGold);
|
||||
|
||||
if (NULL == lpResultItem)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD> <20>Ǹſ<C7B8> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
}
|
||||
|
||||
if (0 > lResultGold && static_cast<unsigned long>(abs(lResultGold)) > lpCharacter->GetGold())
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.", lpCharacter->GetCID());
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
}
|
||||
|
||||
if (PktBase::NO_SERVER_ERR == wError)
|
||||
{
|
||||
if (false == lpCharacter->RemoveItem(lpOriginalEquip->GetPos()))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴµ<CFB4> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
DELETE_ITEM(lpResultItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (false == lpCharacter->GiveItem(lpResultItem))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD> <20><><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִµ<D6B4> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
|
||||
lpCharacter->SetItem(Item::ItemPos(TakeType::TS_EXTRA,
|
||||
Item::ExtraSpacePos::COMPENSATION_POS), lpOriginalItem);
|
||||
|
||||
DELETE_ITEM(lpResultItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 < lResultGold)
|
||||
{
|
||||
lpCharacter->AddGold(lResultGold, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
lpCharacter->DeductGold(abs(lResultGold), true);
|
||||
}
|
||||
|
||||
GAMELOG::LogItemCompensation(*lpCharacter, dwOldGold, lpOriginalItem, lpResultItem, 0);
|
||||
GameClientSendPacket::SendCharItemCompensation(GameClientDispatch.GetSendStream(), dwCID, 0);
|
||||
|
||||
DELETE_ITEM(lpOriginalItem);
|
||||
|
||||
// GiveItem <20><><EFBFBD><EFBFBD> <20><><EFBFBD>õ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (lpResultItem->IsSet(Item::DetailData::STACKABLE) && 0 == lpResultItem->GetNumOrDurability())
|
||||
{
|
||||
DELETE_ITEM(lpResultItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GAMELOG::LogItemCompensation(*lpCharacter, dwOldGold, 0, 0, wError);
|
||||
return GameClientSendPacket::SendCharItemCompensation(GameClientDispatch.GetSendStream(), dwCID, wError);
|
||||
}
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ/<2F><><EFBFBD><EFBFBD>.
|
||||
bool GameClientParsePacket::ParseCharInstallRuneSocket(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase)
|
||||
{
|
||||
CHECK_FIXED_PACKETSIZE(lpPktBase, sizeof(PktIRS), GameClientDispatch);
|
||||
|
||||
PktIRS* lpPktIRS = static_cast<PktIRS*>(lpPktBase);
|
||||
CCharacter* lpCharacter = GameClientDispatch.GetCharacter();
|
||||
|
||||
CHECK_CHARACTER_PTR(lpCharacter, GameClientDispatch, lpPktBase->GetCmd());
|
||||
|
||||
unsigned long dwCharID = lpPktIRS->m_dwCharID;
|
||||
Item::ItemPos EquipPos = lpPktIRS->m_equipPos;
|
||||
Item::ItemPos RunePos = lpPktIRS->m_runePos;
|
||||
unsigned char PktType = lpPktIRS->m_cType;
|
||||
|
||||
Item::CEquipment* lpEquipment = Item::CEquipment::DowncastToEquipment(lpCharacter->GetItem(EquipPos));
|
||||
|
||||
unsigned short wError = PktBase::NO_SERVER_ERR;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>ĭ<EFBFBD><C4AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˻<EFBFBD>.
|
||||
|
||||
bool bEquip = lpCharacter->GetEquipments().GetItem(EquipPos) == NULL ? false : true;
|
||||
|
||||
Item::CItem* lpRune = lpCharacter->GetItem(RunePos);
|
||||
|
||||
if(PktType==PktIRS::RUNE_INSTALL)
|
||||
{
|
||||
if(lpEquipment && lpRune)
|
||||
{
|
||||
Item::CEquipment::EQUIPMENT_ERROR equipError = lpEquipment->InstallRuneSocket(*lpRune, bEquip, lpCharacter->GetLevel());
|
||||
|
||||
if(equipError!=Item::CEquipment::R_SUCCESS)
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(lpRune)
|
||||
{
|
||||
if(!lpRune->GetNumOrDurability())
|
||||
{
|
||||
if(lpCharacter->RemoveItem(RunePos))
|
||||
{
|
||||
DELETE_ITEM(lpRune);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!lpEquipment)
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
|
||||
if(!lpRune)
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ۿ<EFBFBD> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(PktType==PktIRS::RUNE_UNINSTALL)
|
||||
{
|
||||
if(lpEquipment && lpRune)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD> <20><>ų <20><><EFBFBD><EFBFBD>Ʈ <20>˻<EFBFBD>.
|
||||
|
||||
SKILL skill = lpCharacter->GetSkill();
|
||||
|
||||
short sSkillPoint = lpCharacter->GetStatus().m_StatusInfo.m_wSkillPoint - skill.GetSkillNum();
|
||||
|
||||
if(sSkillPoint<0)
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ų<EFBFBD><C5B3><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ִ<EFBFBD> <20><>ų<EFBFBD><C5B3><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> Ŭ <20><><EFBFBD><EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
else
|
||||
{
|
||||
Item::CEquipment::EQUIPMENT_ERROR equipError = lpEquipment->UnInstallRuneSocket(*lpRune, bEquip, lpCharacter->GetLevel(), sSkillPoint);
|
||||
|
||||
if(equipError!=Item::CEquipment::R_SUCCESS)
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(lpRune)
|
||||
{
|
||||
if(!lpRune->GetNumOrDurability())
|
||||
{
|
||||
if(lpCharacter->RemoveItem(RunePos))
|
||||
{
|
||||
DELETE_ITEM(lpRune);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20>Ҹ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!lpEquipment)
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
|
||||
if(!lpRune)
|
||||
{
|
||||
wError = PktBase::SERVER_ERROR;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20>Ҹ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>", lpCharacter->GetCID());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lpCharacter->CalculateStatusData(false);
|
||||
|
||||
return GameClientSendPacket::SendCharRuneInstallSocket(GameClientDispatch.GetSendStream(), dwCharID,
|
||||
EquipPos, RunePos, lpEquipment, PktType, wError);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
#ifndef _PARSE_CHAR_UPGRADE_ITEM_H_
|
||||
#define _PARSE_CHAR_UPGRADE_ITEM_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
class CGameClientDispatch;
|
||||
|
||||
namespace GameClientParsePacket
|
||||
{
|
||||
bool ParseCharInstallSocket(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ν<EFBFBD><CEBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool ParseCharItemChemical(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD>
|
||||
bool ParseCharUpgradeItem(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
bool ParseCharItemOptionGraft(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20>̽<EFBFBD>
|
||||
bool ParseCharItemCompensation(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD>
|
||||
bool ParseCharInstallRuneSocket(CGameClientDispatch& GameClientDispatch, PktBase* lpPktBase); // <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>ġ, <20><><EFBFBD><EFBFBD>.
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,70 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "SendCharAdmin.h"
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharAdminPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacketStruct.h>
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharAdminCmdToDBAgent(CSendStream& AgentSendStream, PktBase* lpPktBase)
|
||||
{
|
||||
if (NULL == lpPktBase)
|
||||
{
|
||||
ERRLOG0(g_Log, "<EFBFBD><EFBFBD>Ŷ<EFBFBD><EFBFBD> NULL <20>Դϴ<D4B4>.");
|
||||
return false;
|
||||
}
|
||||
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktAdmin));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktAdmin* lpPktAdmin = reinterpret_cast<PktAdmin*>(lpBuffer);
|
||||
|
||||
lpPktAdmin->m_usCmd = static_cast<PktAdmin*>(lpPktBase)->m_usCmd;
|
||||
strncpy(lpPktAdmin->m_stName, static_cast<PktAdmin*>(lpPktBase)->m_stName, PktAdmin::MAX_NAME_LEN);
|
||||
lpPktAdmin->m_usProtoTypeID = static_cast<PktAdmin*>(lpPktBase)->m_usProtoTypeID;
|
||||
lpPktAdmin->m_Position = static_cast<PktAdmin*>(lpPktBase)->m_Position;
|
||||
lpPktAdmin->m_dwAmount = static_cast<PktAdmin*>(lpPktBase)->m_dwAmount;
|
||||
lpPktAdmin->m_dwAdminCID = static_cast<PktAdmin*>(lpPktBase)->m_dwAdminCID;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktAdmin), CmdCharAdminCmd, 0, PktBase::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharNameChange(CSendStream& SendStream, unsigned long dwUID, unsigned long dwCID,
|
||||
const char* szChangeName, unsigned char cNameChangeCount, Item::ItemPos* lpItem_In, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCharNameChange));
|
||||
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
PktCharNameChange* lpPktCharNameChange =
|
||||
reinterpret_cast<PktCharNameChange*>(lpBuffer);
|
||||
|
||||
lpPktCharNameChange->m_dwUID = dwUID;
|
||||
lpPktCharNameChange->m_dwCID = dwCID;
|
||||
|
||||
strncpy(lpPktCharNameChange->m_szCharName, szChangeName, CHAR_INFOST::MAX_NAME_LEN);
|
||||
lpPktCharNameChange->m_szCharName[CHAR_INFOST::MAX_NAME_LEN -1] = 0;
|
||||
|
||||
lpPktCharNameChange->m_cNameChangeCount = cNameChangeCount;
|
||||
|
||||
if(lpItem_In != NULL)
|
||||
{
|
||||
lpPktCharNameChange->m_ItemPos = *lpItem_In;
|
||||
}
|
||||
else
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ɾ<EFBFBD>.
|
||||
lpPktCharNameChange->m_ItemPos.m_cPos = TakeType::TS_ADMIN;
|
||||
}
|
||||
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCharNameChange), CmdCharNameChange, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef _SEND_CHAR_ADMIN_H_
|
||||
#define _SEND_CHAR_ADMIN_H_
|
||||
|
||||
#include <DB/DBdefine.h>
|
||||
#include <Item/ItemStructure.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktBase;
|
||||
class CSendStream;
|
||||
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
bool SendCharAdminCmdToDBAgent(CSendStream& AgentSendStream, PktBase* lpPktBase);
|
||||
|
||||
bool SendCharNameChange(CSendStream& SendStream, unsigned long dwUID, unsigned long dwCID,
|
||||
const char* szChangeName, unsigned char cNameChangeCount, Item::ItemPos* lpItem_In, unsigned short usError);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,301 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "SendCharAttack.h"
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/WrapPacket.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharMovePacket.h>
|
||||
|
||||
#include <Network/Dispatch/DBAgent/DBAgentDispatch.h>
|
||||
#include <Network/Dispatch/GameClient/GameClientDispatch.h>
|
||||
|
||||
#include <Creature/AggresiveCreature.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/Monster/Monster.h>
|
||||
|
||||
#include <Skill/SkillTable.h>
|
||||
#include <Skill/Spell/SpellTable.h>
|
||||
#include <Skill/Spell/SpellUtil.h>
|
||||
|
||||
#include <Community/Guild/Guild.h>
|
||||
#include <Community/Guild/GuildMgr.h>
|
||||
|
||||
#include <Map/FieldMap/Cell.h>
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharDuelCmd(CSendStream& SendStream, unsigned long dwSenderID, unsigned long dwRecverID,
|
||||
unsigned char cCmd, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktDuC));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktDuC* lpPktDuCAck = reinterpret_cast<PktDuC*>(lpBuffer);
|
||||
|
||||
lpPktDuCAck->m_dwSenderID = dwSenderID;
|
||||
lpPktDuCAck->m_dwRecverID = dwRecverID;
|
||||
|
||||
lpPktDuCAck->m_cCmd = cCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktDuC), CmdCharDuelCmd, 0, usError);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharAttacked(CSendStream& SendStream, CAggresiveCreature* pAttackCreature, CAggresiveCreature* pDefendCharacter,
|
||||
const AtType attackType, float fDir, unsigned short wDamage, unsigned char cDefenserJudge,
|
||||
unsigned short wMPHeal, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktAted));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktAted* lpPktAted = reinterpret_cast<PktAted*>(lpBuffer);
|
||||
|
||||
lpPktAted->m_dwCharID = pAttackCreature->GetCID();
|
||||
lpPktAted->m_dwMyID = pDefendCharacter->GetCID();
|
||||
|
||||
lpPktAted->m_AtType = attackType;
|
||||
|
||||
lpPktAted->m_Postion.fPointX = pAttackCreature->GetCurrentPos().m_fPointX;
|
||||
lpPktAted->m_Postion.fPointY = pAttackCreature->GetCurrentPos().m_fPointY;
|
||||
lpPktAted->m_Postion.fPointZ = pAttackCreature->GetCurrentPos().m_fPointZ;
|
||||
lpPktAted->m_fDir = fDir;
|
||||
|
||||
lpPktAted->m_wMyHP = pDefendCharacter->GetStatus().m_nNowHP;
|
||||
lpPktAted->m_wMyMP = pDefendCharacter->GetStatus().m_nNowMP;
|
||||
lpPktAted->m_wMyMPHeal = wMPHeal;
|
||||
|
||||
lpPktAted->m_cJudge = cDefenserJudge;
|
||||
|
||||
SendStream.WrapCrypt(sizeof(PktAted), CmdCharAttacked, 0, usError);
|
||||
}
|
||||
|
||||
// <20>´<EFBFBD> <20>ڰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD> <20><> <20><>Ƽ<EFBFBD><C6BC><EFBFBD>鿡<EFBFBD><E9BFA1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ݴ<EFBFBD><DDB4>ߴٴ<DFB4> <20><EFBFBD><DEBD><EFBFBD><EFBFBD><EFBFBD> <20>Ѹ<EFBFBD><D1B8><EFBFBD>.
|
||||
if(Creature::CT_PC == Creature::GetCreatureType(pDefendCharacter->GetCID()))
|
||||
{
|
||||
static_cast<CCharacter*>(pDefendCharacter)->SendAttackedToParty(
|
||||
pAttackCreature->GetCID(), attackType, wDamage, cDefenserJudge, wMPHeal);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharEquipDurability(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned char cIndex, unsigned char cValue, unsigned char cValueMax, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktEquipDurability));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktEquipDurability* lpPktED = reinterpret_cast<PktEquipDurability*>(lpBuffer);
|
||||
|
||||
lpPktED->m_dwCharID = dwCharID;
|
||||
|
||||
lpPktED->m_cIndex = cIndex;
|
||||
lpPktED->m_cValue = cValue;
|
||||
lpPktED->m_cValueMax = cValueMax; // <20>̰<EFBFBD><CCB0><EFBFBD> 0<≯<EFBFBD> <20>ִ볻<D6B4><EBB3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȭ<EFBFBD><C8AD> <20><><EFBFBD><EFBFBD>. <20>ִ볻<D6B4><EBB3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ּҰ<D6BC><D2B0><EFBFBD> 1.
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktEquipDurability), CmdCharEquipDurability, 0, usError);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharPeaceMode(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned char cLeftTime, bool bPeace, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktPeace));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktPeace* lpPktPeaceAck = reinterpret_cast<PktPeace *>(lpBuffer);
|
||||
|
||||
lpPktPeaceAck->m_dwCharID = dwCharID;
|
||||
lpPktPeaceAck->m_cLeftTime = cLeftTime;
|
||||
lpPktPeaceAck->m_bPeace = bPeace;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktPeace), CmdCharPeaceMode, 0, usError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharSummon(unsigned long dwCharID, CAggresiveCreature* lpSummonee)
|
||||
{
|
||||
CCell* lpCell = lpSummonee->GetCellPos().m_lpCell;
|
||||
if (NULL == lpCell)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.", lpSummonee->GetCID());
|
||||
return false;
|
||||
}
|
||||
|
||||
PktSummon pktSummon;
|
||||
memset(&pktSummon, 0, sizeof(PktSummon));
|
||||
|
||||
pktSummon.m_dwCharID = dwCharID;
|
||||
pktSummon.m_dwTargetID = lpSummonee->GetCID();
|
||||
|
||||
pktSummon.m_NetworkPos.Initialize(lpSummonee->GetCurrentPos().m_fPointX, lpSummonee->GetCurrentPos().m_fPointY,
|
||||
lpSummonee->GetCurrentPos().m_fPointZ, 0, 0);
|
||||
|
||||
lpCell->SendAllNearCellCharacter(&pktSummon, sizeof(PktSummon), CmdCharSummon);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharSummonCmd(CCharacter* lpCharacter, CMonster* lpSummonee,
|
||||
unsigned char cCmd, unsigned long dwTargetID)
|
||||
{
|
||||
PktSummonCmd pktSummonCmd;
|
||||
memset(&pktSummonCmd, 0, sizeof(PktSummonCmd));
|
||||
|
||||
pktSummonCmd.m_dwCharID = lpCharacter->GetCID();
|
||||
pktSummonCmd.m_cCmd = cCmd;
|
||||
pktSummonCmd.m_dwTargetID = dwTargetID;
|
||||
|
||||
if (PktSummonCmd::SUC_DIE == cCmd)
|
||||
{
|
||||
CCell* lpCell = lpSummonee->GetCellPos().m_lpCell;
|
||||
if (NULL == lpCell)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.", lpSummonee->GetCID());
|
||||
return false;
|
||||
}
|
||||
|
||||
lpCell->SendAllNearCellCharacter(&pktSummonCmd, sizeof(PktSummonCmd), CmdCharSummonCmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
char* szPacket = reinterpret_cast<char*>(&pktSummonCmd);
|
||||
CGameClientDispatch* lpDispatch = lpCharacter->GetDispatcher();
|
||||
|
||||
if (0 != lpDispatch &&
|
||||
PacketWrap::WrapCrypt(szPacket, sizeof(PktSummonCmd), CmdCharSummonCmd, 0, 0))
|
||||
{
|
||||
lpDispatch->GetSendStream().PutBuffer(szPacket, sizeof(PktSummonCmd), CmdCharSummonCmd);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharBattleGroundRespawn(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned short wTurn, unsigned short wWaitNum, unsigned short wLeftTime,
|
||||
unsigned short wHumanNum, unsigned short wAkhanNum, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktBGRsAck));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktBGRsAck* lpPktBGRsAck = reinterpret_cast<PktBGRsAck *>(lpBuffer);
|
||||
|
||||
lpPktBGRsAck->m_dwCharID = dwCharID;
|
||||
|
||||
lpPktBGRsAck->m_wTurn = wTurn;
|
||||
lpPktBGRsAck->m_wWaitNum = wWaitNum;
|
||||
|
||||
lpPktBGRsAck->m_wLeftTime = wLeftTime;
|
||||
|
||||
lpPktBGRsAck->m_wHumanNum = wHumanNum;
|
||||
lpPktBGRsAck->m_wAkhanNum = wAkhanNum;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktBGRsAck), CmdCharBattleGroundRespawn, 0, usError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCameraScript(unsigned long dwDeleteObject, unsigned long dwNewObject, Position NewPos, unsigned long dwTime)
|
||||
{
|
||||
CCreatureManager& CreatureManager = CCreatureManager::GetInstance();
|
||||
|
||||
CreatureManager.ProcessAllCharacter(Skill::CAddSpell<CInvincibleSpell>(CSpell::Spell_Info(
|
||||
Skill::CProcessTable::ProcessInfo::m_NullProtoType, NULL,
|
||||
Skill::SpellType::MAGICAL_SPELL, Skill::SpellID::Invincible, 1, dwTime)));
|
||||
|
||||
PktCameraScript pktCS;
|
||||
pktCS.m_dwDeleteObject = dwDeleteObject;
|
||||
pktCS.m_dwNewObject = dwNewObject;
|
||||
|
||||
pktCS.m_NewPos.fPointX = NewPos.m_fPointX;
|
||||
pktCS.m_NewPos.fPointY = NewPos.m_fPointY;
|
||||
pktCS.m_NewPos.fPointZ = NewPos.m_fPointZ;
|
||||
|
||||
char* szPacket = reinterpret_cast<char*>(&pktCS);
|
||||
if (PacketWrap::WrapCrypt(szPacket, sizeof(PktCameraScript), CmdCameraScript, 0, 0))
|
||||
{
|
||||
CreatureManager.SendAllCharacter(szPacket, sizeof(PktCameraScript), CmdCameraScript);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharDeadToParty(CCharacter* lpDeadCharacter,
|
||||
CAggresiveCreature* lpReference, PktDeadInfo::TypeCode eTypeCode)
|
||||
{
|
||||
if(0 != lpDeadCharacter && 0 != lpDeadCharacter->GetPID())
|
||||
{
|
||||
GET_SINGLE_DISPATCH(lpDispatch, CDBAgentDispatch,
|
||||
CDBAgentDispatch::GetDispatchTable());
|
||||
|
||||
if(0 != lpDispatch)
|
||||
{
|
||||
CSendStream& SendStream = lpDispatch->GetSendStream();
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktDeadInfo));
|
||||
if(0 != lpBuffer)
|
||||
{
|
||||
PktDeadInfo* lpDeadInfo = reinterpret_cast<PktDeadInfo*>(lpBuffer);
|
||||
|
||||
lpDeadInfo->m_dwRequestKey = 0;
|
||||
lpDeadInfo->m_wCmd = PktDD::SCmdDeadPartyMem;
|
||||
|
||||
lpDeadInfo->m_cTypeCode = eTypeCode; // Ÿ<><C5B8><EFBFBD>ڵ<EFBFBD>
|
||||
lpDeadInfo->m_usDeadMemCurrHP = lpDeadCharacter->GetStatus().m_nNowHP; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HP
|
||||
lpDeadInfo->m_usDeadMemCurrMP = lpDeadCharacter->GetStatus().m_nNowMP; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MP
|
||||
|
||||
lpDeadInfo->m_dwDeadCID = lpDeadCharacter->GetCID(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CID
|
||||
lpDeadInfo->m_dwDeadPID = lpDeadCharacter->GetPID(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PID
|
||||
strncpy(lpDeadInfo->m_szDeadName, lpDeadCharacter->GetCharacterName(), CHAR_INFOST::MAX_NAME_LEN);
|
||||
lpDeadInfo->m_szDeadName[CHAR_INFOST::MAX_NAME_LEN - 1] = 0;
|
||||
|
||||
lpDeadInfo->m_cDeadNation = lpDeadCharacter->GetNation(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
lpDeadInfo->m_cDeadClass = (unsigned char)lpDeadCharacter->GetClass(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD>
|
||||
lpDeadInfo->m_cRefNation = 0;
|
||||
lpDeadInfo->m_cRefClass = 0;
|
||||
|
||||
if(0 != lpReference)
|
||||
{
|
||||
lpDeadInfo->m_dwReferenceID = lpReference->GetCID(); // <20><><EFBFBD>̰ų<CCB0> <20>츰<EFBFBD><ECB8B0> CID
|
||||
|
||||
if(Creature::CT_PC == Creature::GetCreatureType(lpReference->GetCID()))
|
||||
{
|
||||
CCharacter* lpReferenceCharacter = static_cast<CCharacter*>(lpReference);
|
||||
|
||||
strncpy(lpDeadInfo->m_szRefName, lpReferenceCharacter->GetCharacterName(), CHAR_INFOST::MAX_NAME_LEN);
|
||||
lpDeadInfo->m_szRefName[CHAR_INFOST::MAX_NAME_LEN - 1] = 0;
|
||||
|
||||
Guild::CGuild* lpGuild = 0;
|
||||
if (0 != lpReferenceCharacter->GetGID() &&
|
||||
0 != (lpGuild = Guild::CGuildMgr::GetInstance().GetGuild(lpReferenceCharacter->GetGID())))
|
||||
{
|
||||
strncpy(lpDeadInfo->m_szRefGuildName, lpGuild->GetName(), Guild::MAX_GUILD_NAME_LEN);
|
||||
lpDeadInfo->m_szRefGuildName[Guild::MAX_GUILD_NAME_LEN - 1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(lpDeadInfo->m_szRefGuildName, 0, sizeof(char) * Guild::MAX_GUILD_NAME_LEN);
|
||||
}
|
||||
|
||||
lpDeadInfo->m_cRefNation = lpReferenceCharacter->GetNation();
|
||||
lpDeadInfo->m_cRefClass = (unsigned char)lpReferenceCharacter->GetClass();
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(lpDeadInfo->m_szRefName, 0, sizeof(char) * CHAR_INFOST::MAX_NAME_LEN);
|
||||
memset(lpDeadInfo->m_szRefGuildName, 0, sizeof(char) * Guild::MAX_GUILD_NAME_LEN);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lpDeadInfo->m_dwReferenceID = 0;
|
||||
memset(lpDeadInfo->m_szRefName, 0, sizeof(char) * CHAR_INFOST::MAX_NAME_LEN);
|
||||
memset(lpDeadInfo->m_szRefGuildName, 0, sizeof(char) * Guild::MAX_GUILD_NAME_LEN);
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktDeadInfo), CmdAgentParty, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef _SEND_CHAR_ATTACK_H_
|
||||
#define _SEND_CHAR_ATTACK_H_
|
||||
|
||||
// <20>ӽ<EFBFBD> <20>Լ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
class CAggresiveCreature;
|
||||
class CCharacter;
|
||||
class CMonster;
|
||||
struct AtType;
|
||||
struct Position;
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharDuelCmd(CSendStream& SendStream, unsigned long dwSenderID, unsigned long dwRecverID,
|
||||
unsigned char cCmd, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharAttacked(CSendStream& SendStream, CAggresiveCreature* pAttackCreature, CAggresiveCreature* pDefendCharacter,
|
||||
const AtType attackType, float fDir, unsigned short wDamage, unsigned char cDefenserJudge, unsigned short wMPHeal, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharEquipDurability(CSendStream& SendStream, unsigned long dwCharID, unsigned char cIndex, unsigned char cValue, unsigned char cValueMax,
|
||||
unsigned short usError);
|
||||
|
||||
// <20><>ȭ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharPeaceMode(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned char cLeftTime, bool bPeace, unsigned short usError);
|
||||
|
||||
// <20><>ȯ<EFBFBD><C8AF> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharSummonCmd(CCharacter* lpCharacter, CMonster* lpSummonee,
|
||||
unsigned char cCmd, unsigned long dwTargetID);
|
||||
|
||||
// <20><>ȯ
|
||||
bool SendCharSummon(unsigned long dwCharID, CAggresiveCreature* lpSummonee);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ack (<28><>Ʋ<EFBFBD><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
bool SendCharBattleGroundRespawn(CSendStream& SendStream, unsigned long dwCharID, unsigned short wTurn, unsigned short wWaitNum,
|
||||
unsigned short wLeftTime, unsigned short wHumanNum, unsigned short wAkhanNum, unsigned short usError);
|
||||
|
||||
// ī<><EFBFBD> <20><>ũ<EFBFBD><C5A9>Ʈ
|
||||
bool SendCameraScript(unsigned long dwDeleteObject, unsigned long dwNewObject, Position NewPos, unsigned long dwTime);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharDeadToParty(CCharacter* lpDeadCharacter, CAggresiveCreature* lpReference, PktDeadInfo::TypeCode eTypeCode);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "SendCharBGServer.h"
|
||||
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/CreatureManager.h>
|
||||
|
||||
#include <Network/Dispatch/GameClient/GameClientDispatch.h>
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/BGServerPacket.h>
|
||||
|
||||
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>̵<EFBFBD> (<28><><EFBFBD>̵<EFBFBD>)
|
||||
bool GameClientSendPacket::SendCharBGServerMoveZone(CSendStream& SendStream, unsigned char cZone, unsigned char cMoveType, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktBGServerMoveZone));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktBGServerMoveZone* lpPktBGSMZ = reinterpret_cast<PktBGServerMoveZone *>(lpBuffer);
|
||||
|
||||
lpPktBGSMZ->m_wMapNumber = 0;
|
||||
lpPktBGSMZ->m_cMoveType = cMoveType;
|
||||
lpPktBGSMZ->m_cZone = cZone;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktBGServerMoveZone), CmdBGServerMoveZone, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȯ<><C8AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharBGServerMileageChange(CSendStream& SendStream, unsigned long dwCID, unsigned char cGroup,
|
||||
unsigned char cCmd, unsigned long dwGold, unsigned long dwMileage, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktBGServerMileageChange));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktBGServerMileageChange* lpPktBGSMC = reinterpret_cast<PktBGServerMileageChange *>(lpBuffer);
|
||||
|
||||
lpPktBGSMC->m_dwCID = dwCID;
|
||||
lpPktBGSMC->m_cGroup = cGroup;
|
||||
lpPktBGSMC->m_cCmd = cCmd;
|
||||
lpPktBGSMC->m_dwGold = dwGold;
|
||||
lpPktBGSMC->m_dwMileage = dwMileage;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktBGServerMileageChange), CmdBGServerMileageChange, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef _SEND_CHAR_BATTLEGROUND_SERVER_PACKET_H_
|
||||
#define _SEND_CHAR_BATTLEGROUND_SERVER_PACKET_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
|
||||
namespace VirtualArea
|
||||
{
|
||||
struct RoomInfo;
|
||||
struct ResultInfo;
|
||||
}
|
||||
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>濡 <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharBGServerMoveZone(CSendStream& SendStream, unsigned char cZone, unsigned char cMoveType, unsigned short wError);
|
||||
|
||||
// <20><>Ʋ <20><EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȯ<><C8AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharBGServerMileageChange(CSendStream& SendStream, unsigned long dwCID, unsigned char cGroup,
|
||||
unsigned char cCmd, unsigned long dwGold, unsigned long dwMileage, unsigned short wError);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,344 @@
|
||||
#include "stdafx.h"
|
||||
#include "SendCharCastle.h"
|
||||
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CastlePacket.h>
|
||||
#include <Network/Dispatch/GameClient/GameClientDispatch.h>
|
||||
|
||||
#include <Castle/CastleMgr.h>
|
||||
#include <Creature/Siege/SiegeObjectMgr.h>
|
||||
#include <GameTime/GameTimeMgr.h>
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>)
|
||||
bool GameClientSendPacket::SendCharCastleInfo(CSendStream& SendStream)
|
||||
{
|
||||
return Castle::CCastleMgr::GetInstance().SendCastleInfo(SendStream);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharGameTimeInfo(CSendStream& SendStream)
|
||||
{
|
||||
return CGameTimeMgr::GetInstance().SendGameTimeInfo(SendStream);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD>ڽ<EFBFBD> <20><><EFBFBD>밡<EFBFBD><EBB0A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendStealthInfo(CSendStream& SendStream, bool bUseStealth)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktStealthInfo));
|
||||
if (lpBuffer)
|
||||
{
|
||||
PktStealthInfo* lpPktSI = reinterpret_cast<PktStealthInfo*>(lpBuffer);
|
||||
lpPktSI->m_bUseStealth = bUseStealth;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktStealthInfo), CmdStealthInfo, 0, PktBase::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharCampInfo(CSendStream& SendStream)
|
||||
{
|
||||
return CSiegeObjectMgr::GetInstance().SendCampInfo(SendStream);
|
||||
}
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharCastleCmd(CSendStream& SendStream, unsigned long dwCastleID, unsigned long dwCastleObjectID,
|
||||
unsigned long dwValue1, unsigned long dwValue2, unsigned char cSubCmd, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCastleCmd));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCastleCmd* lpPktCC = reinterpret_cast<PktCastleCmd *>(lpBuffer);
|
||||
|
||||
lpPktCC->m_dwCastleID = dwCastleID;
|
||||
lpPktCC->m_dwCastleObjectID = dwCastleObjectID;
|
||||
lpPktCC->m_dwValue1 = dwValue1;
|
||||
lpPktCC->m_dwValue2 = dwValue2;
|
||||
lpPktCC->m_cSubCmd = cSubCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCastleCmd), CmdCastleCmd, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharCastleRight(CSendStream& SendStream, unsigned long dwCasltID,
|
||||
const CastleRight& castleRight, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCastleRight));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCastleRight* lpPktCastleRight = reinterpret_cast<PktCastleRight *>(lpBuffer);
|
||||
|
||||
lpPktCastleRight->m_dwCID = 0; // C -> GS : ij<><C4B3><EFBFBD><EFBFBD>CID
|
||||
lpPktCastleRight->m_dwCastleID = dwCasltID;
|
||||
lpPktCastleRight->m_CastleRight = castleRight;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCastleRight), CmdCastleRight, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharCampRight(CSendStream& SendStream, unsigned long dwCampID,
|
||||
const CampRight& campRight, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCampRight));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCampRight* lpPktCampRight = reinterpret_cast<PktCampRight *>(lpBuffer);
|
||||
|
||||
lpPktCampRight->m_dwCID = 0; // C -> GS : ij<><C4B3><EFBFBD><EFBFBD>CID
|
||||
lpPktCampRight->m_dwCampID = dwCampID;
|
||||
lpPktCampRight->m_CampRight = campRight;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCampRight), CmdCampRight, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharCampCmd(CSendStream& SendStream, unsigned long dwCID, unsigned long dwCampID,
|
||||
unsigned char cSubCmd, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCampCmd));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCampCmd* lpPktCampCmd = reinterpret_cast<PktCampCmd *>(lpBuffer);
|
||||
|
||||
lpPktCampCmd->m_dwCID = dwCID;
|
||||
lpPktCampCmd->m_dwCampID = dwCampID;
|
||||
lpPktCampCmd->m_cSubCmd = cSubCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCampCmd), CmdCampCmd, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharSiegeArmsCmd(CSendStream& SendStream, unsigned long dwCID, unsigned long dwArmsID,
|
||||
unsigned char cSubCmd, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSiegeArmsCmd));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSiegeArmsCmd* lpPktSACmd = reinterpret_cast<PktSiegeArmsCmd *>(lpBuffer);
|
||||
|
||||
lpPktSACmd->m_dwCID = dwCID;
|
||||
lpPktSACmd->m_dwArmsID = dwArmsID;
|
||||
lpPktSACmd->m_cSubCmd = cSubCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktSiegeArmsCmd), CmdSiegeArmsCmd, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool GameClientSendPacket::SendCharCreateCamp(CSendStream& AgentSendStream, unsigned long dwActorCID,
|
||||
unsigned long dwGID, unsigned short wObjectType, const Position& pos)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktCreateCamp));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCreateCamp* lpPktCreateCamp = reinterpret_cast<PktCreateCamp*>(lpBuffer);
|
||||
|
||||
lpPktCreateCamp->m_dwActorCID = dwActorCID;
|
||||
lpPktCreateCamp->m_dwCID = 0;
|
||||
lpPktCreateCamp->m_dwGID = dwGID;
|
||||
lpPktCreateCamp->m_dwCampID = 0;
|
||||
lpPktCreateCamp->m_dwHP = 0;
|
||||
lpPktCreateCamp->m_wObjectType = wObjectType;
|
||||
lpPktCreateCamp->m_cState = 0;
|
||||
lpPktCreateCamp->m_cSubState = 0;
|
||||
lpPktCreateCamp->m_cUpgradeStep = 0;
|
||||
lpPktCreateCamp->m_cNation = 0;
|
||||
lpPktCreateCamp->m_cZone = CServerSetup::GetInstance().GetServerZone();
|
||||
lpPktCreateCamp->m_cChannel = CServerSetup::GetInstance().GetServerChannel();
|
||||
lpPktCreateCamp->m_Pos.fPointX = pos.m_fPointX;
|
||||
lpPktCreateCamp->m_Pos.fPointY = pos.m_fPointY;
|
||||
lpPktCreateCamp->m_Pos.fPointZ = pos.m_fPointZ;
|
||||
lpPktCreateCamp->m_cMaterial = 0;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktCreateCamp), CmdCreateCamp, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool GameClientSendPacket::SendCharCreateSiegeArms(CSendStream& AgentSendStream, unsigned long dwOwnerID, unsigned char cNation,
|
||||
unsigned short wType, unsigned char cUpgradeStep, const Position& pos)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktCreateSiegeArms));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCreateSiegeArms* lpPktCreateSiegeArms = reinterpret_cast<PktCreateSiegeArms*>(lpBuffer);
|
||||
|
||||
lpPktCreateSiegeArms->m_dwCID = 0; // CID (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ID)
|
||||
lpPktCreateSiegeArms->m_dwOwnerID = dwOwnerID; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> CID
|
||||
lpPktCreateSiegeArms->m_wObjectType = wType; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8>
|
||||
lpPktCreateSiegeArms->m_cNation = cNation; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
lpPktCreateSiegeArms->m_dwHP = 0;
|
||||
lpPktCreateSiegeArms->m_cState = 0;
|
||||
lpPktCreateSiegeArms->m_cUpgradeStep = cUpgradeStep; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD> <20>ܰ<EFBFBD>
|
||||
lpPktCreateSiegeArms->m_cZone = CServerSetup::GetInstance().GetServerZone();
|
||||
lpPktCreateSiegeArms->m_cChannel = CServerSetup::GetInstance().GetServerChannel();
|
||||
lpPktCreateSiegeArms->m_Pos.fPointX = pos.m_fPointX;
|
||||
lpPktCreateSiegeArms->m_Pos.fPointY = pos.m_fPointY;
|
||||
lpPktCreateSiegeArms->m_Pos.fPointZ = pos.m_fPointZ;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktCreateSiegeArms), CmdCreateSiegeArms, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> DBAgent <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharCastleCmdToDBAgent(CSendStream& AgentSendStream, unsigned long dwCID, unsigned long dwCastleID, unsigned long dwCastleObjectID,
|
||||
unsigned long dwValue1, unsigned long dwValue2, unsigned char cSubCmd, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktCastleCmd));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCastleCmd* lpPktCastleCmd = reinterpret_cast<PktCastleCmd*>(lpBuffer);
|
||||
|
||||
lpPktCastleCmd->m_dwCID = dwCID;
|
||||
lpPktCastleCmd->m_dwCastleID = dwCastleID;
|
||||
lpPktCastleCmd->m_dwCastleObjectID = dwCastleObjectID;
|
||||
lpPktCastleCmd->m_dwValue1 = dwValue1;
|
||||
lpPktCastleCmd->m_dwValue2 = dwValue2;
|
||||
lpPktCastleCmd->m_cSubCmd = cSubCmd;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktCastleCmd), CmdCastleCmd, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> DBAgent <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharCampCmdToDBAgent(CSendStream& AgentSendStream, unsigned long dwCID, unsigned long dwCampID,
|
||||
unsigned long dwValue1, unsigned long dwValue2, unsigned char cSubCmd,
|
||||
unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktCampCmd));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCampCmd* lpPktCampCmd = reinterpret_cast<PktCampCmd*>(lpBuffer);
|
||||
|
||||
lpPktCampCmd->m_dwCID = dwCID;
|
||||
lpPktCampCmd->m_dwCampID = dwCampID;
|
||||
lpPktCampCmd->m_dwValue1 = dwValue1;
|
||||
lpPktCampCmd->m_dwValue2 = dwValue2;
|
||||
lpPktCampCmd->m_cSubCmd = cSubCmd;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktCampCmd), CmdCampCmd, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ DBAgent <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharSiegeArmsCmdToDBAgent(CSendStream& AgentSendStream, unsigned long dwCID, unsigned long dwArmsID,
|
||||
unsigned long dwValue, unsigned char cSubCmd, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktSiegeArmsCmd));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSiegeArmsCmd* lpPktSACmd = reinterpret_cast<PktSiegeArmsCmd*>(lpBuffer);
|
||||
|
||||
lpPktSACmd->m_dwCID = dwCID;
|
||||
lpPktSACmd->m_dwArmsID = dwArmsID;
|
||||
lpPktSACmd->m_dwValue = dwValue;
|
||||
lpPktSACmd->m_cSubCmd = cSubCmd;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktSiegeArmsCmd), CmdSiegeArmsCmd, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool GameClientSendPacket::SendCharCampMessageToDBAgent(CSendStream& AgentSendStream, unsigned long dwCampID, unsigned char cMsgCmd, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktCampMessage));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCampMessage* lpPktCM = reinterpret_cast<PktCampMessage*>(lpBuffer);
|
||||
memset(lpPktCM, 0, sizeof(PktCampMessage));
|
||||
|
||||
lpPktCM->m_cMsgCmd = cMsgCmd;
|
||||
lpPktCM->m_dwCampID = dwCampID;
|
||||
lpPktCM->m_bNotify = false;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktCampMessage), CmdCampMessage, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharCampMessageToDBAgent(CSendStream& AgentSendStream, unsigned long dwCampID, unsigned char cMsgCmd,
|
||||
const char* szName, int nNum, int nTotal, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktCampMessage));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCampMessage* lpPktCM = reinterpret_cast<PktCampMessage*>(lpBuffer);
|
||||
memset(lpPktCM, 0, sizeof(PktCampMessage));
|
||||
|
||||
lpPktCM->m_cMsgCmd = cMsgCmd;
|
||||
lpPktCM->m_dwCampID = dwCampID;
|
||||
strcpy(lpPktCM->m_szPCName, szName);
|
||||
lpPktCM->m_nValue1 = nNum;
|
||||
lpPktCM->m_nValue2 = nTotal;
|
||||
lpPktCM->m_bNotify = false;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktCampMessage), CmdCampMessage, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendWarOnOff(CSendStream& SendStream, unsigned long dwCID, unsigned char cType,
|
||||
unsigned char cFlag, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktWarOnOff));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktWarOnOff* lpPktWarOnOff = reinterpret_cast<PktWarOnOff*>(lpBuffer);
|
||||
lpPktWarOnOff->m_dwCID = dwCID;
|
||||
lpPktWarOnOff->m_cType = cType;
|
||||
lpPktWarOnOff->m_cFlag = cFlag;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktWarOnOff), CmdWarOnOff, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendRealmPoint(CSendStream& SendStream, unsigned long dwCID, unsigned char cRealmPoint, unsigned char cType, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktRealmPoint));
|
||||
|
||||
if(!lpBuffer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PktRealmPoint* lpPktRealmPoint = reinterpret_cast<PktRealmPoint*>(lpBuffer);
|
||||
|
||||
lpPktRealmPoint->m_dwCID = dwCID;
|
||||
lpPktRealmPoint->m_cRealmPoint = cRealmPoint;
|
||||
lpPktRealmPoint->m_cType = cType;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktRealmPoint), CmdRealmPoint, 0, wError);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
#ifndef _SEND_CHAR_CASTLE_H_
|
||||
#define _SEND_CHAR_CASTLE_H_
|
||||
|
||||
#include <Item/ItemStructure.h>
|
||||
|
||||
#include <Network/Packet/PacketStruct/CastlePacket.h>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> : <20><><EFBFBD>ε<EFBFBD>ij<EFBFBD><C4B3>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.)
|
||||
bool SendCharCastleInfo(CSendStream& SendStream);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharGameTimeInfo(CSendStream& SendStream);
|
||||
|
||||
// <20><><EFBFBD>ڽ<EFBFBD> <20><><EFBFBD>밡<EFBFBD><EBB0A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendStealthInfo(CSendStream& SendStream, bool bUseStealth);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharCampInfo(CSendStream& SendStream);
|
||||
|
||||
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharCastleCmd(CSendStream& SendStream, unsigned long dwCastleID, unsigned long dwCastleObjID,
|
||||
unsigned long dwValue1, unsigned long dwValue2, unsigned char cSubCmd, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharCampCmd(CSendStream& SendStream, unsigned long dwCID, unsigned long dwCampID,
|
||||
unsigned char cSubCmd, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharSiegeArmsCmd(CSendStream& SendStream, unsigned long dwCID, unsigned long dwArmsID,
|
||||
unsigned char cSubCmd, unsigned short wError);
|
||||
|
||||
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharCastleRight(CSendStream& SendStream, unsigned long dwCasltID,
|
||||
const CastleRight& castleRight, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharCampRight(CSendStream& SendStream, unsigned long dwCampID,
|
||||
const CampRight& campRight, unsigned short wError);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool SendCharCreateCamp(CSendStream& AgentSendStream, unsigned long dwActorCID, unsigned long dwGID,
|
||||
unsigned short wObjectType, const Position& pos);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool SendCharCreateSiegeArms(CSendStream& AgentSendStream, unsigned long dwOwnerID, unsigned char cNation,
|
||||
unsigned short wType, unsigned char cUpgradeStep, const Position& pos);
|
||||
|
||||
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> DBAgent <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool SendCharCastleCmdToDBAgent(CSendStream& AgentSendStream, unsigned long dwCID, unsigned long dwCastleID, unsigned long dwCastleObjectID,
|
||||
unsigned long dwValue1, unsigned long dwValue2, unsigned char cSubCmd, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> DBAgent <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool SendCharCampCmdToDBAgent(CSendStream& AgentSendStream, unsigned long dwCID, unsigned long dwCampID,
|
||||
unsigned long dwValue1, unsigned long dwValue2, unsigned char cSubCmd, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ DBAgent <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool SendCharSiegeArmsCmdToDBAgent(CSendStream& AgentSendStream, unsigned long dwCID, unsigned long dwArmsID,
|
||||
unsigned long dwValue, unsigned char cSubCmd, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD> ( GameServer --> DBAgentServer )
|
||||
bool SendCharCampMessageToDBAgent(CSendStream& AgentSendStream, unsigned long dwCampID, unsigned char cMsgCmd, unsigned short wError);
|
||||
bool SendCharCampMessageToDBAgent(CSendStream& AgentSendStream, unsigned long dwCampID, unsigned char cMsgCmd,
|
||||
const char* szName, int nNum, int nTotal, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendWarOnOff(CSendStream& SendStream, unsigned long dwCID, unsigned char cType, unsigned char cFlag, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>.
|
||||
bool SendRealmPoint(CSendStream& SendStream, unsigned long dwCID, unsigned char cRealmPoint, unsigned char cType, unsigned short wError);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,501 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "SendCharCommunity.h"
|
||||
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/CreatureManager.h>
|
||||
|
||||
#include <Network/Dispatch/GameClient/GameClientDispatch.h>
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/PartyPacket.h>
|
||||
#include <Network/Packet/PacketStruct/GuildPacket.h>
|
||||
#include <Network/Packet/PacketStruct/FriendPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharCommunityPacket.h>
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharExchangeCmd(CSendStream& SendStream, unsigned long dwSenderID_In,
|
||||
unsigned long dwRecverID_In, unsigned char cCmd_In, unsigned short usError_In)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktExC));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktExC* lpPktExC = reinterpret_cast<PktExC*>(lpBuffer);
|
||||
|
||||
lpPktExC->m_dwSenderID = dwSenderID_In;
|
||||
lpPktExC->m_dwRecverID = dwRecverID_In;
|
||||
lpPktExC->m_cCmd = cCmd_In;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktExC), CmdCharExchangeCmd, 0, usError_In);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharPartyCmd(CSendStream& SendStream, unsigned long dwPartyID_In,
|
||||
const AddressInfo &AddressInfo_In, const char* szSenderName_In,
|
||||
unsigned long dwSenderID_In, unsigned long dwReceiverID_In,
|
||||
unsigned short usCmd_In, unsigned short usError_In)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktPCAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktPCAck* lpPktPCAck = reinterpret_cast<PktPCAck*>(lpBuffer);
|
||||
|
||||
lpPktPCAck->m_SenderAddressInfo = AddressInfo_In; // Sender<65><72> <20>ּ<EFBFBD>
|
||||
if (NULL != szSenderName_In)
|
||||
{
|
||||
strncpy(lpPktPCAck->m_strSenderName, szSenderName_In, CHAR_INFOST::MAX_NAME_LEN); // Sender<65><72> <20≯<EFBFBD>
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(lpPktPCAck->m_strSenderName, 0, CHAR_INFOST::MAX_NAME_LEN);
|
||||
}
|
||||
|
||||
lpPktPCAck->m_dwPartyID = dwPartyID_In; // <20><>Ƽ <20><><EFBFBD>̵<EFBFBD>
|
||||
lpPktPCAck->m_dwSenderID = dwSenderID_In; // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD>̵<EFBFBD>(<28><>ü)
|
||||
lpPktPCAck->m_dwReferenceID = dwReceiverID_In; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̵<EFBFBD>(<28><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD> <20><><EFBFBD>̵<EFBFBD>)
|
||||
lpPktPCAck->m_cCmd = static_cast<unsigned char>(usCmd_In); // <20><><EFBFBD><EFBFBD>
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktPCAck), CmdCharPartyCmd, 0, usError_In);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharPartyCreateToDBAgent(CSendStream& AgentSendStream, unsigned long dwLeaderID, unsigned long dwMemberID, unsigned char cZone,
|
||||
unsigned short wLeaderClass, char cLeaderLevel, unsigned long dwLeaderGID,
|
||||
unsigned short wMemberClass, char cMemberLevel, unsigned long dwMemberGID)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktCPD));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCPD* lpPktCPD = reinterpret_cast<PktCPD*>(lpBuffer);
|
||||
|
||||
lpPktCPD->m_wCmd = PktDD::SCmdCreateParty;
|
||||
|
||||
lpPktCPD->m_dwLeaderID = dwLeaderID;
|
||||
lpPktCPD->m_wLeaderClass = wLeaderClass;
|
||||
lpPktCPD->m_cLeaderLevel = cLeaderLevel;
|
||||
lpPktCPD->m_dwLeaderGID = dwLeaderGID;
|
||||
|
||||
lpPktCPD->m_dwMemberID = dwMemberID;
|
||||
lpPktCPD->m_wMemberClass = wMemberClass;
|
||||
lpPktCPD->m_cMemberLevel = cMemberLevel;
|
||||
lpPktCPD->m_dwMemberGID = dwMemberGID;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktCPD), CmdAgentParty, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharPartyDestroyToDBAgent(CSendStream& AgentSendStream, unsigned long dwPartyID)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktDPD));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktDPD* lpPktDPD = reinterpret_cast<PktDPD*>(lpBuffer);
|
||||
|
||||
lpPktDPD->m_wCmd = PktDD::SCmdDeleteParty;
|
||||
lpPktDPD->m_dwPartyID = dwPartyID;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktDPD), CmdAgentParty, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendPartyMemberData(CSendStream& SendStream, unsigned long dwPartyID, unsigned long dwSenderID, unsigned long dwGID,
|
||||
unsigned short wClass, unsigned long dwServerID, char cLevel, const char* strSenderName, unsigned short usCmd)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktPMD));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktPMD* lpPktPMD = reinterpret_cast<PktPMD*>(lpBuffer);
|
||||
|
||||
lpPktPMD->m_wCmd = usCmd;
|
||||
lpPktPMD->m_dwPartyID = dwPartyID;
|
||||
lpPktPMD->m_dwSenderID = dwSenderID;
|
||||
lpPktPMD->m_dwGID = dwGID;
|
||||
lpPktPMD->m_dwServerID = dwServerID;
|
||||
lpPktPMD->m_wClass = wClass;
|
||||
lpPktPMD->m_cLevel = cLevel;
|
||||
|
||||
strncpy(lpPktPMD->m_strSenderName, strSenderName, CHAR_INFOST::MAX_NAME_LEN);
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktPMD), CmdAgentParty, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharStallRegisterItem(CSendStream& SendStream, unsigned long dwCharID, unsigned long dwShopID,
|
||||
TakeType takeType, unsigned long dwPrice, unsigned char cCmd, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktStRI));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktStRI* lpPktStRI = reinterpret_cast<PktStRI*>(lpBuffer);
|
||||
|
||||
lpPktStRI->m_dwCharID = dwCharID;
|
||||
lpPktStRI->m_dwShopID = dwShopID;
|
||||
lpPktStRI->m_TakeType = takeType;
|
||||
lpPktStRI->m_dwPrice = dwPrice;
|
||||
lpPktStRI->m_cCmd = cCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktStRI), CmdCharStallRegisterItem, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharStallEnter(CSendStream& SendStream, unsigned long dwCustomerID, unsigned long dwOwnerID,
|
||||
unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktStE));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktStE* lpPktStE = reinterpret_cast<PktStE*>(lpBuffer);
|
||||
|
||||
lpPktStE->m_dwCustomerID = dwCustomerID;
|
||||
lpPktStE->m_dwOwnerID = dwOwnerID;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktStE), CmdCharStallEnter, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharStallItemInfo(CSendStream& SendStream,
|
||||
unsigned long dwOwnerID, unsigned long* arylCustomerID,
|
||||
unsigned long dwTempSafe, unsigned char cTax,
|
||||
char* szBuffer, unsigned long dwItemSize, unsigned char cItemNum)
|
||||
{
|
||||
PktStIInfo* lpPktStIInfo = reinterpret_cast<PktStIInfo*>(szBuffer);
|
||||
|
||||
lpPktStIInfo->m_dwOwnerID = dwOwnerID;
|
||||
|
||||
std::copy(arylCustomerID, arylCustomerID + PktStIInfo::MAX_CUSTOMER_NUM, lpPktStIInfo->m_dwCustomerID);
|
||||
|
||||
lpPktStIInfo->m_dwTempSafe = dwTempSafe;
|
||||
lpPktStIInfo->m_cTax = cTax;
|
||||
|
||||
lpPktStIInfo->m_dwItemSize = dwItemSize;
|
||||
lpPktStIInfo->m_cItemNum = cItemNum;
|
||||
|
||||
return SendStream.WrapCompress(szBuffer,
|
||||
static_cast<unsigned short>(sizeof(PktStIInfo) + dwItemSize + (sizeof(unsigned long) * cItemNum)),
|
||||
CmdCharStallItemInfo, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
// ģ<><C4A3> <20><><EFBFBD><EFBFBD>, ģ<><C4A3> <20><><EFBFBD><EFBFBD>, <20>ź<EFBFBD> <20><><EFBFBD><EFBFBD>, <20>ź<EFBFBD> <20><><EFBFBD><EFBFBD> Ack, ģ<><C4A3> <20>α<EFBFBD><CEB1><EFBFBD>, ģ<><C4A3> <20>αƿ<D7BE>
|
||||
bool GameClientSendPacket::SendCharFriendAck(CSendStream& SendStream, unsigned char cAckCmd, unsigned long dwCID, const char* szFriendName,
|
||||
unsigned long dwGID, unsigned short wClass, char cLevel, unsigned long dwServerID, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktFriendAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktFriendAck* lpPktFriendAck = reinterpret_cast<PktFriendAck*>(lpBuffer);
|
||||
|
||||
lpPktFriendAck->m_dwCID = dwCID;
|
||||
lpPktFriendAck->m_cCmd = cAckCmd;
|
||||
lpPktFriendAck->m_dwGID = dwGID;
|
||||
lpPktFriendAck->m_wClass = wClass;
|
||||
lpPktFriendAck->m_cLevel = cLevel;
|
||||
lpPktFriendAck->m_dwServerID = dwServerID;
|
||||
|
||||
if (NULL == szFriendName)
|
||||
{
|
||||
memset(lpPktFriendAck->m_szName, 0, PktFriendAck::MAX_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(lpPktFriendAck->m_szName, szFriendName, PktFriendAck::MAX_NAME);
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktFriendAck), CmdFriendAck, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// ģ<><C4A3> <20><><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharFriendAdded(CSendStream& SendStream, unsigned long dwCID, const char* szName)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktFriendAddReq));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktFriendAddReq* lpPktFriendAddRequest = reinterpret_cast<PktFriendAddReq*>(lpBuffer);
|
||||
|
||||
memcpy(lpPktFriendAddRequest->m_szName, szName, PktFriendAddReq::MAX_NAME);
|
||||
lpPktFriendAddRequest->m_cCmd = PktFriendAddReq::ADDED_INFO;
|
||||
lpPktFriendAddRequest->m_dwCID = dwCID;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktFriendAddReq), CmdFriendAddRequest, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendFriendListChangeToDB(CSendStream& AgentSendStream, unsigned long dwUID, unsigned long dwCID,
|
||||
unsigned long dwReferenceUID, unsigned long dwReferenceCID, unsigned long dwData,
|
||||
unsigned long dwGID, unsigned short wClass, char cLevel, unsigned long dwServerID, unsigned char cChangeType)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktFriendDB));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktFriendDB* lpPktFriendDB = reinterpret_cast<PktFriendDB*>(lpBuffer);
|
||||
|
||||
lpPktFriendDB->m_dwOwnerUID = dwUID;
|
||||
lpPktFriendDB->m_dwOwnerCID = dwCID;
|
||||
lpPktFriendDB->m_dwReferenceUID = dwReferenceUID;
|
||||
lpPktFriendDB->m_dwReferenceCID = dwReferenceCID;
|
||||
lpPktFriendDB->m_dwData = dwData;
|
||||
lpPktFriendDB->m_cCmd = cChangeType;
|
||||
lpPktFriendDB->m_dwGID = dwGID;
|
||||
lpPktFriendDB->m_wClass = wClass;
|
||||
lpPktFriendDB->m_cLevel = cLevel;
|
||||
lpPktFriendDB->m_dwServerID = dwServerID;
|
||||
|
||||
return AgentSendStream.WrapCrypt(sizeof(PktFriendDB), CmdFriendDB, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharCreateGuild(CSendStream& SendStream, unsigned long dwMasterID, unsigned long dwGuildID,
|
||||
unsigned char cInclination, char* szGuildName, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCreateGuild));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCreateGuild* lpPktCreateGuild = reinterpret_cast<PktCreateGuild *>(lpBuffer);
|
||||
|
||||
lpPktCreateGuild->m_dwCID = dwMasterID;
|
||||
lpPktCreateGuild->m_dwGID = dwGuildID;
|
||||
lpPktCreateGuild->m_cInclination = cInclination;
|
||||
strncpy(lpPktCreateGuild->m_szGuildName, szGuildName, Guild::MAX_GUILD_NAME_LEN);
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCreateGuild), CmdCreateGuild, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharGuildCmd(CSendStream& SendStream, unsigned long dwGID, unsigned long dwSenderID, unsigned long dwReceiverID,
|
||||
const char* szGuildName, const char* szSenderName, unsigned short wCmd, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildCmd));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildCmd* lpPktGuildCmd = reinterpret_cast<PktGuildCmd *>(lpBuffer);
|
||||
|
||||
lpPktGuildCmd->m_dwGID = dwGID;
|
||||
|
||||
lpPktGuildCmd->m_dwSenderID = dwSenderID;
|
||||
lpPktGuildCmd->m_dwReferenceID = dwReceiverID;
|
||||
|
||||
strncpy(lpPktGuildCmd->m_szGuildName, szGuildName, MAX_GUILD_NAME_LEN);
|
||||
strncpy(lpPktGuildCmd->m_szSenderName, szSenderName, MAX_MEMBER_NAME_LEN);
|
||||
|
||||
lpPktGuildCmd->m_wCmd = wCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildCmd), CmdGuildCmd, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharGuildMark(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGID,
|
||||
char* szMark, unsigned long dwGold, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildMark));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildMark* lpPktGuildMark = reinterpret_cast<PktGuildMark *>(lpBuffer);
|
||||
|
||||
lpPktGuildMark->m_dwCID = dwCID;
|
||||
lpPktGuildMark->m_dwGID = dwGID;
|
||||
|
||||
::memcpy(lpPktGuildMark->m_szMark, szMark, Guild::MAX_MARK_SIZE);
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildMark), CmdGuildMark, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharGuildLevel(CSendStream& SendStream, unsigned long dwUID, unsigned char cLevel,
|
||||
unsigned long dwGold, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildLevel));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildLevel* lpPktGuildLevel = reinterpret_cast<PktGuildLevel *>(lpBuffer);
|
||||
|
||||
lpPktGuildLevel->m_dwUID = dwUID;
|
||||
lpPktGuildLevel->m_cLevel = cLevel;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildLevel), CmdGuildLevel, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharGuildRelation(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGID, unsigned long dwTargetGID,
|
||||
unsigned long dwValue, unsigned char cSubCmd, unsigned short wError,
|
||||
const char* pszGuildName, const char* pszTempGuildName)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildRelation));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildRelation* lpPktGuildRelation = reinterpret_cast<PktGuildRelation *>(lpBuffer);
|
||||
ZeroMemory(lpPktGuildRelation, sizeof(PktGuildRelation));
|
||||
|
||||
lpPktGuildRelation->m_dwCID = dwCID;
|
||||
lpPktGuildRelation->m_dwGID = dwGID;
|
||||
lpPktGuildRelation->m_dwTargetGID = dwTargetGID;
|
||||
lpPktGuildRelation->m_dwValue = dwValue;
|
||||
lpPktGuildRelation->m_cSubCmd = cSubCmd;
|
||||
|
||||
if (0 != pszGuildName)
|
||||
{
|
||||
strncpy(lpPktGuildRelation->m_szGuildName, pszGuildName, Guild::MAX_GUILD_NAME_LEN);
|
||||
}
|
||||
|
||||
if (0 != pszTempGuildName)
|
||||
{
|
||||
strncpy(lpPktGuildRelation->m_szTempGuildName, pszTempGuildName, Guild::MAX_GUILD_NAME_LEN);
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildRelation), CmdGuildRelation, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharGuildInclination(CSendStream& SendStream, unsigned long dwUID, unsigned char cInclination,
|
||||
unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildInclination));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildInclination* lpPktGuildInclination = reinterpret_cast<PktGuildInclination *>(lpBuffer);
|
||||
|
||||
lpPktGuildInclination->m_dwUID = dwUID;
|
||||
lpPktGuildInclination->m_cInclination = cInclination;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildInclination), CmdGuildInclination, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharGuildRight(CSendStream& SendStream, unsigned long dwGID, GuildRight guildRight, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildRight));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildRight* lpPktGuildRight = reinterpret_cast<PktGuildRight *>(lpBuffer);
|
||||
|
||||
lpPktGuildRight->m_dwUID = dwGID;
|
||||
lpPktGuildRight->m_GuildRight = guildRight;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildRight), CmdGuildRight, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharMyGuildInfo(CSendStream& SendStream, unsigned long dwGold,
|
||||
GuildRight guildRight, unsigned char cTitle, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktMyGuildInfo));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktMyGuildInfo* lpPktMyGuildInfo = reinterpret_cast<PktMyGuildInfo *>(lpBuffer);
|
||||
|
||||
lpPktMyGuildInfo->m_dwGold = dwGold;
|
||||
lpPktMyGuildInfo->m_GuildRight = guildRight;
|
||||
lpPktMyGuildInfo->m_cTitle = cTitle;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktMyGuildInfo), CmdMyGuildInfo, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharGuildSafe(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGID,
|
||||
unsigned long dwSafeGold, unsigned long dwCharGold, unsigned char cCmd,
|
||||
const char* szCharName, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildSafeAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildSafeAck* lpPktGSAck = reinterpret_cast<PktGuildSafeAck *>(lpBuffer);
|
||||
|
||||
lpPktGSAck->m_dwCID = dwCID;
|
||||
lpPktGSAck->m_dwGID = dwGID;
|
||||
lpPktGSAck->m_dwSafeGold = dwSafeGold;
|
||||
lpPktGSAck->m_dwCharGold = dwCharGold;
|
||||
lpPktGSAck->m_cCmd = cCmd;
|
||||
|
||||
strncpy(lpPktGSAck->m_szCharName, szCharName, Guild::MAX_MEMBER_NAME_LEN);
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildSafeAck), CmdGuildSafe, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharUpdateGuildMemberInfo(CSendStream& SendStream, unsigned long dwGID, unsigned long dwCID,
|
||||
MemberInfo memberInfo, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktGuildMemberInfoUpdate));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktGuildMemberInfoUpdate* lpPktGMIU = reinterpret_cast<PktGuildMemberInfoUpdate *>(lpBuffer);
|
||||
|
||||
lpPktGMIU->m_dwGID = dwGID;
|
||||
lpPktGMIU->m_dwCID = dwCID;
|
||||
|
||||
lpPktGMIU->m_MemberListInfo = memberInfo.m_MemberListInfo;
|
||||
lpPktGMIU->m_MemberDetailInfo = memberInfo.m_MemberDetailInfo;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktGuildMemberInfoUpdate), CmdGuildMemberInfoUpdate, 0, wError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharChatBan(CSendStream& SendStream, unsigned long dwAdminCID,
|
||||
unsigned long dwTargetCID, unsigned long dwMinutes)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktChatBan));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktChatBan* lpPktChatBan = reinterpret_cast<PktChatBan *>(lpBuffer);
|
||||
|
||||
lpPktChatBan->m_dwAdminCID = dwAdminCID;
|
||||
lpPktChatBan->m_dwTargetCID = dwTargetCID;
|
||||
lpPktChatBan->m_dwMinutes = dwMinutes;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktChatBan), CmdChatBan, 0, PktBase::NO_SERVER_ERR);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
#ifndef _SEND_CHAR_COMMUNITY_H_
|
||||
#define _SEND_CHAR_COMMUNITY_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CCharacter;
|
||||
class CSendStream;
|
||||
|
||||
struct PktWh;
|
||||
struct AddressInfo;
|
||||
struct TakeType;
|
||||
struct GuildRight;
|
||||
|
||||
namespace Guild
|
||||
{
|
||||
struct MemberInfo;
|
||||
};
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><>ȯ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharExchangeCmd(CSendStream& SendStream, unsigned long dwSenderID_In,
|
||||
unsigned long dwRecverID_In, unsigned char cCmd_In, unsigned short usError_In);
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><>Ƽ Ŀ<>ǵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
bool SendCharPartyCmd(CSendStream& SendStream, unsigned long dwPartyID_In,
|
||||
const AddressInfo &AddressInfo_In, const char* szSenderName_In, unsigned long dwSenderID_In,
|
||||
unsigned long dwReceiverID_In, unsigned short usCmd_In, unsigned short usError_In);
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><>Ƽ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DBAgent<6E><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharPartyCreateToDBAgent(CSendStream& AgentSendStream, unsigned long dwLeaderID, unsigned long dwMemberID, unsigned char cZone,
|
||||
unsigned short wLeaderClass, char cLeaderLevel, unsigned long dwLeaderGID,
|
||||
unsigned short wMemberClass, char cMemberLevel, unsigned long dwMemberGID);
|
||||
|
||||
bool SendCharPartyCreateToDBAgent(CSendStream& AgentSendStream, unsigned long dwLeaderID, unsigned long dwMemberID,
|
||||
unsigned short wLeaderClass, char cLeaderLevel, unsigned short wMemberClass, char cMemberLevel);
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><>Ƽ <20>ı<EFBFBD><C4B1><EFBFBD> DBAgent<6E><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharPartyDestroyToDBAgent(CSendStream& AgentSendStream, unsigned long dwPartyID);
|
||||
|
||||
// <20><>Ƽ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendPartyMemberData(CSendStream& SendStream, unsigned long dwPartyID, unsigned long dwSenderID, unsigned long dwGID,
|
||||
unsigned short wClass, unsigned long dwServerID, char cLevel, const char* strSenderName, unsigned short usCmd);
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharStallRegisterItem(CSendStream& SendStream, unsigned long dwCharID, unsigned long dwShopID,
|
||||
TakeType takeType, unsigned long dwPrice, unsigned char cCmd, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharStallEnter(CSendStream& SendStream, unsigned long dwCustomerID, unsigned long dwOwnerID,
|
||||
unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharStallItemInfo(CSendStream& SendStream, unsigned long dwOwnerID, unsigned long* arylCustomerID,
|
||||
unsigned long dwTempSafe, unsigned char cTax, char* szBuffer, unsigned long dwItemSize, unsigned char cItemNum);
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// ģ<><C4A3> <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD> ack, <20>ź<EFBFBD> <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD> Ack, ģ<><C4A3> <20>α<EFBFBD><CEB1><EFBFBD>, ģ<><C4A3> <20>αƿ<D7BE>
|
||||
bool SendCharFriendAck(CSendStream& SendStream, unsigned char cAckCmd, unsigned long dwCID, const char* szFriendName,
|
||||
unsigned long dwGID, unsigned short wClass, char cLevel, unsigned long dwServerID, unsigned short usError);
|
||||
|
||||
// ģ<><C4A3> <20><><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>
|
||||
bool SendCharFriendAdded(CSendStream& SendStream, unsigned long dwCID, const char* szName);
|
||||
|
||||
// DBAgent<6E><74> ģ<><C4A3> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (ģ<><C4A3> <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>, <20>ź<EFBFBD> <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>, <20><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
bool SendFriendListChangeToDB(CSendStream& AgentSendStream, unsigned long dwUID, unsigned long dwCID, unsigned long dwReferenceUID,
|
||||
unsigned long dwReferenceCID, unsigned long dwData, unsigned long dwGID, unsigned short wClass,
|
||||
char cLevel, unsigned long dwServerID, unsigned char cChangeType);
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharCreateGuild(CSendStream& SendStream, unsigned long dwMasterID, unsigned long dwGuildID,
|
||||
unsigned char cInclination, char* szGuildName, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharGuildCmd(CSendStream& SendStream, unsigned long dwGID, unsigned long dwSenderID, unsigned long dwReceiverID,
|
||||
const char* szGuildName, const char* szSenderName, unsigned short wCmd, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><>ũ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharGuildMark(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGID,
|
||||
char* szMark, unsigned long dwGold, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharGuildLevel(CSendStream& SendStream, unsigned long dwUID, unsigned char cLevel, unsigned long dwGold, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharGuildRelation(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGID,
|
||||
unsigned long dwTargetGID, unsigned long dwValue, unsigned char cSubCmd, unsigned short wError,
|
||||
const char* pszGuildName=NULL, const char* pszTempGuildName=NULL);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharGuildInclination(CSendStream& SendStream, unsigned long dwUID, unsigned char cInclination, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharGuildRight(CSendStream& SendStream, unsigned long dwGID, GuildRight guildRight, unsigned short wError);
|
||||
|
||||
// <20>ڱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharMyGuildInfo(CSendStream& SendStream, unsigned long dwGold, GuildRight guildRight, unsigned char cTitle,
|
||||
unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>ݰ<EFBFBD>
|
||||
bool SendCharGuildSafe(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGID,
|
||||
unsigned long dwSafeGold, unsigned long dwCharGold, unsigned char cCmd, const char* szCharName, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ
|
||||
bool SendCharUpdateGuildMemberInfo(CSendStream& SendStream, unsigned long dwGID, unsigned long dwCID, Guild::MemberInfo memberInfo,
|
||||
unsigned short wError);
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// ä<><C3A4> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharChatBan(CSendStream& SendStream, unsigned long dwAdminCID, unsigned long dwTargetCID, unsigned long dwMinutes);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,244 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Item/Item.h>
|
||||
#include <Item/Container/EquipmentsContainer.h>
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharStatusPacket.h>
|
||||
#include <Network/Packet/PacketStruct/AddressPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharCommunityPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacketStruct.h>
|
||||
#include <Network/Packet/PacketStruct/CharConfigPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharAdminPacket.h>
|
||||
|
||||
#include <Map/FieldMap/Cell.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Network/Dispatch/GameClient/GameClientDispatch.h>
|
||||
#include <Ranking/RankingMgr.h>
|
||||
|
||||
#include "SendCharEtc.h"
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharBindPosition(CCharacter& character, unsigned long dwNPCID,
|
||||
unsigned char cCmd, Position Pos, char cZone, unsigned short usError)
|
||||
{
|
||||
CGameClientDispatch* lpDispatch = 0;
|
||||
|
||||
if(0 != (lpDispatch = character.GetDispatcher()))
|
||||
{
|
||||
CSendStream& SendStream = lpDispatch->GetSendStream();
|
||||
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktBP));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktBP* lpPktBPAck = reinterpret_cast<PktBP*>(lpBuffer);
|
||||
|
||||
lpPktBPAck->m_dwNPCID = dwNPCID;
|
||||
lpPktBPAck->m_cCmd = cCmd;
|
||||
|
||||
lpPktBPAck->m_Pos.fPointX = Pos.m_fPointX;
|
||||
lpPktBPAck->m_Pos.fPointY = Pos.m_fPointY;
|
||||
lpPktBPAck->m_Pos.fPointZ = Pos.m_fPointZ;
|
||||
|
||||
lpPktBPAck->m_cZone = cZone;
|
||||
|
||||
if(SendStream.WrapCrypt(sizeof(PktBP), CmdCharBindPosition, 0, usError))
|
||||
{
|
||||
CCell* lpCell = character.GetCellPos().m_lpCell;
|
||||
|
||||
if(0 == usError && 0 != lpCell && PktBP::BP_RECALL == cCmd)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֺ<EFBFBD><D6BA><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20>Ѹ<EFBFBD>.
|
||||
unsigned long dwCID = character.GetCID();
|
||||
const Position& currentPos = character.GetCurrentPos();
|
||||
|
||||
// edith 2009.03.07 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
CastObject castObject;
|
||||
castObject.m_wTypeID = 0;
|
||||
castObject.m_cObjectType = 200;
|
||||
castObject.m_cObjectLevel = 0;
|
||||
castObject.m_DstPos.fPointX = currentPos.m_fPointX;
|
||||
castObject.m_DstPos.fPointY = currentPos.m_fPointY+0.3f;
|
||||
castObject.m_DstPos.fPointZ = currentPos.m_fPointZ;
|
||||
|
||||
lpCell->SendCastObjectInfo(dwCID, dwCID, castObject);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharHPRegen(CSendStream& SendStream, unsigned long dwCID,
|
||||
unsigned short nNowHP, unsigned short nNowMP)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktHP));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktHP* lpPktHP = reinterpret_cast<PktHP*>(lpBuffer);
|
||||
|
||||
lpPktHP->m_dwCharID = dwCID;
|
||||
lpPktHP->m_sHP = nNowHP;
|
||||
lpPktHP->m_sMP = nNowMP;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktHP), CmdCharHPRegen, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharQuickSlotMove(CSendStream& SendStream,
|
||||
TakeType& takeType, unsigned short wSkillID, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktQSM));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktQSM* lpPktQSM = reinterpret_cast<PktQSM*>(lpBuffer);
|
||||
|
||||
lpPktQSM->m_TakeType = takeType;
|
||||
lpPktQSM->m_usSkillID = wSkillID;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktQSM), CmdCharQuickSlotMove, 0, usError);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharControlOption(CSendStream& SendStream, unsigned long dwCharID, RejectOption& Reject)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCOp));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktCOp* lpPktCOp = reinterpret_cast<PktCOp*>(lpBuffer);
|
||||
|
||||
lpPktCOp->m_dwCharID = dwCharID;
|
||||
lpPktCOp->m_RejectOption = Reject;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCOp), CmdCharControlOption, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharFameInfo(CSendStream& SendStream, CCharacter* lpRequestCharacter,
|
||||
const char* szWinCharName, const char* szLoseCharName,
|
||||
unsigned char cOtherNation, unsigned char cOtherClass,
|
||||
unsigned char cCmd, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktFIAck));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktFIAck* lpPktFIAck = reinterpret_cast<PktFIAck*>(lpBuffer);
|
||||
|
||||
lpPktFIAck->m_dwCharID = lpRequestCharacter->GetCID();
|
||||
|
||||
lpPktFIAck->m_cOtherNation = cOtherNation;
|
||||
lpPktFIAck->m_cOtherClass = cOtherClass;
|
||||
|
||||
lpPktFIAck->m_dwFame = lpRequestCharacter->GetFame();
|
||||
lpPktFIAck->m_dwMileage = lpRequestCharacter->GetMileage();
|
||||
|
||||
lpPktFIAck->m_cRankingByRace =
|
||||
CRankingMgr::GetInstance().GetRank(lpRequestCharacter->GetCharacterName(), 0);
|
||||
lpPktFIAck->m_cRankingByClass =
|
||||
CRankingMgr::GetInstance().GetRank(lpRequestCharacter->GetCharacterName(),
|
||||
static_cast<unsigned char>(lpRequestCharacter->GetClass()));
|
||||
|
||||
lpPktFIAck->m_cCmd = cCmd;
|
||||
|
||||
strncpy(lpPktFIAck->m_szWinCharName, szWinCharName, PktFIAck::MAX_NAME_LEN);
|
||||
strncpy(lpPktFIAck->m_szLoseCharName, szLoseCharName, PktFIAck::MAX_NAME_LEN);
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktFIAck), CmdCharFameInfo, 0, usError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharAuthorizePanel(CSendStream& SendStream, CCharacter* lpCaster, unsigned char cCmd)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktAPAck));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktAPAck* lpPktAPAck = reinterpret_cast<PktAPAck *>(lpBuffer);
|
||||
|
||||
lpPktAPAck->m_dwCasterID = lpCaster->GetCID();
|
||||
strncpy(lpPktAPAck->m_szCasterName, lpCaster->GetCharacterName(), CHAR_INFOST::MAX_NAME_LEN);
|
||||
lpPktAPAck->m_cCmd = cCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktAPAck), CmdCharAuthorizePanel, 0, 0);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendConfigInfoDB(CSendStream& SendStream, CCharacter* lpCharacter)
|
||||
{
|
||||
const int MAX_BUFFER = sizeof(PktConfigInfo) + PktConfigInfo::MAX_BUFFER_SIZE;
|
||||
char szBuffer[MAX_BUFFER];
|
||||
|
||||
PktConfigInfo* lpPktConfigInfo = reinterpret_cast<PktConfigInfo *>(szBuffer);
|
||||
unsigned short wSize = 0;
|
||||
|
||||
lpPktConfigInfo->m_dwUserID = lpCharacter->GetUID();
|
||||
lpPktConfigInfo->m_dwCharID = lpCharacter->GetCID();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DB <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϹǷ<CFB9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (2005-05-31 by <20>ε<EFBFBD>)
|
||||
PeaceModeInfo* lpPeaceModeInfo = reinterpret_cast<PeaceModeInfo *>(szBuffer + sizeof(PktConfigInfo));
|
||||
// *lpPeaceModeInfo = lpCharacter->GetPeaceMode();
|
||||
wSize += sizeof(PeaceModeInfo);
|
||||
|
||||
// <20>ź<EFBFBD> <20>ɼ<EFBFBD>
|
||||
RejectOption* lpRejectOption = reinterpret_cast<RejectOption *>(szBuffer + sizeof(PktConfigInfo) + wSize);
|
||||
*lpRejectOption = lpCharacter->GetRejectOption();
|
||||
wSize += sizeof(RejectOption);
|
||||
|
||||
lpPktConfigInfo->m_wSize = wSize;
|
||||
|
||||
return SendStream.WrapCompress(szBuffer, static_cast<unsigned short>(sizeof(PktConfigInfo) + lpPktConfigInfo->m_wSize),
|
||||
CmdConfigInfoDB, 0, 0);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharEliteBonus(CSendStream& SendStream, char cEliteBonus)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktEB));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktEB* lpPktEB = reinterpret_cast<PktEB*>(lpBuffer);
|
||||
|
||||
lpPktEB->m_cEliteBonus = cEliteBonus;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktEB), CmdEliteBonus, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharAdmin(CSendStream& SendStream, PktAdmin* pPktAdmin, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktAdmin));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktAdmin* lpPktAdmin = reinterpret_cast<PktAdmin*>(lpBuffer);
|
||||
|
||||
memcpy(lpPktAdmin, pPktAdmin, sizeof(PktAdmin));
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktAdmin), CmdCharAdminCmd, 0, wError);
|
||||
}
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> Ư<><C6AF> <20>̺<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendExtraEvent(CSendStream& SendStream, unsigned long dwUserID, unsigned long dwCharID, unsigned long dwEventID, unsigned long dwValue1, unsigned long dwValue2, unsigned short usError)
|
||||
{
|
||||
// edith 2009.09.05 <20>ű<EFBFBD> <20>̺<EFBFBD>Ʈ <20><><EFBFBD>ۺκ<DBBA>
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktExtraEvent));
|
||||
if (NULL == lpBuffer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PktExtraEvent* lpPktEE = reinterpret_cast<PktExtraEvent *>(lpBuffer);
|
||||
|
||||
lpPktEE->m_dwUserID = dwUserID;
|
||||
lpPktEE->m_dwCharID = dwCharID;
|
||||
lpPktEE->m_dwEventID = dwEventID;
|
||||
lpPktEE->m_dwValue1 = dwValue1;
|
||||
lpPktEE->m_dwValue2 = dwValue2;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktExtraEvent), CmdExtraEvent, 0, usError);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef _SEND_CHAR_ETC_H_
|
||||
#define _SEND_CHAR_ETC_H_
|
||||
|
||||
#include <DB/DBdefine.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
class CCharacter;
|
||||
|
||||
struct TakeType;
|
||||
struct RejectOption;
|
||||
struct Position;
|
||||
struct PktAdmin;
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharBindPosition(CCharacter& character, unsigned long dwNPCID,
|
||||
unsigned char cCmd, Position Pos, char cZone, unsigned short usError);
|
||||
|
||||
// HP, MP ȸ<><C8B8>
|
||||
bool SendCharHPRegen(CSendStream& SendStream, unsigned long dwCID,
|
||||
unsigned short nNowHP, unsigned short nNowMP);
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
bool SendCharQuickSlotMove(CSendStream& SendStream, TakeType& takeType, unsigned short wSkillID, unsigned short usError);
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharControlOption(CSendStream& SendStream, unsigned long dwCharID, RejectOption& Reject);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>(<28><><EFBFBD>嵵) <20><><EFBFBD><EFBFBD> <20><>û
|
||||
bool SendCharFameInfo(CSendStream& SendStream, CCharacter* lpRequestCharacter,
|
||||
const char* szWinCharName, const char* szLoseCharName, unsigned char cOtherNation, unsigned char cOtherClass,
|
||||
unsigned char cCmd, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20>dz<EFBFBD>
|
||||
bool SendCharAuthorizePanel(CSendStream& SendStream, CCharacter* lpCaster, unsigned char cCmd);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendConfigInfoDB(CSendStream& SendStream, CCharacter* lpCharacter);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD>ʽ<EFBFBD>
|
||||
bool SendCharEliteBonus(CSendStream& SendStream, char cEliteBonus);
|
||||
|
||||
// <20><EFBFBD><EEBFB5> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharAdmin(CSendStream& SendStream, PktAdmin* pPktAdmin, unsigned short wError);
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> Ư<><C6AF> <20>̺<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
// edith 2009.09.05 <20>ű<EFBFBD> <20>̺<EFBFBD>Ʈ <20><><EFBFBD>ۺκ<DBBA>
|
||||
bool SendExtraEvent(CSendStream& SendStream, unsigned long dwUserID, unsigned long dwCharID, unsigned long dwEventID, unsigned long dwValue1, unsigned long dwValue2, unsigned short usError);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,563 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Item/Item.h>
|
||||
#include <Creature/Character/Character.h>
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
|
||||
#include "SendCharItem.h"
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharTakeItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
TakeType takeType, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktTI));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktTI* lpPktTIAck = reinterpret_cast<PktTI*>(lpBuffer);
|
||||
|
||||
if (0 == usError)
|
||||
{
|
||||
lpPktTIAck->m_dwCharID = dwCharID;
|
||||
lpPktTIAck->m_TakeType = takeType;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPktTIAck->m_dwCharID = 0;
|
||||
lpPktTIAck->m_TakeType = TakeType();
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktTI), CmdCharTakeItem, 0, usError);
|
||||
};
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharSwapItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
TakeType takeSrc, TakeType takeDst, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSwI));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSwI* lpPktSwlAck = reinterpret_cast<PktSwI*>(lpBuffer);
|
||||
|
||||
if (0 == usError)
|
||||
{
|
||||
lpPktSwlAck->m_dwCharID = dwCharID;
|
||||
lpPktSwlAck->m_SwapSrc = takeSrc;
|
||||
lpPktSwlAck->m_SwapDst = takeDst;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPktSwlAck->m_dwCharID = 0;
|
||||
lpPktSwlAck->m_SwapSrc = TakeType();
|
||||
lpPktSwlAck->m_SwapDst = TakeType();
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktSwI), CmdCharSwapItem, 0, usError);
|
||||
};
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharRepairItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwRepairGold, Item::ItemPos itemPos, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktRpI));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktRpI* lpPktRpl = reinterpret_cast<PktRpI*>(lpBuffer);
|
||||
|
||||
lpPktRpl->m_dwCharID = dwCharID;
|
||||
lpPktRpl->m_dwGold = dwRepairGold;
|
||||
lpPktRpl->m_itemPos = itemPos;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktRpI), CmdCharRepairItem, 0, usError);
|
||||
};
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
bool GameClientSendPacket::SendCharRepairAllItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwRepairGold, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktRpAI));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktRpAI* lpPktRpAI = reinterpret_cast<PktRpAI*>(lpBuffer);
|
||||
|
||||
lpPktRpAI->m_dwCharID = dwCharID;
|
||||
lpPktRpAI->m_dwGold = dwRepairGold;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktRpAI), CmdCharRepairAllItem, 0, usError);
|
||||
};
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ij<><C4B3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharUseCashItem(CSendStream& SendStream, unsigned long dwSender,
|
||||
unsigned long dwReceiver, Item::ItemPos itemPos,
|
||||
unsigned char cRemainItemNum, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktUI));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktUI* lpPktUI = reinterpret_cast<PktUI*>(lpBuffer);
|
||||
|
||||
lpPktUI->m_dwSender = dwSender;
|
||||
lpPktUI->m_dwRecver = dwReceiver;
|
||||
lpPktUI->m_itemPos = itemPos;
|
||||
lpPktUI->m_cRemainItemNum = cRemainItemNum;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktUI), CmdCharUseCashItem, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharUseItem(CSendStream& SendStream, unsigned long dwSender,
|
||||
unsigned long dwReceiver, Item::ItemPos itemPos,
|
||||
unsigned char cRemainItemNum, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktUI));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktUI* lpPktUI = reinterpret_cast<PktUI*>(lpBuffer);
|
||||
|
||||
lpPktUI->m_dwSender = dwSender;
|
||||
lpPktUI->m_dwRecver = dwReceiver;
|
||||
lpPktUI->m_itemPos = itemPos;
|
||||
lpPktUI->m_cRemainItemNum = cRemainItemNum;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktUI), CmdCharUseItem, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharTradeItem(CSendStream& SendStream, CCharacter* lpCharacter, unsigned long dwNPCID, Item::ItemPos CouponPos,
|
||||
Item::CItem* lpItem, Item::ItemPos itemPos, unsigned char cNum, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktTrAck) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktTrAck* lpPktTrAck = reinterpret_cast<PktTrAck*>(lpBuffer);
|
||||
|
||||
size_t nItemSize = 0;
|
||||
if (PktBase::NO_SERVER_ERR == usError)
|
||||
{
|
||||
lpPktTrAck->m_dwCharID = lpCharacter->GetCID();
|
||||
lpPktTrAck->m_dwNPCID = dwNPCID;
|
||||
|
||||
lpPktTrAck->m_dwGold = lpCharacter->GetGold();
|
||||
lpPktTrAck->m_dwMileage = lpCharacter->GetMileage();
|
||||
|
||||
lpPktTrAck->m_CouponPos = CouponPos;
|
||||
|
||||
if (NULL != lpItem)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
if (false == lpItem->SerializeOut(lpBuffer + sizeof(PktTrAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", lpCharacter->GetCID());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nItemSize = 0;
|
||||
}
|
||||
|
||||
lpPktTrAck->m_wSize = static_cast<unsigned short>(nItemSize);
|
||||
lpPktTrAck->m_itemPos = itemPos;
|
||||
lpPktTrAck->m_cNum = cNum;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPktTrAck->m_dwCharID = 0;
|
||||
lpPktTrAck->m_dwNPCID = 0;
|
||||
lpPktTrAck->m_dwGold = 0;
|
||||
lpPktTrAck->m_CouponPos = Item::ItemPos();
|
||||
|
||||
lpPktTrAck->m_wSize = 0;
|
||||
lpPktTrAck->m_itemPos = Item::ItemPos();
|
||||
lpPktTrAck->m_cNum = 0;
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktTrAck) + nItemSize),
|
||||
CmdCharTradeItem, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharEquipShopInfo(CSendStream& SendStream, unsigned long dwCID, unsigned long dwNPCID, unsigned long dwTime,
|
||||
unsigned char cRace, unsigned char cTabPage, unsigned char cNum,
|
||||
unsigned short* aryItemID, unsigned char* aryItemGrade, unsigned short usError)
|
||||
{
|
||||
const int nBufferSize = sizeof(PktEquipShopInfo) + (sizeof(unsigned short) + sizeof(unsigned char)) * cNum;
|
||||
char* lpBuffer = SendStream.GetBuffer(nBufferSize);
|
||||
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktEquipShopInfo* lpPktEquipShopInfo = reinterpret_cast<PktEquipShopInfo *>(lpBuffer);
|
||||
|
||||
lpPktEquipShopInfo->m_dwCharID = dwCID;
|
||||
lpPktEquipShopInfo->m_dwNPCID = dwNPCID;
|
||||
|
||||
lpPktEquipShopInfo->m_dwTime = dwTime;
|
||||
|
||||
lpPktEquipShopInfo->m_cRace = cRace;
|
||||
lpPktEquipShopInfo->m_cTabPage = cTabPage;
|
||||
|
||||
lpPktEquipShopInfo->m_cNum = cNum;
|
||||
|
||||
unsigned short* lpItemID = reinterpret_cast<unsigned short *>(lpPktEquipShopInfo + 1);
|
||||
for (unsigned char cIDIndex = 0; cIDIndex < cNum; ++cIDIndex)
|
||||
{
|
||||
*lpItemID = aryItemID[cIDIndex];
|
||||
++lpItemID;
|
||||
}
|
||||
|
||||
unsigned char* lpItemGrade = reinterpret_cast<unsigned char *>(lpItemID);
|
||||
for (unsigned char cGradeIndex = 0; cGradeIndex < cNum; ++cGradeIndex)
|
||||
{
|
||||
*lpItemGrade = aryItemGrade[cGradeIndex];
|
||||
++lpItemGrade;
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(nBufferSize, CmdCharEquipShopInfo, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharPickUp(CSendStream& SendStream, unsigned long dwCID, unsigned __int64 nObjectID,
|
||||
unsigned long dwGold, Item::CItem* lpItem, Item::ItemPos dstPos,
|
||||
unsigned char cNum, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktPUAck) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktPUAck* lpPktPUAck = reinterpret_cast<PktPUAck*>(lpBuffer);
|
||||
size_t nItemSize = 0;
|
||||
|
||||
lpPktPUAck->m_cType = 0;
|
||||
lpPktPUAck->m_dwSize = 0;
|
||||
|
||||
if (0 == usError)
|
||||
{
|
||||
if (0 != dwGold)
|
||||
{
|
||||
lpPktPUAck->m_cType = PktPUAck::Gold;
|
||||
lpPktPUAck->m_dwSize = dwGold;
|
||||
}
|
||||
else if (NULL != lpItem)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
if (!lpItem->SerializeOut(lpBuffer + sizeof(PktPUAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCID);
|
||||
}
|
||||
|
||||
lpPktPUAck->m_cType = PktPUAck::Item;
|
||||
lpPktPUAck->m_dwSize = static_cast<unsigned long>(nItemSize);
|
||||
}
|
||||
}
|
||||
|
||||
lpPktPUAck->m_dwCharID = dwCID;
|
||||
lpPktPUAck->m_nObjectID = nObjectID;
|
||||
lpPktPUAck->m_itemPos = dstPos;
|
||||
lpPktPUAck->m_cNum = cNum;
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktPUAck) + nItemSize),
|
||||
CmdCharPickUp, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharAutoRouting(CSendStream& SendStream, unsigned long dwCID, unsigned __int64 nObjectID,
|
||||
unsigned short wItemID, unsigned char cNum, unsigned char cCmd)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktAutoRouting));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktAutoRouting* lpPktAR = reinterpret_cast<PktAutoRouting *>(lpBuffer);
|
||||
|
||||
lpPktAR->m_dwCharID = dwCID;
|
||||
lpPktAR->m_nObjectID = nObjectID;
|
||||
|
||||
lpPktAR->m_wItemID = wItemID;
|
||||
lpPktAR->m_cNum = cNum;
|
||||
|
||||
lpPktAR->m_cCmd = cCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktAutoRouting), CmdCharAutoRouting, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharPullDown(CSendStream& SendStream, unsigned long dwCID, Item::ItemPos itemPos,
|
||||
CCell::ItemInfo& itemInfo, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktPDAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktPDAck* lpPktPDAck = reinterpret_cast<PktPDAck*>(lpBuffer);
|
||||
itemInfo.MakeFieldObject(lpPktPDAck->m_FieldObject);
|
||||
|
||||
if (0 == usError)
|
||||
{
|
||||
lpPktPDAck->m_dwCharID = dwCID;
|
||||
lpPktPDAck->m_itemPos = itemPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPktPDAck->m_dwCharID = 0;
|
||||
lpPktPDAck->m_itemPos = Item::ItemPos();
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktPDAck), CmdCharPullDown, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharDisappearItem(CSendStream& SendStream, unsigned long dwCID,
|
||||
Item::ItemPos itemPos, unsigned char cNum,
|
||||
unsigned char cCmd, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktDisappearItem));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktDisappearItem* lpPktDI = reinterpret_cast<PktDisappearItem*>(lpBuffer);
|
||||
|
||||
lpPktDI->m_dwCharID = dwCID;
|
||||
lpPktDI->m_itemPos = itemPos;
|
||||
lpPktDI->m_cNum = cNum;
|
||||
lpPktDI->m_cCmd = cCmd;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktDisappearItem), CmdCharDisappearItem, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharSplitItem(CSendStream& SendStream, unsigned long dwCID,
|
||||
Item::CItem* lpSplitItem, TakeType takeType, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSpItAck) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSpItAck* lpPktSpltAck = reinterpret_cast<PktSpItAck*>(lpBuffer);
|
||||
|
||||
size_t nItemSize = 0;
|
||||
if (NULL != lpSplitItem)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
if (!lpSplitItem->SerializeOut(lpBuffer + sizeof(PktSpItAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCID);
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == usError)
|
||||
{
|
||||
lpPktSpltAck->m_dwCharID = dwCID;
|
||||
lpPktSpltAck->m_TakeType = takeType;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPktSpltAck->m_dwCharID = 0;
|
||||
lpPktSpltAck->m_TakeType = TakeType();
|
||||
}
|
||||
|
||||
lpPktSpltAck->m_cSize = static_cast<unsigned char>(nItemSize);
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktSpItAck) + nItemSize),
|
||||
CmdCharSplitItem, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharTakeGold(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGold,
|
||||
unsigned char cSrcPos, unsigned char cDstPos, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktTG));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktTG* lpPktTG = reinterpret_cast<PktTG*>(lpBuffer);
|
||||
|
||||
if (0 == usError)
|
||||
{
|
||||
lpPktTG->m_dwCharID = dwCID;
|
||||
lpPktTG->m_dwGold = dwGold;
|
||||
lpPktTG->m_cSrcPos = cSrcPos;
|
||||
lpPktTG->m_cDstPos = cDstPos;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPktTG->m_dwCharID = 0;
|
||||
lpPktTG->m_dwGold = 0;
|
||||
lpPktTG->m_cSrcPos = 0;
|
||||
lpPktTG->m_cDstPos = 0;
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktTG), CmdCharTakeGold, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharExchangeItem(CSendStream& SendStream, unsigned long dwOwnerCID, unsigned long dwGold,
|
||||
Item::CItem* lpItem, Item::ItemPos itemPos, bool bStack, bool bRemove)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktExI) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktExI* lpPktExI = reinterpret_cast<PktExI*>(lpBuffer);
|
||||
size_t nItemSize = 0;
|
||||
|
||||
unsigned short usError = 0;
|
||||
|
||||
if (NULL == lpItem)
|
||||
{
|
||||
lpPktExI->m_cType = PktExI::Gold;
|
||||
lpPktExI->m_dwSize = dwGold;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (false == bStack)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
|
||||
char* lpItemBuffer = lpBuffer + sizeof(PktExI);
|
||||
if (!lpItem->SerializeOut(lpItemBuffer, nItemSize))
|
||||
{
|
||||
usError = 1;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwOwnerCID);
|
||||
}
|
||||
|
||||
lpPktExI->m_dwSize = static_cast<unsigned long>(nItemSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
lpPktExI->m_dwSize = 0;
|
||||
lpPktExI->m_cNum = lpItem->GetNumOrDurability();
|
||||
}
|
||||
|
||||
lpPktExI->m_cType = bRemove ? PktExI::Remove : PktExI::Item;
|
||||
}
|
||||
|
||||
lpPktExI->m_dwCharID = dwOwnerCID;
|
||||
lpPktExI->m_itemPos = itemPos;
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktExI) + nItemSize),
|
||||
CmdCharExchangeItem, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ŀ<>ǵ<EFBFBD>(Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ)
|
||||
bool GameClientSendPacket::SendCharDepositCmd(CSendStream& SendStream, unsigned char cCmd,
|
||||
char* szData, size_t nDataLength, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktDeposit));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktDeposit* lpPktDeposit = reinterpret_cast<PktDeposit*>(lpBuffer);
|
||||
|
||||
lpPktDeposit->m_cCmd = cCmd;
|
||||
memcpy(lpPktDeposit->m_szData, szData,
|
||||
(PktDeposit::MIN_DATA_SIZE < nDataLength) ? PktDeposit::MIN_DATA_SIZE : nDataLength);
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktDeposit), CmdDeposit, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ(<28>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
bool GameClientSendPacket::SendCharDepositPasswordToDBAgent(CSendStream& SendStream, unsigned long dwUID,
|
||||
const char* szPassword, size_t nPasswordLen)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktDeposit));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktDeposit* lpPktDeposit = reinterpret_cast<PktDeposit*>(lpBuffer);
|
||||
|
||||
lpPktDeposit->m_cCmd = PktDeposit::PASSWORD;
|
||||
|
||||
memcpy(lpPktDeposit->m_szData, &dwUID, sizeof(dwUID));
|
||||
memcpy(lpPktDeposit->m_szData + sizeof(dwUID), szPassword,
|
||||
(Deposit::PASSWORD_LENGTH < nPasswordLen) ? Deposit::PASSWORD_LENGTH : nPasswordLen);
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktDeposit), CmdDeposit, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ(Gold)
|
||||
bool GameClientSendPacket::SendCharDepositGoldToDBAgent(CSendStream& SendStream, unsigned long dwUID, unsigned long dwGold)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktDeposit));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktDeposit* lpPktDeposit = reinterpret_cast<PktDeposit*>(lpBuffer);
|
||||
|
||||
lpPktDeposit->m_cCmd = PktDeposit::GOLD;
|
||||
|
||||
memcpy(lpPktDeposit->m_szData, &dwUID, sizeof(dwUID));
|
||||
memcpy(lpPktDeposit->m_szData + sizeof(dwUID), &dwGold, sizeof(dwGold));
|
||||
|
||||
return SendStream.WrapHeader(sizeof(PktDeposit), CmdDeposit, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendCharLotteryResult(CSendStream& SendStream, unsigned long dwCID,
|
||||
Item::ItemPos itemPos, Item::CItem* lpItem, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktLotteryResult) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktLotteryResult* lpPktLR = reinterpret_cast<PktLotteryResult *>(lpBuffer);
|
||||
|
||||
lpPktLR->m_dwCharID = dwCID;
|
||||
lpPktLR->m_itemPos = itemPos;
|
||||
|
||||
size_t nItemSize = 0;
|
||||
|
||||
if (NULL != lpItem)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
|
||||
char* lpItemBuffer = lpBuffer + sizeof(PktLotteryResult);
|
||||
if (false == lpItem->SerializeOut(lpItemBuffer, nItemSize))
|
||||
{
|
||||
usError = PktLotteryResult::SERVER_ERROR;
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCID);
|
||||
}
|
||||
lpPktLR->m_dwSize = static_cast<unsigned long>(nItemSize);
|
||||
}
|
||||
|
||||
return SendStream.WrapHeader(static_cast<unsigned short>(sizeof(PktLotteryResult) + nItemSize),
|
||||
CmdCharLotteryResult, 0, usError);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef _SEND_CHAR_ITEM_H_
|
||||
#define _SEND_CHAR_ITEM_H_
|
||||
|
||||
#include <Map/FieldMap/Cell.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacket.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
class CCharacter;
|
||||
|
||||
namespace Item
|
||||
{
|
||||
class CItem;
|
||||
}
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
||||
bool SendCharTakeItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
TakeType takeType, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharSwapItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
TakeType takeSrc, TakeType takeDst, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharRepairItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwRepairGold, Item::ItemPos itemPos, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
bool SendCharRepairAllItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwRepairGold, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharUseItem(CSendStream& SendStream, unsigned long dwSender, unsigned long dwReceiver,
|
||||
Item::ItemPos itemPos, unsigned char cRemainItemNum, unsigned short usError);
|
||||
|
||||
// ij<><C4B3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharUseCashItem(CSendStream& SendStream, unsigned long dwSender, unsigned long dwReceiver,
|
||||
Item::ItemPos itemPos, unsigned char cRemainItemNum, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ȱ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharTradeItem(CSendStream& SendStream, CCharacter* lpCharacter, unsigned long dwNPCID, Item::ItemPos CouponPos,
|
||||
Item::CItem* lpItem, Item::ItemPos itemPos, unsigned char cNum, unsigned short usError);
|
||||
|
||||
// NPC <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharEquipShopInfo(CSendStream& SendStream, unsigned long dwCID, unsigned long dwNPCID, unsigned long dwTime,
|
||||
unsigned char cRace, unsigned char cTabPage, unsigned char cNum,
|
||||
unsigned short* aryItemID, unsigned char* aryItemGrade, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharPickUp(CSendStream& SendStream, unsigned long dwCID, unsigned __int64 nObjectID,
|
||||
unsigned long dwGold, Item::CItem* lpItem, Item::ItemPos dstPos, unsigned char cNum, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharAutoRouting(CSendStream& SendStream, unsigned long dwCID, unsigned __int64 nObjectID,
|
||||
unsigned short wItemID, unsigned char cNum, unsigned char cCmd);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharPullDown(CSendStream& SendStream, unsigned long dwCID, Item::ItemPos itemPos,
|
||||
CCell::ItemInfo& itemInfo, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharDisappearItem(CSendStream& SendStream, unsigned long dwCID, Item::ItemPos itemPos,
|
||||
unsigned char cNum, unsigned char cCmd, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharSplitItem(CSendStream& SendStream, unsigned long dwCID,
|
||||
Item::CItem* lpSplitItem, TakeType takeType, unsigned short usError);
|
||||
|
||||
// <20><> <20>ű<EFBFBD><C5B1><EFBFBD>
|
||||
bool SendCharTakeGold(CSendStream& SendStream, unsigned long dwCID, unsigned long dwGold,
|
||||
unsigned char cSrcPos, unsigned char cDstPos, unsigned short usError);
|
||||
|
||||
// <20><>ȯ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֱ<EFBFBD>
|
||||
bool SendCharExchangeItem(CSendStream& SendStream, unsigned long dwOwnerCID, unsigned long dwGold,
|
||||
Item::CItem* lpItem, Item::ItemPos itemPos, bool bStack, bool bRemove);
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ Ŀ<>ǵ<EFBFBD>.
|
||||
bool SendCharDepositCmd(CSendStream& SendStream, unsigned char cCmd,
|
||||
char* szData, size_t nDataLength, unsigned short usError);
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ(<28>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
bool SendCharDepositPasswordToDBAgent(CSendStream& SendStream, unsigned long dwUID,
|
||||
const char* szPassword, size_t nPasswordLen);
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ(Gold)
|
||||
bool SendCharDepositGoldToDBAgent(CSendStream& SendStream, unsigned long dwUID, unsigned long dwGold);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharLotteryResult(CSendStream& SendStream, unsigned long CID,
|
||||
Item::ItemPos itemPos, Item::CItem* lpItem, unsigned short usError);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,138 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "SendCharLevelUp.h"
|
||||
|
||||
#include <DB/DBDefine.h>
|
||||
#include <Creature/Character/CharacterStructure.h>
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharStatusPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharClassUpgrade(CSendStream& SendStream, unsigned long dwCharID, CharacterDBData& DBData, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCUAck));
|
||||
if (NULL == lpBuffer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PktCUAck* lpPktCUAck = reinterpret_cast<PktCUAck*>(lpBuffer);
|
||||
|
||||
lpPktCUAck->m_dwCharID = dwCharID;
|
||||
|
||||
lpPktCUAck->m_cClass = static_cast<unsigned char>(DBData.m_Info.Class);
|
||||
lpPktCUAck->m_cLevel = static_cast<unsigned char>(DBData.m_Info.Level);
|
||||
lpPktCUAck->m_dwFame = DBData.m_Info.Fame;
|
||||
|
||||
lpPktCUAck->m_State.m_wIP = DBData.m_Info.IP;
|
||||
lpPktCUAck->m_State.m_wSTR = DBData.m_Info.STR;
|
||||
lpPktCUAck->m_State.m_wDEX = DBData.m_Info.DEX;
|
||||
lpPktCUAck->m_State.m_wCON = DBData.m_Info.CON;
|
||||
lpPktCUAck->m_State.m_wINT = DBData.m_Info.INT;
|
||||
lpPktCUAck->m_State.m_wWIS = DBData.m_Info.WIS;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCUAck), CmdCharClassUpgrade, 0, usError);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharIncreasePoint(CSendStream& SendStream, unsigned long dwCharID, ChState State, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktIPAck));
|
||||
if (NULL == lpBuffer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PktIPAck* lpPktIPAck = reinterpret_cast<PktIPAck*>(lpBuffer);
|
||||
|
||||
lpPktIPAck->m_dwCharID = dwCharID;
|
||||
lpPktIPAck->m_State = State;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktIPAck), CmdCharIncreasePoint, 0, usError);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharLevelUp(CSendStream& SendStream, unsigned long dwCharID, CharacterDBData& DBData)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktLU));
|
||||
if (NULL == lpBuffer)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><EFBFBD><DEB8><EFBFBD> <20>Ҵ翡 <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
return false;
|
||||
}
|
||||
|
||||
PktLU* lpPktLU = reinterpret_cast<PktLU*>(lpBuffer);
|
||||
|
||||
lpPktLU->m_dwCharID = dwCharID;
|
||||
lpPktLU->m_cLevel = DBData.m_Info.Level;
|
||||
|
||||
lpPktLU->m_State.m_wIP = DBData.m_Info.IP;
|
||||
lpPktLU->m_State.m_wSTR = DBData.m_Info.STR;
|
||||
lpPktLU->m_State.m_wDEX = DBData.m_Info.DEX;
|
||||
lpPktLU->m_State.m_wCON = DBData.m_Info.CON;
|
||||
lpPktLU->m_State.m_wINT = DBData.m_Info.INT;
|
||||
lpPktLU->m_State.m_wWIS = DBData.m_Info.WIS;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktLU), CmdCharLevelUp, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharAward(CSendStream& SendStream, unsigned long dwCharID, unsigned long dwExp)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktAw));
|
||||
if (NULL == lpBuffer)
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><EFBFBD><DEB8><EFBFBD> <20>Ҵ翡 <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
return false;
|
||||
}
|
||||
|
||||
PktAw* lpPktAw = reinterpret_cast<PktAw*>(lpBuffer);
|
||||
|
||||
lpPktAw->m_dwCharID = dwCharID;
|
||||
lpPktAw->m_dwExp = dwExp;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktAw), CmdCharAward, 0, 0);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharStateRedistribution(CSendStream& SendStream, unsigned long dwCharID,
|
||||
const ChState& state, const SKILL& skill, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSRAck));
|
||||
if (NULL == lpBuffer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PktSRAck* lpPktSRAck = reinterpret_cast<PktSRAck *>(lpBuffer);
|
||||
|
||||
lpPktSRAck->m_State = state;
|
||||
lpPktSRAck->m_Skill = skill;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktSRAck), CmdCharStateRedistribution, 0, usError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharStatusRetrain(CSendStream& SendStream, unsigned long dwCharID, CharacterDBData& DBData,
|
||||
Item::ItemPos InvenPos, unsigned long dwGold, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSRTAck));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktSRTAck* lpPktSRTAck = reinterpret_cast<PktSRTAck*>(lpBuffer);
|
||||
|
||||
lpPktSRTAck->m_State.m_wIP = DBData.m_Info.IP;
|
||||
lpPktSRTAck->m_State.m_wSTR = DBData.m_Info.STR;
|
||||
lpPktSRTAck->m_State.m_wDEX = DBData.m_Info.DEX;
|
||||
lpPktSRTAck->m_State.m_wCON = DBData.m_Info.CON;
|
||||
lpPktSRTAck->m_State.m_wINT = DBData.m_Info.INT;
|
||||
lpPktSRTAck->m_State.m_wWIS = DBData.m_Info.WIS;
|
||||
|
||||
lpPktSRTAck->m_Skill = DBData.m_Skill;
|
||||
|
||||
lpPktSRTAck->m_ItemPos = InvenPos;
|
||||
lpPktSRTAck->m_dwGold = dwGold;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktSRTAck), CmdCharStatusRetrain, 0, usError);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#ifndef _SEND_CHAR_LEVELUP_H_
|
||||
#define _SEND_CHAR_LEVELUP_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
|
||||
struct ChState;
|
||||
struct CharacterDBData;
|
||||
struct SKILL;
|
||||
|
||||
namespace Item
|
||||
{
|
||||
struct ItemPos;
|
||||
}
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
bool SendCharClassUpgrade(CSendStream& SendStream, unsigned long dwCharID,
|
||||
CharacterDBData& DBData, unsigned short usError);
|
||||
|
||||
// IP <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharIncreasePoint(CSendStream& SendStream, unsigned long dwCharID,
|
||||
ChState State, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharLevelUp(CSendStream& SendStream, unsigned long dwCharID,
|
||||
CharacterDBData& DBData);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool SendCharAward(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwExp);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD>й<EFBFBD> (Ŭ<><C5AC><EFBFBD><EFBFBD> ó<><C3B3> <20><><EFBFBD>·<EFBFBD>)
|
||||
bool SendCharStateRedistribution(CSendStream& SendStream, unsigned long dwCharID,
|
||||
const ChState& state, const SKILL& skill, unsigned short usError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD> <20><><EFBFBD>Ʒ<EFBFBD>
|
||||
bool SendCharStatusRetrain(CSendStream& SendStream, unsigned long dwCharID, CharacterDBData& DBData,
|
||||
Item::ItemPos InvenPos, unsigned long dwGold, unsigned short usError);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,314 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Log/LogCommands.h>
|
||||
#include <Log/CharacterLog.h>
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/WrapPacket.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/ChatPacket.h>
|
||||
#include <Network/Packet/PacketStruct/ServerPacket.h>
|
||||
#include <Network/Packet/PacketStruct/CharLoginOutPacket.h>
|
||||
#include <Network/Dispatch/GameLog/SendLogPacket.h>
|
||||
#include <Network/Dispatch/Chat/ChatDispatch.h>
|
||||
|
||||
#include <Creature/Character/Character.h>
|
||||
#include <Creature/CreatureManager.h>
|
||||
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <Item/ItemFactory.h>
|
||||
|
||||
#include <Community/Guild/Guild.h>
|
||||
#include <Community/Guild/GuildMgr.h>
|
||||
#include "SendCharLoginOut.h"
|
||||
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharLogin(CSendStream& SendStream, CCharacter* lpCharacter,
|
||||
const SOCKADDR_IN* lpSockAddr_In, unsigned short usError)
|
||||
{
|
||||
int nTotalSize = sizeof(PktCLiAck) + DBUpdateData::MAX_DBUPDATE_SIZE;
|
||||
char szCharInfo[sizeof(PktCLiAck) + DBUpdateData::MAX_DBUPDATE_SIZE] = { 0, };
|
||||
char* lpCharacterInfo = szCharInfo + sizeof(PktCLiAck);
|
||||
CHAR_INFOST* lpTempCharInfo = reinterpret_cast<CHAR_INFOST*>(lpCharacterInfo);
|
||||
|
||||
unsigned long dwUID = 0;
|
||||
unsigned long dwCID = 0;
|
||||
bool bPeaceMode = false;
|
||||
bool bCheckRelation = false;
|
||||
|
||||
PktCLiAck* lpPktCLiAck = reinterpret_cast<PktCLiAck*>(szCharInfo);
|
||||
memset(lpPktCLiAck, 0, sizeof(PktCLiAck));
|
||||
|
||||
if (NULL != lpCharacter && 0 == usError)
|
||||
{
|
||||
if (!lpCharacter->GetCharacterInfo(lpCharacterInfo, &nTotalSize, lpPktCLiAck->m_usUpdate))
|
||||
{
|
||||
ERRLOG0(g_Log, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>. Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.");
|
||||
usError = 2;
|
||||
}
|
||||
|
||||
Guild::CGuild* lpGuild = Guild::CGuildMgr::GetInstance().GetGuild( lpCharacter->GetGID() ) ;
|
||||
if ( lpGuild && Guild::JOIN_WAIT == lpGuild->GetTitle( lpCharacter->GetCID() ) )
|
||||
{
|
||||
lpTempCharInfo->GID |= Guild::MEMBER_WAIT_BIT;
|
||||
}
|
||||
|
||||
CServerSetup& serverSetup = CServerSetup::GetInstance();
|
||||
|
||||
memset(&lpPktCLiAck->m_GameServerUDPAddr, 0, sizeof(lpPktCLiAck->m_GameServerUDPAddr));
|
||||
memset(&lpPktCLiAck->m_ChatServerTCPAddr, 0, sizeof(lpPktCLiAck->m_ChatServerTCPAddr));
|
||||
|
||||
lpPktCLiAck->m_dwUID = dwUID = lpCharacter->GetUID();
|
||||
lpPktCLiAck->m_dwServerID = CServerSetup::GetInstance().GetServerID();
|
||||
lpPktCLiAck->m_bPeaceMode = bPeaceMode = lpCharacter->IsPeaceMode();
|
||||
lpPktCLiAck->m_cNameChangeCount = lpCharacter->GetNameChangeCount();
|
||||
lpPktCLiAck->m_cGuildWarFlag = lpCharacter->GetGuildWarFlag();
|
||||
lpPktCLiAck->m_cRealmWarFlag = lpCharacter->GetRealmWarFlag();
|
||||
lpPktCLiAck->m_cAdminFlag = lpCharacter->GetGMModelFlag();
|
||||
lpPktCLiAck->m_cRealmPoint = lpCharacter->GetRealmPoint();
|
||||
lpPktCLiAck->m_cTacticsFlag = lpCharacter->GetTacticsFlag();
|
||||
lpPktCLiAck->m_PlayTime = lpCharacter->GetPlayTime();
|
||||
lpPktCLiAck->m_PremiumTime = lpCharacter->GetPremiumTime();
|
||||
lpPktCLiAck->m_PremiumType = lpCharacter->GetPremiumType();
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ͽ<EFBFBD> <20><> <20>и<EFBFBD><D0B8>ʰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
|
||||
time_t timeNow, timeStandard;
|
||||
|
||||
time(&timeNow);
|
||||
tm* tmNow = localtime(&timeNow);
|
||||
|
||||
tmNow->tm_hour = tmNow->tm_min = tmNow->tm_sec = 0;
|
||||
timeStandard = mktime(tmNow);
|
||||
|
||||
lpPktCLiAck->m_dwServerTime = static_cast<unsigned long>(timeNow - timeStandard) * 1000;
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
lpPktCLiAck->m_bCheckRelation = false;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(0 == usError)
|
||||
{
|
||||
usError = 1;
|
||||
}
|
||||
|
||||
nTotalSize = 0;
|
||||
std::fill_n(lpPktCLiAck->m_usUpdate, int(DBUpdateData::MAX_UPDATE_DB), 0);
|
||||
}
|
||||
|
||||
if(0 == usError)
|
||||
{
|
||||
// <20>α<EFBFBD><CEB1><EFBFBD> <20>α<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
GAMELOG::LogCharLoginOut(dwUID, lpCharacter, lpSockAddr_In, lpCharacterInfo, nTotalSize,
|
||||
lpPktCLiAck->m_usUpdate, GAMELOG::CMD::CHAR_LOGIN, usError);
|
||||
}
|
||||
|
||||
// <20>α<EFBFBD> DB<44><42> <20>α<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
// SendLogPacket::CharLogin(*lpCharacter);
|
||||
|
||||
if (SendStream.WrapCompress(szCharInfo, static_cast<unsigned short>(sizeof(PktCLiAck) + nTotalSize),
|
||||
CmdCharLogin, 0, usError))
|
||||
{
|
||||
if (NULL != lpCharacter && 0 == usError)
|
||||
{
|
||||
CFriendList& friendList = lpCharacter->GetFriendList();
|
||||
CBanList& banList = lpCharacter->GetBanList();
|
||||
|
||||
dwUID = lpCharacter->GetUID();
|
||||
dwCID = lpCharacter->GetCID();
|
||||
|
||||
GET_SINGLE_DISPATCH(lpChatDispatch, CChatDispatch,
|
||||
CChatDispatch::GetDispatchTable());
|
||||
|
||||
if(0 != lpChatDispatch)
|
||||
{
|
||||
// ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
lpCharacter->GetSerializeData().SendChatLogin(*lpCharacter);
|
||||
|
||||
CSendStream& chatSendStream = lpChatDispatch->GetSendStream();
|
||||
|
||||
CCommunityListSend sendFriendList(friendList);
|
||||
CCommunityListSend sendBanList(banList);
|
||||
|
||||
unsigned long dwGID = lpCharacter->GetGID();
|
||||
unsigned short wClass = lpCharacter->GetClass();
|
||||
char cLevel = lpCharacter->GetLevel();
|
||||
unsigned long dwServerID = CServerSetup::GetInstance().GetServerID();
|
||||
|
||||
// ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ź<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ش<EFBFBD>.
|
||||
if(!sendBanList.Send(dwUID, dwCID, dwGID, wClass, cLevel, dwServerID, chatSendStream))
|
||||
{
|
||||
ERRLOG2(g_Log, "UID:%d/CID:%d/ <20>ź<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwUID, dwCID);
|
||||
}
|
||||
|
||||
// ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ģ<><C4A3> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ش<EFBFBD>.
|
||||
if(!sendFriendList.Send(dwUID, dwCID, dwGID, wClass, cLevel, dwServerID, chatSendStream))
|
||||
{
|
||||
ERRLOG2(g_Log, "UID:%d/CID:%d/ ģ<><C4A3> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwUID, dwCID);
|
||||
}
|
||||
}
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD>Ѵ<EFBFBD>.
|
||||
return lpCharacter->GetDeposit().ClientUpdate(SendStream);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharMoveZone(CSendStream& SendStream, unsigned short* lpChannelNums,
|
||||
unsigned char cChannelNum, unsigned char cZone, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSZMvAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSZMvAck* lpPktSZMvAck = reinterpret_cast<PktSZMvAck*>(lpBuffer);
|
||||
|
||||
lpPktSZMvAck->m_cZone = cZone;
|
||||
|
||||
if (NULL != lpChannelNums)
|
||||
{
|
||||
unsigned short* lpSrcPastEnd = lpChannelNums +
|
||||
std::min(cChannelNum, (unsigned char)PktSZMvAck::MAX_CHANNEL_NUM);
|
||||
std::copy(lpChannelNums, lpSrcPastEnd, lpPktSZMvAck->m_wChannelNum);
|
||||
}
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktSZMvAck), CmdCharMoveZone, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendServerZone(CSendStream& SendStream, unsigned long dwServerID,
|
||||
const sockaddr_in& gameServerTCPAddress, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSZAck));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSZAck* lpPktSZAck = reinterpret_cast<PktSZAck*>(lpBuffer);
|
||||
|
||||
lpPktSZAck->m_dwServerID = dwServerID;
|
||||
lpPktSZAck->m_GameServerTCPAddr = gameServerTCPAddress;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktSZAck), CmdServerZone, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCSAuth(CSendStream& SendStream, unsigned long dwCID,
|
||||
unsigned long dwAuthCode, const _GG_AUTH_DATA* lpAuthCode2, unsigned short usError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCSAuth));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktCSAuth* lpPktCSAuth = reinterpret_cast<PktCSAuth *>(lpBuffer);
|
||||
|
||||
lpPktCSAuth->m_dwCharID = dwCID;
|
||||
lpPktCSAuth->m_dwAuthCode = dwAuthCode;
|
||||
lpPktCSAuth->m_AuthCode2 = *lpAuthCode2;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCSAuth), CmdCSAuth, 0, usError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// DBAgent<6E><74> <20><><EFBFBD><EFBFBD>
|
||||
bool GameClientSendPacket::SendLoginToDBAgent(CSendStream& AgentSendStream,
|
||||
unsigned long dwRequestKey, unsigned long dwSessionID,
|
||||
unsigned long dwUserID, unsigned long dwCharID,
|
||||
const IN_ADDR remoteAddress)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktDBUpdate));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktDBUpdate* lpPktDBUpdate = reinterpret_cast<PktDBUpdate*>(lpBuffer);
|
||||
memset(lpPktDBUpdate, 0, sizeof(PktDBUpdate));
|
||||
|
||||
lpPktDBUpdate->m_dlItemSerial = Item::CItemFactory::GetInstance().GetItemUID();
|
||||
lpPktDBUpdate->m_dwSessionID = dwSessionID;
|
||||
lpPktDBUpdate->m_dwUserID = dwUserID;
|
||||
lpPktDBUpdate->m_dwCharID = dwCharID;
|
||||
lpPktDBUpdate->m_dwRequestKey = dwRequestKey;
|
||||
lpPktDBUpdate->m_Address = remoteAddress;
|
||||
lpPktDBUpdate->m_TypeCode = DBUpdateData::LOGIN;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktDBUpdate), CmdDBUpdateData, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendMoveZoneToDBAgent(CSendStream& AgentSendStream, POS& newPos,
|
||||
unsigned long dwRequestKey, unsigned long dwUserID,
|
||||
unsigned char cZone, char cChannel)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktSZMvD));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSZMvD* lpPktSZMvD = reinterpret_cast<PktSZMvD*>(lpBuffer);
|
||||
|
||||
lpPktSZMvD->m_wCmd = PktDD::SCmdCharMoveZone;
|
||||
lpPktSZMvD->m_dwRequestKey = dwRequestKey;
|
||||
lpPktSZMvD->m_dwUserID = dwUserID;
|
||||
|
||||
lpPktSZMvD->m_NewPos = newPos;
|
||||
lpPktSZMvD->m_cZone = cZone;
|
||||
lpPktSZMvD->m_cChannel = cChannel;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktSZMvD), CmdAgentZone, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendServerZoneToDBAgent(CSendStream& AgentSendStream,
|
||||
unsigned long dwRequestKey, unsigned long dwUserID,
|
||||
unsigned char cZone, unsigned char cChannel)
|
||||
{
|
||||
char* lpBuffer = AgentSendStream.GetBuffer(sizeof(PktSA));
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktSA* lpPktSA = reinterpret_cast<PktSA*>(lpBuffer);
|
||||
|
||||
lpPktSA->m_wCmd = PktDD::SCmdServerZone;
|
||||
lpPktSA->m_dwRequestKey = dwRequestKey;
|
||||
lpPktSA->m_dwUserID = dwUserID;
|
||||
lpPktSA->m_cZone = cZone;
|
||||
lpPktSA->m_cChannel = cChannel;
|
||||
|
||||
return AgentSendStream.WrapHeader(sizeof(PktSA), CmdAgentZone, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendKeyInfo(CSendStream& SendStream, unsigned long dwCID, unsigned long* pKeyInfo)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktKeyInfo));
|
||||
|
||||
if (NULL != lpBuffer)
|
||||
{
|
||||
PktKeyInfo* lpPktKeyInfo = reinterpret_cast<PktKeyInfo*>(lpBuffer);
|
||||
|
||||
lpPktKeyInfo->m_dwCID = dwCID;
|
||||
memcpy(lpPktKeyInfo->m_dwKeyInfo, pKeyInfo, sizeof(unsigned long)*PktKeyInfo::MAX_KEY_INFO);
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktKeyInfo), CmdKeyInfo, 0, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef _SEND_CHAR_LOGIN_OUT_H_
|
||||
#define _SEND_CHAR_LOGIN_OUT_H_
|
||||
|
||||
#include <Network/Packet/PacketStruct/CharLoginOutPacket.h>
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <DB/DBDefine.h>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CCharacter;
|
||||
class CSendStream;
|
||||
class CGameClientDispatch;
|
||||
|
||||
struct PktDBUpdate;
|
||||
struct _GG_AUTH_DATA;
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// Client<6E><74> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharLogin(CSendStream& SendStream, CCharacter* lpCharacter,
|
||||
const SOCKADDR_IN* lpSockAddr_In, unsigned short usError);
|
||||
|
||||
bool SendCharMoveZone(CSendStream& SendStream, unsigned short* lpChannelNums,
|
||||
unsigned char cChannelNum, unsigned char cZone, unsigned short usError);
|
||||
|
||||
bool SendServerZone(CSendStream& SendStream, unsigned long dwServerID,
|
||||
const sockaddr_in& gameServerTCPAddress, unsigned short usError);
|
||||
|
||||
bool SendCSAuth(CSendStream& SendStream, unsigned long dwCID,
|
||||
unsigned long dwAuthCode, const _GG_AUTH_DATA* lpAuthCode2, unsigned short usError);
|
||||
|
||||
|
||||
// DBAgent<6E><74> <20><><EFBFBD><EFBFBD>
|
||||
bool SendLoginToDBAgent(CSendStream& AgentSendStream, unsigned long dwRequestKey,
|
||||
unsigned long dwSessionID, unsigned long dwUserID,
|
||||
unsigned long dwCharID, const IN_ADDR remoteAddress);
|
||||
|
||||
bool SendMoveZoneToDBAgent(CSendStream& AgentSendStream, POS& newPos,
|
||||
unsigned long dwRequestKey, unsigned long dwUserID, unsigned char cZone, char cChannel);
|
||||
|
||||
bool SendServerZoneToDBAgent(CSendStream& AgentSendStream,
|
||||
unsigned long dwRequestKey, unsigned long dwUserID,
|
||||
unsigned char cZone, unsigned char cChannel);
|
||||
|
||||
bool SendKeyInfo(CSendStream& SendStream, unsigned long dwCID, unsigned long* pKeyInfo);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,131 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "SendCharQuest.h"
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharQuestPacket.h>
|
||||
|
||||
#include <Creature/Character/Character.h>
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharStartQuest(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwNPCID, unsigned short wQuestID, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktStartQuest));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktStartQuest* lpPktSQAck = reinterpret_cast<PktStartQuest*>(lpBuffer);
|
||||
|
||||
lpPktSQAck->m_dwCharID = dwCharID;
|
||||
lpPktSQAck->m_dwNPCID = dwNPCID;
|
||||
lpPktSQAck->m_wQuestID = wQuestID;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktStartQuest), CmdCharStartQuest, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharOperateTrigger(CSendStream& SendStream, unsigned long dwCharID, unsigned short wQuestID, unsigned char cPhase,
|
||||
unsigned char cTrigger, unsigned char cCount, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktOperateTrigger));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktOperateTrigger* lpPktOTAck = reinterpret_cast<PktOperateTrigger*>(lpBuffer);
|
||||
|
||||
lpPktOTAck->m_dwCharID = dwCharID;
|
||||
lpPktOTAck->m_wQuestID = wQuestID;
|
||||
lpPktOTAck->m_cPhase = cPhase;
|
||||
lpPktOTAck->m_cTrigger = cTrigger;
|
||||
|
||||
if (PktOperateTrigger::NO_SERVER_ERR != wError)
|
||||
{
|
||||
cCount++;
|
||||
}
|
||||
lpPktOTAck->m_cCount = cCount;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktOperateTrigger), CmdCharOperateTrigger, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharQuestInfo(CSendStream& SendStream, CCharacter* lpCharacter)
|
||||
{
|
||||
const int MAX_BUFFER = sizeof(PktQuestDB) + PktQuestDB::MAX_EXECUTING_QUEST * sizeof(PktQuestDB::ExecutingQuest) +
|
||||
PktQuestDB::MAX_HISTORY_QUEST * sizeof(unsigned short);
|
||||
char szBuffer[MAX_BUFFER];
|
||||
|
||||
PktQuestDB* lpPktQuestDB = reinterpret_cast<PktQuestDB *>(szBuffer);
|
||||
|
||||
lpPktQuestDB->m_dwUID = lpCharacter->GetUID();
|
||||
lpPktQuestDB->m_dwCID = lpCharacter->GetCID();
|
||||
lpPktQuestDB->m_wExecuteQuestSize = 0;
|
||||
lpPktQuestDB->m_wHistoryQuestSize = 0;
|
||||
|
||||
Quest::ExecutingQuest* ExecutingQuest = lpCharacter->GetExecutingQuest();
|
||||
unsigned short *wHistoryQuest = lpCharacter->GetHistoryQuest();
|
||||
|
||||
int nIndex = 0;
|
||||
|
||||
for (nIndex = 0; nIndex < PktQuestDB::MAX_EXECUTING_QUEST; nIndex++)
|
||||
{
|
||||
if (NULL == ExecutingQuest[nIndex].m_QuestNode)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
PktQuestDB::ExecutingQuest* ExecuteQuest =
|
||||
reinterpret_cast<PktQuestDB::ExecutingQuest *>(szBuffer + sizeof(PktQuestDB) + lpPktQuestDB->m_wExecuteQuestSize);
|
||||
|
||||
ExecuteQuest->m_wQuestID = ExecutingQuest[nIndex].m_QuestNode->m_wQuestID;
|
||||
ExecuteQuest->m_cPhase = ExecutingQuest[nIndex].m_cPhase;
|
||||
::memcpy(ExecuteQuest->m_cTriggerCount, ExecutingQuest[nIndex].m_cTriggerCount,
|
||||
sizeof(unsigned char) * PktQuestDB::MAX_TRIGGER);
|
||||
|
||||
lpPktQuestDB->m_wExecuteQuestSize += sizeof(PktQuestDB::ExecutingQuest);;
|
||||
}
|
||||
|
||||
for (nIndex = 0; nIndex < PktQuestDB::MAX_HISTORY_QUEST; nIndex++)
|
||||
{
|
||||
if (0 == wHistoryQuest[nIndex]) { break; }
|
||||
|
||||
unsigned short* wHistoryQuestForPkt =
|
||||
reinterpret_cast<unsigned short *>(szBuffer + sizeof(PktQuestDB) +
|
||||
lpPktQuestDB->m_wExecuteQuestSize + lpPktQuestDB->m_wHistoryQuestSize);
|
||||
|
||||
*wHistoryQuestForPkt = wHistoryQuest[nIndex];
|
||||
|
||||
lpPktQuestDB->m_wHistoryQuestSize += sizeof(unsigned short);
|
||||
}
|
||||
|
||||
return SendStream.WrapCompress(szBuffer, sizeof(PktQuestDB) + lpPktQuestDB->m_wExecuteQuestSize + lpPktQuestDB->m_wHistoryQuestSize,
|
||||
CmdQuestDB, 0, 0);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharEndQuest(CSendStream& SendStream, unsigned long dwCharID, unsigned short wQuestID, bool bSave)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktEndQuest));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktEndQuest* lpPktEQ = reinterpret_cast<PktEndQuest*>(lpBuffer);
|
||||
|
||||
lpPktEQ->m_dwCharID = dwCharID;
|
||||
lpPktEQ->m_wQuestID = wQuestID;
|
||||
lpPktEQ->m_bSave = bSave;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktEndQuest), CmdCharEndQuest, 0, 0);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharCancelQuest(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned short wQuestID, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktCancelQuest));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktCancelQuest* lpPktCQ = reinterpret_cast<PktCancelQuest*>(lpBuffer);
|
||||
|
||||
lpPktCQ->m_dwCharID = dwCharID;
|
||||
lpPktCQ->m_wQuestID = wQuestID;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktCancelQuest), CmdCharCancelQuest, 0, wError);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef _SEND_CHAR_QUEST_H_
|
||||
#define _SEND_CHAR_QUEST_H_
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
class CCharacter;
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharStartQuest(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwNPCID, unsigned short wQuestID, unsigned short wError);
|
||||
|
||||
// Ʈ<><C6AE><EFBFBD><EFBFBD> <20>ߵ<EFBFBD>
|
||||
bool SendCharOperateTrigger(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned short wQuestID, unsigned char cPhase, unsigned char cTrigger, unsigned char cCount, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharQuestInfo(CSendStream& SendStream, CCharacter* lpCharacter);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharEndQuest(CSendStream& SendStream, unsigned long dwCharID, unsigned short wQuestID, bool bSave);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharCancelQuest(CSendStream& SendStream, unsigned long dwCharID, unsigned short wQuestID, unsigned short wError);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "SendCharSkill.h"
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharStatusPacket.h>
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharSkillCommand(CSendStream& SendStream, unsigned long dwCharID,
|
||||
PktBase::CMDType Cmd, unsigned char cIndex, unsigned short usSkillID, unsigned short usError, unsigned char cSkillLevel, Item::ItemPos* lpItem)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktSk));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktSk* lpPktSk = reinterpret_cast<PktSk*>(lpBuffer);
|
||||
|
||||
lpPktSk->m_dwCharID = dwCharID;
|
||||
lpPktSk->m_cIndex = cIndex;
|
||||
lpPktSk->m_wSkill = usSkillID;
|
||||
lpPktSk->m_cSkillLevel = cSkillLevel;
|
||||
|
||||
if(lpItem == NULL)
|
||||
lpPktSk->m_ItemPos = Item::ItemPos(0, 0);
|
||||
else
|
||||
lpPktSk->m_ItemPos = *lpItem;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktSk), Cmd, 0, usError);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef _SEND_CHAR_ETC_H_
|
||||
#define _SEND_CHAR_ETC_H_
|
||||
|
||||
#include <Network/Packet/PacketBase.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
class CCharacter;
|
||||
|
||||
namespace Item
|
||||
{
|
||||
struct ItemPos;
|
||||
}
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><>ų Ŀ<>ǵ<EFBFBD>
|
||||
bool SendCharSkillCommand(CSendStream& SendStream, unsigned long dwCharID,
|
||||
PktBase::CMDType Cmd, unsigned char cIndex, unsigned short usSkillID, unsigned short usError, unsigned char cSkillLevel = 0, Item::ItemPos* lpItem = NULL);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,177 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "SendCharUpgradeItem.h"
|
||||
|
||||
#include <Network/Stream/SendStream.h>
|
||||
#include <Network/Packet/PacketCommand.h>
|
||||
#include <Network/Packet/PacketStruct/CharItemPacket.h>
|
||||
|
||||
|
||||
bool GameClientSendPacket::SendCharInstallSocket(CSendStream& SendStream, unsigned long dwCharID,
|
||||
Item::ItemPos EquipPos, Item::ItemPos GemPos,
|
||||
Item::CEquipment* lpEquipment, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktISAck) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktISAck* lpPktISAck = reinterpret_cast<PktISAck *>(lpBuffer);
|
||||
|
||||
size_t nItemSize = 0;
|
||||
if (NULL != lpEquipment)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
if (false == lpEquipment->SerializeOut(lpBuffer + sizeof(PktISAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
}
|
||||
}
|
||||
|
||||
lpPktISAck->m_dwCharID = dwCharID;
|
||||
lpPktISAck->m_equipPos = EquipPos;
|
||||
lpPktISAck->m_gemPos = GemPos;
|
||||
|
||||
lpPktISAck->m_cSize = static_cast<unsigned char>(nItemSize);
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktISAck) + nItemSize),
|
||||
CmdCharInstallSocket, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharItemChemical(CSendStream& SendStream, unsigned long dwCharID,
|
||||
Item::ItemPos PickkingPos, Item::ItemPos TargetPos,
|
||||
unsigned short wPickkingID, unsigned char cPickkingNum,
|
||||
Item::CItem* lpResultItem, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktItemChemicalAck) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktItemChemicalAck* lpPktICAck = reinterpret_cast<PktItemChemicalAck *>(lpBuffer);
|
||||
|
||||
size_t nItemSize = 0;
|
||||
if (NULL != lpResultItem)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
if (false == lpResultItem->SerializeOut(lpBuffer + sizeof(PktItemChemicalAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
}
|
||||
}
|
||||
|
||||
lpPktICAck->m_dwCharID = dwCharID;
|
||||
|
||||
lpPktICAck->m_pickkingPos = PickkingPos;
|
||||
lpPktICAck->m_targetPos = TargetPos;
|
||||
|
||||
lpPktICAck->m_wPickkingID = wPickkingID;
|
||||
lpPktICAck->m_cPickkingNum = cPickkingNum;
|
||||
|
||||
lpPktICAck->m_cResultSize = static_cast<unsigned char>(nItemSize);
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktItemChemicalAck) + nItemSize),
|
||||
CmdCharItemChemical, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharUpgradeItem(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwCurrentGold, Item::CItem* lpItem,
|
||||
unsigned char cCurrentMineralNum, unsigned char cValue, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktUgIAck) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktUgIAck* lpPktUgIAck = reinterpret_cast<PktUgIAck *>(lpBuffer);
|
||||
|
||||
size_t nItemSize = 0;
|
||||
if (NULL != lpItem)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
if (false == lpItem->SerializeOut(lpBuffer + sizeof(PktUgIAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
}
|
||||
}
|
||||
|
||||
lpPktUgIAck->m_dwCharID = dwCharID;
|
||||
lpPktUgIAck->m_dwCurrentGold = dwCurrentGold;
|
||||
lpPktUgIAck->m_cCurrentMineralNum = cCurrentMineralNum;
|
||||
lpPktUgIAck->m_cValue = cValue;
|
||||
lpPktUgIAck->m_cSize = static_cast<unsigned char>(nItemSize);
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktUgIAck) + nItemSize),
|
||||
CmdCharUpgradeItem, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharItemOptionGraft(CSendStream& SendStream, unsigned long dwCharID,
|
||||
unsigned long dwCurrentGold, Item::CItem* lpResultItem,
|
||||
unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktItemOptionGraftAck) + Item::MAX_ITEM_SIZE);
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktItemOptionGraftAck* lpPktIOGAck = reinterpret_cast<PktItemOptionGraftAck *>(lpBuffer);
|
||||
|
||||
size_t nItemSize = 0;
|
||||
if (NULL != lpResultItem)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
if (false == lpResultItem->SerializeOut(lpBuffer + sizeof(PktItemOptionGraftAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
}
|
||||
}
|
||||
|
||||
lpPktIOGAck->m_dwCharID = dwCharID;
|
||||
lpPktIOGAck->m_dwGold = dwCurrentGold;
|
||||
lpPktIOGAck->m_cSize = static_cast<unsigned char>(nItemSize);
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktItemOptionGraftAck) + nItemSize),
|
||||
CmdCharItemOptionGraft, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharItemCompensation(CSendStream& SendStream, unsigned long dwCharID, unsigned short wError)
|
||||
{
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktItemCompensation));
|
||||
if (NULL == lpBuffer) { return false; }
|
||||
|
||||
PktItemCompensation* lpPICAck = reinterpret_cast<PktItemCompensation *>(lpBuffer);
|
||||
|
||||
lpPICAck->m_dwCharID = dwCharID;
|
||||
|
||||
return SendStream.WrapCrypt(sizeof(PktItemCompensation), CmdCharItemCompensation, 0, wError);
|
||||
}
|
||||
|
||||
bool GameClientSendPacket::SendCharRuneInstallSocket(CSendStream& SendStream, unsigned long dwCharID, Item::ItemPos EquipPos,
|
||||
Item::ItemPos RunePos, Item::CEquipment* lpEquipment, unsigned char cType, unsigned short wError)
|
||||
|
||||
{
|
||||
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ/<2F><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
char* lpBuffer = SendStream.GetBuffer(sizeof(PktIRSAck) + Item::MAX_ITEM_SIZE);
|
||||
|
||||
if(!lpBuffer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PktIRSAck* lpPktIRSAck = reinterpret_cast<PktIRSAck*>(lpBuffer);
|
||||
|
||||
size_t nItemSize = 0;
|
||||
|
||||
if(lpEquipment)
|
||||
{
|
||||
nItemSize = Item::MAX_ITEM_SIZE;
|
||||
|
||||
if(!lpEquipment->SerializeOut(lpBuffer + sizeof(PktIRSAck), nItemSize))
|
||||
{
|
||||
ERRLOG1(g_Log, "CID:0x%08x <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SerializeOut<75><74> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.", dwCharID);
|
||||
}
|
||||
}
|
||||
|
||||
lpPktIRSAck->m_dwCharID = dwCharID;
|
||||
lpPktIRSAck->m_equipPos = EquipPos;
|
||||
lpPktIRSAck->m_runePos = RunePos;
|
||||
lpPktIRSAck->m_cSize = static_cast<unsigned char>(nItemSize);
|
||||
lpPktIRSAck->m_cType = cType;
|
||||
|
||||
return SendStream.WrapCrypt(static_cast<unsigned short>(sizeof(PktIRSAck) + nItemSize),
|
||||
CmdCharInstallRuneSocket, 0, wError);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef _SEND_CHAR_UPGRADE_ITEM_H_
|
||||
#define _SEND_CHAR_UPGRADE_ITEM_H_
|
||||
|
||||
#include <DB/DBdefine.h>
|
||||
#include <Item/Item.h>
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
|
||||
namespace GameClientSendPacket
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ν<EFBFBD><CEBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
bool SendCharInstallSocket(CSendStream& SendStream, unsigned long dwCharID,
|
||||
Item::ItemPos EquipPos, Item::ItemPos GemPos, Item::CEquipment* lpEquipment, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ռ<EFBFBD>
|
||||
bool SendCharItemChemical(CSendStream& SendStream, unsigned long dwCharID, Item::ItemPos PickkingPos, Item::ItemPos TargetPos,
|
||||
unsigned short wPickkingID, unsigned char cPickkingNum, Item::CItem* lpResultItem, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D7B7>̵<EFBFBD>
|
||||
bool SendCharUpgradeItem(CSendStream& SendStream, unsigned long dwCharID, unsigned long dwCurrentGold,
|
||||
Item::CItem* lpItem, unsigned char cCurrentMineralNum, unsigned char cValue, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ɼ<EFBFBD> <20>̽<EFBFBD>
|
||||
bool SendCharItemOptionGraft(CSendStream& SendStream, unsigned long dwCharID, unsigned long dwCurrentGold,
|
||||
Item::CItem* lpResultItem, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD>
|
||||
bool SendCharItemCompensation(CSendStream& SendStream, unsigned long dwCharID, unsigned short wError);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ġ/<2F><><EFBFBD><EFBFBD>.
|
||||
bool SendCharRuneInstallSocket(CSendStream& SendStream, unsigned long dwCharID, Item::ItemPos EquipPos, Item::ItemPos RunePos,
|
||||
Item::CEquipment* lpEquipment, unsigned char cType, unsigned short wError);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user