Alles anzeigenFound the problem, for anyone else this happens
ClientManagerPlayer.cpp
Inside -> void CClientManager::__QUERY_PLAYER_DELETE
Comment Out / Delete:
(Don't know until what point it's safe)
Alles anzeigenCode
- // block for japan
- if (g_stLocale != "sjis")
- {
- if (strlen(r.social_id) < 7 || strncmp(packet->private_code, r.social_id + strlen(r.social_id) - 7, 7))
- {
- sys_log(0, "PLAYER_DELETE FAILED len(%d)", strlen(r.social_id));
- peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
- peer->EncodeBYTE(packet->account_index);
- return;
- }
- CPlayerTableCache * pkPlayerCache = GetPlayerCache(packet->player_id);
- if (pkPlayerCache)
- {
- TPlayerTable * pTab = pkPlayerCache->Get();
- if (pTab->level >= m_iPlayerDeleteLevelLimit)
- {
- sys_log(0, "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimit);
- peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
- peer->EncodeBYTE(packet->account_index);
- return;
- }
- if (pTab->level < m_iPlayerDeleteLevelLimitLower)
- {
- sys_log(0, "PLAYER_DELETE FAILED LEVEL %u < DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimitLower);
- peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
- peer->EncodeBYTE(packet->account_index);
- return;
- }
- }
- }
Hello guys i can't find where the problem is,
tried recreating player table with this
Tested this and works
syslog
db conf
ClientManager.cpp
ClientManagerPlayer
Code
- snprintf(queryStr, sizeof(queryStr), "INSERT INTO player_deleted%s SELECT * FROM player%s WHERE id=%d",
- GetTablePostfix(), GetTablePostfix(), pi->player_id);
- std::unique_ptr<SQLMsg> pIns(CDBManager::instance().DirectQuery(queryStr));
- void CClientManager::__QUERY_PLAYER_DELETE(CPeer* peer, DWORD dwHandle, TPlayerDeletePacket* packet)
- {
- if (!packet->login[0] || !packet->player_id || packet->account_index >= PLAYER_PER_ACCOUNT)
- return;
- CLoginData * ld = GetLoginDataByLogin(packet->login);
- if (!ld)
- {
- peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
- peer->EncodeBYTE(packet->account_index);
- return;
- }
- TAccountTable & r = ld->GetAccountRef();
- if (g_stLocale != "sjis")
- {
- if (strlen(r.social_id) < 7 || strncmp(packet->private_code, r.social_id + strlen(r.social_id) - 7, 7))
- {
- sys_log(0, "PLAYER_DELETE FAILED len(%d)", strlen(r.social_id));
- peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
- peer->EncodeBYTE(packet->account_index);
- return;
- }
- CPlayerTableCache * pkPlayerCache = GetPlayerCache(packet->player_id);
- if (pkPlayerCache)
- {
- TPlayerTable * pTab = pkPlayerCache->Get();
- if (pTab->level >= m_iPlayerDeleteLevelLimit)
- {
- sys_log(0, "PLAYER_DELETE FAILED LEVEL %u >= DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimit);
- peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
- peer->EncodeBYTE(packet->account_index);
- return;
- }
- if (pTab->level < m_iPlayerDeleteLevelLimitLower)
- {
- sys_log(0, "PLAYER_DELETE FAILED LEVEL %u < DELETE LIMIT %d", pTab->level, m_iPlayerDeleteLevelLimitLower);
- peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
- peer->EncodeBYTE(packet->account_index);
- return;
- }
- }
- }
- char szQuery[128];
- snprintf(szQuery, sizeof(szQuery), "SELECT p.id, p.level, p.name FROM player_index%s AS i, player%s AS p WHERE pid%u=%u AND pid%u=p.id",
- GetTablePostfix(), GetTablePostfix(), packet->account_index + 1, packet->player_id, packet->account_index + 1);
- ClientHandleInfo * pi = new ClientHandleInfo(dwHandle, packet->player_id);
- pi->account_index = packet->account_index;
- sys_log(0, "PLAYER_DELETE TRY: %s %d pid%d", packet->login, packet->player_id, packet->account_index + 1);
- CDBManager::instance().ReturnQuery(szQuery, QID_PLAYER_DELETE, peer->GetHandle(), pi);
- }