Merhaba arkadaşlar Client Locale String sistemini eklediğimizde minimap üzerinde npc isimlendirmeleri server tarafından gönderilmekteydi. Bunun çözümünü sizlerle paylaşacağım.
Sorun:
Kanıt:
Sorun:
C++:
#Client
## UserInterface
Packet.h
struct TNPCPosition
{
BYTE bType;
altına ekle
#if defined(BL_CLIENT_LOCALE_STRING_)
DWORD dwVnum;
#endif
/* ********************************************************************************* */
PythonNetworkPhaseGame.cpp
bool CPythonNetworkStream::RecvNPCList() içinde bul
CPythonMiniMap::Instance().RegisterAtlasMark(NPCPosition.bType, NPCPosition.name, NPCPosition.x, NPCPosition.y);
değiştir
#if defined(BL_CLIENT_LOCALE_STRING_)
const char* c_szName = nullptr;
if (CPythonNonPlayer::Instance().GetName(NPCPosition.dwVnum, &c_szName)) {
CPythonMiniMap::Instance().RegisterAtlasMark(NPCPosition.bType, c_szName, NPCPosition.x, NPCPosition.y);
}
else {
CPythonMiniMap::Instance().RegisterAtlasMark(NPCPosition.bType, NPCPosition.name, NPCPosition.x, NPCPosition.y);
}
#else
CPythonMiniMap::Instance().RegisterAtlasMark(NPCPosition.bType, NPCPosition.name, NPCPosition.x, NPCPosition.y);
#endif
/* ********************************************************************************* */
#Server
packet.h
struct TNPCPosition
{
BYTE bType;
altına ekle
#if defined(BL_CLIENT_LOCALE_STRING_)
DWORD dwVnum;
#endif
/* ********************************************************************************* */
sectree_manager.h
struct npc_info
{
BYTE bType;
altına ekle
#if defined(BL_CLIENT_LOCALE_STRING_)
DWORD dwVnum;
#endif
arat
InsertNPCPosition(long lMapIndex, BYTE bType, const char* szName, long x, long y);
değiştir
#if defined(BL_CLIENT_LOCALE_STRING_)
void InsertNPCPosition(long lMapIndex, BYTE bType, DWORD dwVnum, const char* szName, long x, long y);
#else
void InsertNPCPosition(long lMapIndex, BYTE bType, const char* szName, long x, long y);
#endif
/* ********************************************************************************* */
sectree_manager.cpp
arat
SECTREE_MANAGER::SendNPCPosition(LPCHARACTER ch)
bul
for (it = m_mapNPCPosition[lMapIndex].begin(); it != m_mapNPCPosition[lMapIndex].end(); ++it)
{
np.bType = it->bType;
altına ekle
#if defined(BL_CLIENT_LOCALE_STRING_)
np.dwVnum = it->dwVnum;
#endif
arat
void SECTREE_MANAGER::InsertNPCPosition(long lMapIndex, BYTE bType, const char* szName, long x, long y)
fonksiyonu komple değiştir
#if defined(BL_CLIENT_LOCALE_STRING_)
void SECTREE_MANAGER::InsertNPCPosition(long lMapIndex, BYTE bType, DWORD dwVnum, const char* szName, long x, long y)
{
m_mapNPCPosition[lMapIndex].emplace_back(npc_info(bType, dwVnum, szName, x, y));
}
#else
void SECTREE_MANAGER::InsertNPCPosition(long lMapIndex, BYTE bType, const char* szName, long x, long y)
{
m_mapNPCPosition[lMapIndex].emplace_back(npc_info(bType, szName, x, y));
}
#endif
/* ********************************************************************************* */
regen.cpp
SECTREE_MANAGER::instance().InsertNPCPosition(lMapIndex,
p->m_table.bType,
altına ekle
#if defined(BL_CLIENT_LOCALE_STRING_)
p->m_table.dwVnum,
#endif
Kanıt: