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>
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#include "stdafx.h"
|
|
|
|
#include <Log/ServerLog.h>
|
|
#include <Utility/Math/Math.h>
|
|
#include <Character/ModifyCharacter.h>
|
|
|
|
bool CSkillID::ReadSkillScript(char* szScriptName)
|
|
{
|
|
const int MAX_LINE = 4096;
|
|
const char SKILL_ID_LEN = 32;
|
|
const char SKILL_TYPE_LEN = 32;
|
|
|
|
char cLineBuffer[MAX_LINE];
|
|
char cSkillID[SKILL_ID_LEN];
|
|
char cSkillType[SKILL_TYPE_LEN];
|
|
|
|
unsigned short BeforeID = 0, AfterID = 1;
|
|
|
|
FILE* lpStream = fopen(szScriptName, "rt");
|
|
if(NULL == lpStream)
|
|
{
|
|
ERRLOG1(g_Log, "스킬 스크립트 파일 열기 실패. 파일명: %s", szScriptName);
|
|
return false;
|
|
}
|
|
|
|
fgets(cLineBuffer, MAX_LINE, lpStream); // 첫 라인 제거 (컬럼명)
|
|
|
|
while(!feof(lpStream))
|
|
{
|
|
fgets(cLineBuffer, MAX_LINE, lpStream);
|
|
sscanf(cLineBuffer, "%s %s", cSkillID, cSkillType);
|
|
|
|
if(stricmp(cSkillType, "ITEM")) // 스킬타입이 아이템이 아닐 경우만
|
|
{
|
|
if((*cSkillID == '0') && (*(cSkillID + 1) == 'x')) // 0x로 시작하는지 체크
|
|
{
|
|
AfterID = Math::Convert::Atos(cSkillID);
|
|
|
|
if(AfterID != BeforeID)
|
|
{
|
|
insert(AfterID);
|
|
BeforeID = AfterID;
|
|
}
|
|
}
|
|
}
|
|
|
|
*cLineBuffer = *cSkillID = 0;
|
|
}
|
|
|
|
fclose(lpStream);
|
|
|
|
return true;
|
|
} |