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:
568
Server/DBProcess/ConvertTwoNationQuest/ConvertTwoNationQuest.cpp
Normal file
568
Server/DBProcess/ConvertTwoNationQuest/ConvertTwoNationQuest.cpp
Normal file
@@ -0,0 +1,568 @@
|
||||
// ConvertTwoNationQuest.cpp : <20>ܼ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1><D7B7><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <Item/ItemMgr.h>
|
||||
#include <Item/Item.h>
|
||||
#include <Item/Container/ContainerConstant.h>
|
||||
#include <Item/RebalanceConvert/ContainerChecker.h>
|
||||
|
||||
#include <RylDBLibrary/RylDBLibrary.h>
|
||||
#include <RylDBLibrary/RylDBStoreCommand.h>
|
||||
#include <RylDBLibrary/RylDBCharCommand.h>
|
||||
|
||||
#include <Log/ServerLog.h>
|
||||
|
||||
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
||||
#include <Network/Packet/PacketStruct/CharQuestPacket.h>
|
||||
|
||||
#include <Utility/TokenlizedFile.h>
|
||||
#include <Utility/Setup/ServerSetup.h>
|
||||
#include <Utility/math/Math.h>
|
||||
|
||||
#define LOG_CONVERT0(str) { ERRLOG0(g_Log, (str)); printf(str "\n"); }
|
||||
#define LOG_CONVERT1(str, arg1) { ERRLOG1(g_Log, (str), (arg1)); printf(str "\n", (arg1)); }
|
||||
#define LOG_CONVERT2(str, arg1, arg2) { ERRLOG2(g_Log, (str), (arg1), (arg2)); printf(str "\n", (arg1), (arg2)); }
|
||||
|
||||
class CDBConvertTwoNationQuest : public IDBCharItemProcess, public IDBCharQuestProcess
|
||||
{
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
INSERT_ITEM_ID = 10329
|
||||
};
|
||||
|
||||
struct ConvertID
|
||||
{
|
||||
unsigned short m_wQuestID;
|
||||
unsigned short m_wChangeQuestID;
|
||||
unsigned char m_cType;
|
||||
|
||||
enum
|
||||
{
|
||||
type_remove_quest = 0,
|
||||
type_change_quest = 1
|
||||
};
|
||||
|
||||
ConvertID() : m_wQuestID(0), m_wChangeQuestID(0) {}
|
||||
};
|
||||
|
||||
|
||||
struct ParseData
|
||||
{
|
||||
typedef bool(*ParseFunc) (ConvertID& convertID, const char* szValue);
|
||||
|
||||
const char* m_szColumnName;
|
||||
ParseFunc m_fnParseFunc;
|
||||
|
||||
ParseData(const char* szColumnName, ParseFunc fnParseFunc)
|
||||
: m_szColumnName(szColumnName), m_fnParseFunc(fnParseFunc) { }
|
||||
};
|
||||
|
||||
typedef std::vector<ParseData> ParseDataArray;
|
||||
typedef std::map<unsigned short, ConvertID*> ConvertMap;
|
||||
typedef std::map<unsigned long, unsigned long> UID;
|
||||
|
||||
public:
|
||||
|
||||
CDBConvertTwoNationQuest(ATL::CSession& session) : m_Session(session) { }
|
||||
|
||||
virtual ConvertResult operator() (RylDBCommand::CCharItem& charItem_InOut);
|
||||
virtual ConvertResult operator() (RylDBCommand::CCharQuest& charQuest_InOut);
|
||||
|
||||
bool Initialize(int nServerGroup);
|
||||
bool Release();
|
||||
|
||||
private:
|
||||
|
||||
UID m_cUID;
|
||||
|
||||
ConvertMap m_cConvertMap;
|
||||
ConvertMap m_cChangeMap;
|
||||
|
||||
CDBItemSerialMgr m_cDBItemSerialMgr;
|
||||
|
||||
ATL::CSession& m_Session;
|
||||
};
|
||||
|
||||
class CParseDelimitedData
|
||||
{
|
||||
public:
|
||||
|
||||
CParseDelimitedData(CTokenlizedFile& TokenlizedFile) : m_TokenlizedFile(TokenlizedFile) { }
|
||||
|
||||
bool operator() (CDBConvertTwoNationQuest::ParseDataArray& ParserArray, CDBConvertTwoNationQuest::ConvertID& convertID)
|
||||
{
|
||||
for (CDBConvertTwoNationQuest::ParseDataArray::iterator itr = ParserArray.begin(); itr != ParserArray.end(); ++itr)
|
||||
{
|
||||
const char* szValue = m_TokenlizedFile.GetStringValue(itr->m_szColumnName);
|
||||
|
||||
if (NULL == szValue)
|
||||
{
|
||||
ERRLOG2(g_Log, "Data Load Fail Line:%d, ColumnName:%s",
|
||||
m_TokenlizedFile.GetCurrentLine(), itr->m_szColumnName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (false == itr->m_fnParseFunc(convertID, szValue))
|
||||
{
|
||||
ERRLOG2(g_Log, "Data Fail Line:%d, ColumnName:%s",
|
||||
m_TokenlizedFile.GetCurrentLine(), itr->m_szColumnName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
CTokenlizedFile& m_TokenlizedFile;
|
||||
};
|
||||
|
||||
bool ReadType(CDBConvertTwoNationQuest::ConvertID& convertID, const char* szValue)
|
||||
{
|
||||
convertID.m_cType = static_cast<unsigned char>(atoi(szValue));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool ReadBefore(CDBConvertTwoNationQuest::ConvertID& convertID, const char* szValue)
|
||||
{
|
||||
convertID.m_wQuestID = Math::Convert::StrToHex16(szValue);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool ReadAfter(CDBConvertTwoNationQuest::ConvertID& convertID, const char* szValue)
|
||||
{
|
||||
convertID.m_wChangeQuestID = Math::Convert::StrToHex16(szValue);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void PrintUsage()
|
||||
{
|
||||
printf("ConvertAccessory DBAddress DBName DBAccount DBPassword ServerGroupNum(0~9)");
|
||||
}
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
if(6 != argc)
|
||||
{
|
||||
PrintUsage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
CoInitialize(0);
|
||||
|
||||
int nServerGroup = atoi(argv[5]);
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
ATL::CDataSource dataSource;
|
||||
ATL::CSession Session;
|
||||
|
||||
if(FAILED(hr = CRylDBProcess::ConnectDB(dataSource, argv[1], argv[2], argv[3], argv[4])))
|
||||
{
|
||||
LOG_CONVERT1("Connect DB failed : hr:0x%08X", hr);
|
||||
}
|
||||
else if(FAILED(hr = Session.Open(dataSource)))
|
||||
{
|
||||
LOG_CONVERT1("Open session failed : hr:0x%08X", hr);
|
||||
}
|
||||
else if (FAILED(hr = Session.StartTransaction()))
|
||||
{
|
||||
LOG_CONVERT1("Start transaction failed : hr:0x%08x", hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
CRylDBProcess dbProcess(Session);
|
||||
CConsoleCounter consoleCounter(1000);
|
||||
CDBConvertTwoNationQuest quest(Session);
|
||||
|
||||
if(!quest.Initialize(nServerGroup))
|
||||
{
|
||||
LOG_CONVERT0("Initialize failed");
|
||||
}
|
||||
else if (FAILED(hr = dbProcess.CharQuest(quest, consoleCounter)))
|
||||
{
|
||||
LOG_CONVERT1("CharQuest process failed : hr:0x%08X", hr);
|
||||
}
|
||||
else if(FAILED(hr = dbProcess.CharItem(quest, consoleCounter)))
|
||||
{
|
||||
LOG_CONVERT1("CharItem process failed : hr:0x%08x", hr);
|
||||
}
|
||||
|
||||
quest.Release();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
LOG_CONVERT0("Exception occured! rollback transaction now!");
|
||||
LOG_CONVERT2("Rollback transaction %s! : hr:0x%08x",
|
||||
FAILED(hr = Session.Abort()) ? "failed" : "succeeded", hr);
|
||||
}
|
||||
|
||||
LOG_CONVERT0("Commit transaction now!");
|
||||
LOG_CONVERT2("Commit transaction %s! : hr:0x%08x",
|
||||
FAILED(hr = Session.Commit()) ? "failed" : "succeeded", hr);
|
||||
}
|
||||
|
||||
Session.Close();
|
||||
dataSource.Close();
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CDBConvertTwoNationQuest::Initialize(int nServerGroup)
|
||||
{
|
||||
const char* szFileName = "ConvertQuest.txt";
|
||||
|
||||
CTokenlizedFile TokenlizedFile;
|
||||
|
||||
if(!TokenlizedFile.Open(szFileName))
|
||||
{
|
||||
LOG_CONVERT0("ConverScript <20>ε<EFBFBD> <20><><EFBFBD><EFBFBD>");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (false == TokenlizedFile.ReadColumn())
|
||||
{
|
||||
LOG_CONVERT0("ConverScript <20>÷<EFBFBD> <20>ε<EFBFBD> <20><><EFBFBD><EFBFBD>");
|
||||
return false;
|
||||
}
|
||||
|
||||
ParseDataArray parseDataArray;
|
||||
|
||||
parseDataArray.reserve(3);
|
||||
parseDataArray.push_back(ParseData("Type", ReadType));
|
||||
parseDataArray.push_back(ParseData("Before", ReadBefore));
|
||||
parseDataArray.push_back(ParseData("After", ReadAfter));
|
||||
|
||||
m_cConvertMap.clear();
|
||||
m_cChangeMap.clear();
|
||||
|
||||
ConvertID convertID;
|
||||
ConvertID* pConverID;
|
||||
|
||||
CParseDelimitedData ParseData(TokenlizedFile);
|
||||
|
||||
while (TokenlizedFile.ReadLine())
|
||||
{
|
||||
if (false == ParseData(parseDataArray, convertID))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
pConverID = new ConvertID;
|
||||
memcpy(pConverID, &convertID, sizeof(ConvertID));
|
||||
|
||||
bool bInsert = false;
|
||||
|
||||
if(pConverID->m_cType==ConvertID::type_remove_quest)
|
||||
{
|
||||
bInsert = m_cConvertMap.insert(std::make_pair(pConverID->m_wQuestID, pConverID)).second;
|
||||
}
|
||||
else if(pConverID->m_cType==ConvertID::type_change_quest)
|
||||
{
|
||||
bInsert = m_cChangeMap.insert(std::make_pair(pConverID->m_wQuestID, pConverID)).second;
|
||||
}
|
||||
|
||||
if(!bInsert)
|
||||
{
|
||||
LOG_CONVERT0("ConverMap Insert Fail");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SERVER_ID serverID;
|
||||
|
||||
serverID.sID.Type = CServerSetup::AuthServer;
|
||||
serverID.sID.Group = nServerGroup;
|
||||
serverID.sID.Channel = 0;
|
||||
serverID.sID.ID = 0;
|
||||
|
||||
HRESULT hr = m_cDBItemSerialMgr.LoadItemSerialDB(m_Session, serverID.dwID);
|
||||
|
||||
if(FAILED(hr))
|
||||
{
|
||||
LOG_CONVERT1("itemSerial failed : hr:0x%08X", hr);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ũ<EFBFBD><C5A9>Ʈ <20>ε<EFBFBD>
|
||||
if(!Item::CItemMgr::GetInstance().LoadItemProtoType("ItemScript.txt"))
|
||||
{
|
||||
LOG_CONVERT0("ItemScript Load Failed");
|
||||
}
|
||||
|
||||
m_cUID.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CDBConvertTwoNationQuest::Release()
|
||||
{
|
||||
ConvertMap::iterator begin = m_cConvertMap.begin();
|
||||
ConvertMap::iterator end = m_cConvertMap.end();
|
||||
|
||||
for(ConvertMap::iterator itr = begin; itr!=end; itr++)
|
||||
{
|
||||
if(itr->second)
|
||||
{
|
||||
delete itr->second;
|
||||
}
|
||||
}
|
||||
|
||||
begin = m_cChangeMap.begin();
|
||||
end = m_cChangeMap.end();
|
||||
|
||||
for(ConvertMap::iterator itr = begin; itr!=end; itr++)
|
||||
{
|
||||
if(itr->second)
|
||||
{
|
||||
delete itr->second;
|
||||
}
|
||||
}
|
||||
|
||||
m_cChangeMap.clear();
|
||||
m_cConvertMap.clear();
|
||||
m_cUID.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ConvertResult CDBConvertTwoNationQuest::operator() (RylDBCommand::CCharQuest& charQuest_InOut)
|
||||
{
|
||||
unsigned long dwCID = charQuest_InOut.GetCID();
|
||||
unsigned long dwCount = 0;
|
||||
bool bQuestCheck = false;
|
||||
bool bCompleteCheck = false;
|
||||
const QUEST& quest_In = charQuest_InOut.GetQuest();
|
||||
const HISTORY history_In = charQuest_InOut.GetHistory();
|
||||
|
||||
if(dwCID==104)
|
||||
{
|
||||
// 0xf134 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD>̻<EFBFBD>) or <20>Ϸ<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD> PC üũ
|
||||
if (0 < quest_In.dwSize)
|
||||
{
|
||||
QUEST quest_Out;
|
||||
memset(&quest_Out, 0, sizeof(QUEST));
|
||||
|
||||
const PktQuestDB::ExecutingQuest* lpExecutingQuestPos =
|
||||
reinterpret_cast<const PktQuestDB::ExecutingQuest*>(quest_In.Data);
|
||||
|
||||
const PktQuestDB::ExecutingQuest* lpExecutingQuestEnd =
|
||||
reinterpret_cast<const PktQuestDB::ExecutingQuest*>(quest_In.Data + quest_In.dwSize);
|
||||
|
||||
for(; lpExecutingQuestPos < lpExecutingQuestEnd; ++lpExecutingQuestPos)
|
||||
{
|
||||
if(lpExecutingQuestPos->m_wQuestID==0xf134 && lpExecutingQuestPos->m_cPhase>=3)
|
||||
{
|
||||
bQuestCheck = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < history_In.dwSize && !bQuestCheck)
|
||||
{
|
||||
HISTORY history_Out;
|
||||
memset(&history_Out, 0, sizeof(HISTORY));
|
||||
|
||||
const unsigned short* lpHistoryPos = reinterpret_cast<const unsigned short*>(history_In.Data);
|
||||
const unsigned short* lpHistoryEnd = reinterpret_cast<const unsigned short*>(history_In.Data + history_In.dwSize);
|
||||
|
||||
for(; lpHistoryPos < lpHistoryEnd; ++lpHistoryPos)
|
||||
{
|
||||
if(*lpHistoryPos==0xf134)
|
||||
{
|
||||
bQuestCheck = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 0xf090 or 0xf096 <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD>̻<EFBFBD>) or <20>Ϸ<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD>Ͽ<EFBFBD> <20>ִ<EFBFBD> PC üũ.
|
||||
if (0 < quest_In.dwSize && bQuestCheck)
|
||||
{
|
||||
QUEST quest_Out;
|
||||
memset(&quest_Out, 0, sizeof(QUEST));
|
||||
|
||||
const PktQuestDB::ExecutingQuest* lpExecutingQuestPos =
|
||||
reinterpret_cast<const PktQuestDB::ExecutingQuest*>(quest_In.Data);
|
||||
|
||||
const PktQuestDB::ExecutingQuest* lpExecutingQuestEnd =
|
||||
reinterpret_cast<const PktQuestDB::ExecutingQuest*>(quest_In.Data + quest_In.dwSize);
|
||||
|
||||
for(; lpExecutingQuestPos < lpExecutingQuestEnd; ++lpExecutingQuestPos)
|
||||
{
|
||||
if(lpExecutingQuestPos->m_wQuestID==0xf090 && lpExecutingQuestPos->m_cPhase>=3)
|
||||
{
|
||||
bQuestCheck = true;
|
||||
break;
|
||||
}
|
||||
else if(lpExecutingQuestPos->m_wQuestID==0xf096 && lpExecutingQuestPos->m_cPhase>=3)
|
||||
{
|
||||
bCompleteCheck = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < history_In.dwSize && !bCompleteCheck)
|
||||
{
|
||||
HISTORY history_Out;
|
||||
memset(&history_Out, 0, sizeof(HISTORY));
|
||||
|
||||
const unsigned short* lpHistoryPos = reinterpret_cast<const unsigned short*>(history_In.Data);
|
||||
const unsigned short* lpHistoryEnd = reinterpret_cast<const unsigned short*>(history_In.Data + history_In.dwSize);
|
||||
|
||||
for(; lpHistoryPos < lpHistoryEnd; ++lpHistoryPos)
|
||||
{
|
||||
if(*lpHistoryPos!=0xf090 && *lpHistoryPos!=0xf096)
|
||||
{
|
||||
bQuestCheck = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD>Ͽ<EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
if (0 < quest_In.dwSize)
|
||||
{
|
||||
QUEST quest_Out;
|
||||
memset(&quest_Out, 0, sizeof(QUEST));
|
||||
|
||||
const PktQuestDB::ExecutingQuest* lpExecutingQuestPos =
|
||||
reinterpret_cast<const PktQuestDB::ExecutingQuest*>(quest_In.Data);
|
||||
|
||||
const PktQuestDB::ExecutingQuest* lpExecutingQuestEnd =
|
||||
reinterpret_cast<const PktQuestDB::ExecutingQuest*>(quest_In.Data + quest_In.dwSize);
|
||||
|
||||
PktQuestDB::ExecutingQuest* lpDst = reinterpret_cast<PktQuestDB::ExecutingQuest*>(quest_Out.Data);
|
||||
|
||||
for(dwCount = 0; lpExecutingQuestPos < lpExecutingQuestEnd; ++lpExecutingQuestPos)
|
||||
{
|
||||
ConvertMap::iterator find = m_cConvertMap.find(lpExecutingQuestPos->m_wQuestID);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD>°<C2B0> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>..
|
||||
if(find==m_cConvertMap.end())
|
||||
{
|
||||
*lpDst = *lpExecutingQuestPos;
|
||||
lpDst++;
|
||||
dwCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (dwCount)
|
||||
{
|
||||
quest_Out.dwSize = static_cast<unsigned long>(
|
||||
reinterpret_cast<char*>(lpDst) - quest_Out.Data);
|
||||
|
||||
charQuest_InOut.SetQuest(quest_Out);
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < history_In.dwSize)
|
||||
{
|
||||
HISTORY quest;
|
||||
memcpy(&quest, &history_In, sizeof(HISTORY));
|
||||
|
||||
unsigned short* lpHistoryPos = reinterpret_cast<unsigned short*>(quest.Data);
|
||||
unsigned short* lpHistoryEnd = reinterpret_cast<unsigned short*>(quest.Data + history_In.dwSize);
|
||||
|
||||
for(dwCount = 0; lpHistoryPos < lpHistoryEnd; ++lpHistoryPos)
|
||||
{
|
||||
ConvertMap::iterator find = m_cConvertMap.find(*lpHistoryPos);
|
||||
|
||||
if(find!=m_cChangeMap.end())
|
||||
{
|
||||
*lpHistoryPos = find->second->m_wChangeQuestID;
|
||||
dwCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (dwCount)
|
||||
{
|
||||
charQuest_InOut.SetHistory(quest);
|
||||
}
|
||||
}
|
||||
|
||||
if(bQuestCheck)
|
||||
{
|
||||
bool bInsert = m_cUID.insert(std::make_pair(dwCID, dwCID)).second;
|
||||
|
||||
if(!bInsert)
|
||||
{
|
||||
LOG_CONVERT1("UID Insert Fail : %u", dwCID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return CONVERT_SUCCEEDED;
|
||||
}
|
||||
|
||||
ConvertResult CDBConvertTwoNationQuest::operator()(RylDBCommand::CCharItem& charItem_InOut)
|
||||
{
|
||||
// 10329 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
|
||||
unsigned long dwCID = charItem_InOut.GetCID();
|
||||
|
||||
UID::iterator find = m_cUID.find(dwCID);
|
||||
|
||||
if(find!=m_cUID.end())
|
||||
{
|
||||
const INVEN& inven_In = charItem_InOut.GetInven();
|
||||
|
||||
INVEN inven_Out;
|
||||
memset(&inven_Out, 0, sizeof(INVEN));
|
||||
|
||||
const Item::ItemInfo* pItemInfo = Item::CItemMgr::GetInstance().GetItemInfo(INSERT_ITEM_ID);
|
||||
|
||||
if(pItemInfo)
|
||||
{
|
||||
RebalanceLib::CItemArrayChecker<
|
||||
ContainerConstant::INVENTORY_WIDTH,
|
||||
ContainerConstant::INVENTORY_HEIGHT,
|
||||
ContainerConstant::MAX_INVENTORY_TAB> Inven_checker(TakeType::TS_INVEN);
|
||||
|
||||
Item::ItemPos emptyPos;
|
||||
|
||||
if(inven_Out.dwSize + sizeof(Item::ItemData) <= INVEN::MAX_INVEN_SIZE)
|
||||
{
|
||||
if(Inven_checker.FindQuestEmptyPos(emptyPos, pItemInfo->m_DetailData.m_cXSize, pItemInfo->m_DetailData.m_cYSize))
|
||||
{
|
||||
Item::ItemData* lpItemData = reinterpret_cast<Item::ItemData*>(inven_Out.Data + inven_Out.dwSize);
|
||||
|
||||
lpItemData->m_dwUID = m_cDBItemSerialMgr.GetNewItemSerial();
|
||||
lpItemData->m_usProtoTypeID = pItemInfo->m_usProtoTypeID;
|
||||
lpItemData->m_ItemPos = emptyPos;
|
||||
lpItemData->m_cItemSize = sizeof(Item::ItemData);
|
||||
lpItemData->m_cNumOrDurability = 1;
|
||||
|
||||
inven_Out.dwSize += sizeof(Item::ItemData);
|
||||
|
||||
charItem_InOut.SetInven(inven_Out);
|
||||
|
||||
goto go_return;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_CONVERT1("Empty Pos : %u", dwCID);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_CONVERT1("ItemManager Load Failed : %u", dwCID);
|
||||
}
|
||||
}
|
||||
|
||||
go_return:
|
||||
|
||||
return CONVERT_SUCCEEDED;
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="ConvertTwoNationQuest"
|
||||
ProjectGUID="{BC00A205-2B7E-458F-9D62-D73D815CD50C}"
|
||||
SccProjectName="SAK"
|
||||
SccAuxPath="SAK"
|
||||
SccLocalPath="SAK"
|
||||
SccProvider="SAK"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../;../../RylServerProject;../../RylServerProject/BaseLibrary;../../RylServerProject/RylServerLibrary;../../RylServerProject/RylGameLibrary"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/ConvertTwoNationQuest.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/ConvertTwoNationQuest.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="../Executable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../;../../RylServerProject;../../RylServerProject/BaseLibrary;../../RylServerProject/RylServerLibrary;../../RylServerProject/RylGameLibrary"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/ConvertTwoNationQuest.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="<22>ҽ<EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\ConvertTwoNationQuest.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\stdafx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="<22><><EFBFBD>ҽ<EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
32
Server/DBProcess/ConvertTwoNationQuest/ReadMe.txt
Normal file
32
Server/DBProcess/ConvertTwoNationQuest/ReadMe.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
========================================================================
|
||||
<20>ܼ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1> : ConvertTwoNationQuest <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>
|
||||
========================================================================
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD>翡<EFBFBD><E7BFA1> <20><> ConvertTwoNationQuest <20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1><D7B7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
<EFBFBD><EFBFBD> <20><><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD> ConvertTwoNationQuest <20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1><D7B7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ͽ<EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ԵǾ<D4B5> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
||||
|
||||
|
||||
ConvertTwoNationQuest.vcproj
|
||||
<20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD>縦 <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> VC++ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>⺻ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
<20>ش<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Visual C++<2B><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD>
|
||||
<20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD>翡<EFBFBD><E7BFA1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD>ɿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
||||
|
||||
ConvertTwoNationQuest.cpp
|
||||
<20>⺻ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1> <20>ҽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
<EFBFBD><EFBFBD>Ÿ ǥ<><C7A5> <20><><EFBFBD><EFBFBD>:
|
||||
|
||||
StdAfx.h <20><> StdAfx.cpp<70><70>
|
||||
ConvertTwoNationQuest.pch<63><68><EFBFBD><EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> PCH(<28≯<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD>) <20><><EFBFBD>ϰ<EFBFBD>
|
||||
StdAfx.obj<62><6A><EFBFBD><EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> <20≯<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
<EFBFBD><EFBFBD>Ÿ <20><><EFBFBD><EFBFBD>:
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD>翡<EFBFBD><E7BFA1> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> "TODO:" <20>ּ<EFBFBD><D6BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ڰ<EFBFBD> <20>߰<EFBFBD><DFB0>ϰų<CFB0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD> <20>ϴ<EFBFBD>
|
||||
<EFBFBD>ҽ<EFBFBD> <20>ڵ<EFBFBD> <20>κ<EFBFBD><CEBA><EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD>ϴ<EFBFBD>.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
8
Server/DBProcess/ConvertTwoNationQuest/stdafx.cpp
Normal file
8
Server/DBProcess/ConvertTwoNationQuest/stdafx.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : ǥ<><C7A5> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ϸ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20>ҽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
// ConvertTwoNationQuest.pch<63><68> <20≯<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˴ϴ<CBB4>.
|
||||
// stdafx.obj<62><6A><EFBFBD><EFBFBD> <20≯<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ե˴ϴ<CBB4>.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: <20>ʿ<EFBFBD><CABF><EFBFBD> <20>߰<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƴ<EFBFBD> STDAFX.H<><48><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||
12
Server/DBProcess/ConvertTwoNationQuest/stdafx.h
Normal file
12
Server/DBProcess/ConvertTwoNationQuest/stdafx.h
Normal file
@@ -0,0 +1,12 @@
|
||||
// stdafx.h : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD>
|
||||
// ǥ<><C7A5> <20>ý<EFBFBD><C3BD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <tchar.h>
|
||||
|
||||
// TODO: <20><><EFBFBD>α<CEB1><D7B7><EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD> <20>߰<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E2BFA1> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||
Reference in New Issue
Block a user