DragonNest/Server/DNGameServer/DnGlyph.cpp
Cussrro 47f7895977 Revert "修复编码问题"
This reverts commit 9e69c01767.
2024-12-21 10:04:04 +08:00

45 lines
1.2 KiB
C++

#include "StdAfx.h"
#include "DnGlyph.h"
#include "DNTableFile.h"
#include "DnTableDB.h"
DECL_DN_SMART_PTR_STATIC( CDnGlyph, MAX_SESSION_COUNT, 100 )
CDnGlyph::CDnGlyph( CMultiRoom *pRoom )
: CDnUnknownRenderObject( pRoom, false )
, CDnItem( pRoom )
{
m_GlyphType = GlyphTypeEnum::None;
}
CDnGlyph::~CDnGlyph()
{
}
DnGlyphHandle CDnGlyph::CreateGlyph( CMultiRoom *pRoom, int nTableID, int nSeed, char cOptionIndex, char cEnchantLevel, char cPotentialIndex, char cSealCount, bool bSoulBound )
{
if( nTableID < 1 ) return CDnGlyph::Identity();
DnGlyphHandle hGlyph = (new CDnGlyph(pRoom))->GetMySmartPtr();
if( !hGlyph ) return CDnGlyph::Identity();
hGlyph->Initialize( nTableID, nSeed, cOptionIndex, cEnchantLevel, cPotentialIndex, cSealCount );
return hGlyph;
}
bool CDnGlyph::Initialize( int nTableID, int nSeed, char cOptionIndex, char cEnchantLevel, char cPotentialIndex, char cSealCount, bool bSoulBound )
{
DNTableFileFormat *pSox = GetDNTable( CDnTableDB::TGLYPHSKILL );
if( !pSox )
{
g_Log.Log( LogType::_FILELOG, L"GlyphSkillTable.ext failed\r\n");
return false;
}
if( !pSox->IsExistItem( nTableID ) ) return false;
CDnItem::Initialize( nTableID, nSeed, cOptionIndex, cEnchantLevel, cPotentialIndex, cSealCount, bSoulBound );
return true;
}