AD: Mt2009 - Mobile & PC - 30 January 2026 CHECK THE PRESENTATION!
hello everyone, I'm asking for help, I've installed sanii switchbot
but I can't drag items into the window, yes I've checked my ClientManagerPlayer.cpp
and it matches the database, can someone please help me and no, there is no sysrr or anything like that unfortunately
here is an excerpt from ClientManagerPlayer.cpp :
Client Source - GameType.h :
I ask for help thank you
but I can't drag items into the window, yes I've checked my ClientManagerPlayer.cpp
and it matches the database, can someone please help me and no, there is no sysrr or anything like that unfortunately
here is an excerpt from ClientManagerPlayer.cpp :
void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoadPacket * packet)
{
CPlayerTableCache * c;
TPlayerTable * pTab;
CLoginData * pLoginData = GetLoginDataByAID(packet->account_id);
if (pLoginData)
{
for (int n = 0; n < PLAYER_PER_ACCOUNT; ++n)
if (pLoginData->GetAccountRef().players[n].dwID != 0)
DeleteLogoutPlayer(pLoginData->GetAccountRef().players[n].dwID);
}
if ((c = GetPlayerCache(packet->player_id)))
{
CLoginData * pkLD = GetLoginDataByAID(packet->account_id);
if (!pkLD || pkLD->IsPlay())
{
sys_log(0, "PLAYER_LOAD_ERROR: LoginData %p IsPlay %d", pkLD, pkLD ? pkLD->IsPlay() : 0);
peer->EncodeHeader(HEADER_DG_PLAYER_LOAD_FAILED, dwHandle, 0);
return;
}
pTab = c->Get();
pkLD->SetPlay(true);
thecore_memcpy(pTab->aiPremiumTimes, pkLD->GetPremiumPtr(), sizeof(pTab->aiPremiumTimes));
peer->EncodeHeader(HEADER_DG_PLAYER_LOAD_SUCCESS, dwHandle, sizeof(TPlayerTable));
peer->Encode(pTab, sizeof(TPlayerTable));
if (packet->player_id != pkLD->GetLastPlayerID())
{
TPacketNeedLoginLogInfo logInfo;
logInfo.dwPlayerID = packet->player_id;
pkLD->SetLastPlayerID( packet->player_id );
peer->EncodeHeader( HEADER_DG_NEED_LOGIN_LOG, dwHandle, sizeof(TPacketNeedLoginLogInfo) );
peer->Encode( &logInfo, sizeof(TPacketNeedLoginLogInfo) );
}
char szQuery[1024] = { 0, };
TItemCacheSet * pSet = GetItemCacheSet(pTab->id);
sys_log(0, "[PLAYER_LOAD] ID %s pid %d gold %lld ", pTab->name, pTab->id, pTab->gold);
if (pSet)
{
static std::vector<TPlayerItem> s_items;
s_items.resize(pSet->size());
DWORD dwCount = 0;
TItemCacheSet::iterator it = pSet->begin();
while (it != pSet->end())
{
CItemCache * c = *it++;
TPlayerItem * p = c->Get();
if (p->vnum)
thecore_memcpy(&s_items[dwCount++], p, sizeof(TPlayerItem));
}
if (g_test_server)
sys_log(0, "ITEM_CACHE: HIT! %s count: %u", pTab->name, dwCount);
peer->EncodeHeader(HEADER_DG_ITEM_LOAD, dwHandle, sizeof(DWORD) + sizeof(TPlayerItem) * dwCount);
peer->EncodeDWORD(dwCount);
if (dwCount)
peer->Encode(&s_items[0], sizeof(TPlayerItem) * dwCount);
snprintf(szQuery, sizeof(szQuery),
"SELECT dwPID,szName,szState,lValue FROM quest%s WHERE dwPID=%d AND lValue<>0",
GetTablePostfix(), pTab->id);
CDBManager::instance().ReturnQuery(szQuery, QID_QUEST, peer->GetHandle(), new ClientHandleInfo(dwHandle,0,packet->account_id));
snprintf(szQuery, sizeof(szQuery),
"SELECT dwPID,bType,bApplyOn,lApplyValue,dwFlag,lDuration,lSPCost FROM affect%s WHERE dwPID=%d",
GetTablePostfix(), pTab->id);
CDBManager::instance().ReturnQuery(szQuery, QID_AFFECT, peer->GetHandle(), new ClientHandleInfo(dwHandle, pTab->id));
}
else
{
snprintf(szQuery, sizeof(szQuery),
"SELECT "
"id,"
"window+0,"
"pos,"
"count,"
"vnum,"
"socket0,socket1,socket2,"
"attrtype0,attrvalue0,"
"attrtype1,attrvalue1,"
"attrtype2,attrvalue2,"
"attrtype3,attrvalue3,"
"attrtype4,attrvalue4,"
"attrtype5,attrvalue5,"
"attrtype6,attrvalue6 "
"FROM item%s "
"WHERE owner_id=%d AND (window < %d OR window = %d"
#ifdef ENABLE_SWITCHBOT
" OR window = %d",
#else
")",
#endif
GetTablePostfix(),
pTab->id,
SAFEBOX,
DRAGON_SOUL_INVENTORY,
BELT_INVENTORY,
#ifdef ENABLE_SWITCHBOT
, SWITCHBOT
#endif
);
CDBManager::instance().ReturnQuery(szQuery,
QID_ITEM,
peer->GetHandle(),
new ClientHandleInfo(dwHandle, pTab->id));
snprintf(szQuery, sizeof(szQuery),
"SELECT dwPID, szName, szState, lValue FROM quest%s WHERE dwPID=%d",
GetTablePostfix(), pTab->id);
CDBManager::instance().ReturnQuery(szQuery,
QID_QUEST,
peer->GetHandle(),
new ClientHandleInfo(dwHandle, pTab->id));
snprintf(szQuery, sizeof(szQuery),
"SELECT dwPID, bType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost FROM affect%s WHERE dwPID=%d",
GetTablePostfix(), pTab->id);
CDBManager::instance().ReturnQuery(szQuery, QID_AFFECT, peer->GetHandle(), new ClientHandleInfo(dwHandle, pTab->id));
}
}
else
{
sys_log(0, "[PLAYER_LOAD] Load from PlayerDB pid[%d]", packet->player_id);
char queryStr[QUERY_MAX_LEN];
snprintf(queryStr, sizeof(queryStr),
"SELECT "
"id,name,job,voice,dir,x,y,z,map_index,exit_x,exit_y,exit_map_index,hp,mp,stamina,random_hp,random_sp,playtime,"
"gold,level,level_step,st,ht,dx,iq,exp,"
"stat_point,skill_point,sub_skill_point,stat_reset_count,part_base,part_hair,"
"part_acce,"
"skill_level,quickslot,skill_group,alignment,horse_level,horse_riding,horse_hp,horse_hp_droptime,horse_stamina,"
"UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(last_play),horse_skill_point FROM player%s WHERE id=%d",
GetTablePostfix(), packet->player_id);
ClientHandleInfo * pkInfo = new ClientHandleInfo(dwHandle, packet->player_id);
pkInfo->account_id = packet->account_id;
CDBManager::instance().ReturnQuery(queryStr, QID_PLAYER, peer->GetHandle(), pkInfo);
snprintf(queryStr, sizeof(queryStr),
"SELECT "
"id,"
"window+0,"
"pos,"
"count,"
"vnum,"
"socket0,socket1,socket2,"
"attrtype0,attrvalue0,"
"attrtype1,attrvalue1,"
"attrtype2,attrvalue2,"
"attrtype3,attrvalue3,"
"attrtype4,attrvalue4,"
"attrtype5,attrvalue5,"
"attrtype6,attrvalue6 "
"FROM item%s "
"WHERE owner_id=%d AND (window < %d OR window = %d"
#ifdef ENABLE_SWITCHBOT
" OR window = %d",
#else
")",
#endif
GetTablePostfix(),
packet->player_id,
SAFEBOX,
DRAGON_SOUL_INVENTORY,
BELT_INVENTORY
#ifdef ENABLE_SWITCHBOT
, SWITCHBOT
#endif
);
CDBManager::instance().ReturnQuery(queryStr, QID_ITEM, peer->GetHandle(), new ClientHandleInfo(dwHandle, packet->player_id));
snprintf(queryStr, sizeof(queryStr),
"SELECT dwPID,szName,szState,lValue FROM quest%s WHERE dwPID=%d",
GetTablePostfix(), packet->player_id);
CDBManager::instance().ReturnQuery(queryStr, QID_QUEST, peer->GetHandle(), new ClientHandleInfo(dwHandle, packet->player_id,packet->account_id));
snprintf(queryStr, sizeof(queryStr),
"SELECT dwPID,bType,bApplyOn,lApplyValue,dwFlag,lDuration,lSPCost FROM affect%s WHERE dwPID=%d",
GetTablePostfix(), packet->player_id);
CDBManager::instance().ReturnQuery(queryStr, QID_AFFECT, peer->GetHandle(), new ClientHandleInfo(dwHandle, packet->player_id));
}
}
Client Source - GameType.h :
I ask for help thank you




