Stergere Caracter
Scris: Vin Mai 26, 2023 8:37 am
Salutare , stie cineva din ce cauza imi tot da eroare ca nu pot sterge caracterul?
Cod: Selectaţi tot
snprintf(queryStr, sizeof(queryStr), "INSERT INTO player%s_deleted SELECT * FROM player%s WHERE id=%d", GetTablePostfix(), GetTablePostfix(), pi->player_id);
Cod: Selectaţi tot
snprintf(queryStr, sizeof(queryStr), "INSERT INTO player_deleted%s SELECT * FROM player%s WHERE id=%d", GetTablePostfix(), GetTablePostfix(), pi->player_id);
ClientManagerPlayer.cpp: In member function 'void CClientManager::__RESULT_PLAYER_DELETE(CPeer*, SQLMsg*)':dominic17 scrie: ↑Vin Mai 26, 2023 10:53 pm 1.
Deci, ca sa modifici nivelul maxim pana la care se pot sterge caracterele faci astfel:
Te duci in : /usr/home/game/channels/db (sau cum ai tu), iar aici o sa gasesti un fisier numit: conf.txt
1. Il deschizi
2. Te duci la linia: PLAYER_DELETE_LEVEL_LIMIT = xx
3. Modifici xx (nivelul care e acolo) cu 70/80/100/105 (cat vrei tu) adica la final va arata asa:
PLAYER_DELETE_LEVEL_LIMIT = 105 (105 este un exemplu dat de mine, tu poti pune oricat)
Gata, acum dai un reboot sau close & start si poti testa.
2.
DACA AI SURSA LA EL.
Intra in: ClientManagerPlayer.cpp si cauta:Inlocuieste cu:Cod: Selectaţi tot
snprintf(queryStr, sizeof(queryStr), "INSERT INTO player%s_deleted SELECT * FROM player%s WHERE id=%d", GetTablePostfix(), GetTablePostfix(), pi->player_id);
Cod: Selectaţi tot
snprintf(queryStr, sizeof(queryStr), "INSERT INTO player_deleted%s SELECT * FROM player%s WHERE id=%d", GetTablePostfix(), GetTablePostfix(), pi->player_id);
Cod: Selectaţi tot
char queryStr[QUERY_MAX_LEN];
snprintf(queryStr, sizeof(queryStr), "INSERT INTO player%s_deleted SELECT * FROM player%s WHERE id=%d",
GetTablePostfix(), GetTablePostfix(), pi->player_id);
std::auto_ptr<SQLMsg> pIns(CDBManager::instance().DirectQuery(queryStr));
if (pIns->Get()->uiAffectedRows == 0 || pIns->Get()->uiAffectedRows == (uint32_t)-1)
{
sys_log(0, "PLAYER_DELETE FAILED %u CANNOT INSERT TO player%s_deleted", dwPID, GetTablePostfix());
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
peer->EncodeBYTE(pi->account_index);
return;
}]
Cod: Selectaţi tot
snprintf(queryStr, sizeof(queryStr), "INSERT INTO player_deleted%s SELECT * FROM player%s WHERE id=%d",
GetTablePostfix(), GetTablePostfix(), pi->player_id);
std::auto_ptr<SQLMsg> pIns(CDBManager::instance().DirectQuery(queryStr));
if (pIns->Get()->uiAffectedRows == 0 || pIns->Get()->uiAffectedRows == (uint32_t)-1)
{
sys_log(0, "PLAYER_DELETE FAILED %u CANNOT INSERT TO player_deleted%s", dwPID, GetTablePostfix());
peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
peer->EncodeBYTE(pi->account_index);
return;
}
Cod: Selectaţi tot
player%s_deleted
Cod: Selectaţi tot
player_deleted%s
Deci daca nu functioneaza nici varianta de mai sus nici sa modifici din db conf.txt (limita de stergere a caracterului).
Nici asta nu functioneazaRazVan scrie: ↑Joi Iun 01, 2023 7:20 pmDeci daca nu functioneaza nici varianta de mai sus nici sa modifici din db conf.txt (limita de stergere a caracterului).
Intra in navicat -> player si sterge player_deleted dupa carare apasa ctrl+q si scrie CREATE TABLE player_deleted LIKE player; apesi pe butonul Run din stanga cu verde si dai reboot.