Jump to content

cubex33

Member
  • Content Count

    20
  • Joined

  • Last visited

  • Yangs

    0 [ Donate ]

Community Reputation

0 Neutral

About cubex33

  • Rank
    Neutral

Informations

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm still looking for someone to help me with my vote.php
  2. it doesnt work. my sysser: SYSERR: Feb 10 23:09:43 :: Start: TABLE_POSTFIX not configured use default SYSERR: Feb 10 23:09:44 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Table 'account.iptocountry' doesn't exist query: SELECT IP_FROM, IP_TO, COUNTRY_NAME FROM iptocountry SYSERR: Feb 10 23:09:44 :: Load: DirectQuery failed(SELECT IP_FROM, IP_TO, COUNTRY_NAME FROM iptocountry) SYSERR: Feb 10 23:10:18 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Column count doesn't match value count at row 1 query: INSERT INTO player (id, account_id, name, level, st, ht, dx, iq, job, voice, dir, x, y, z, hp, mp, random_hp, random_sp, horse_appearance, stat_point, stamina, part_base, part_main, part_hair, gold, playtime, skill_level, quickslot) VALUES(0, 1, 'ColaLight', 1, 5, 3, 3, 5, 2, 0, 0, 459846, 953644, 0, 770, 300, 0, 0, 0, 0, 800, 0, 0, 0, 0, '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ SYSERR: Feb 10 23:10:18 :: __QUERY_PLAYER_CREATE: QUERY_ERROR: UPDATE player_index SET pid2=0 WHERE id=1
  3. /* * PLAYER CREATE */ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerCreatePacket* packet) { char queryStr[QUERY_MAX_LEN]; int queryLen; int player_id; // 한 계정에 X초 내로 캐릭터 생성을 할 수 없다. time_by_id_map_t::iterator it = s_createTimeByAccountID.find(packet->account_id); if (it != s_createTimeByAccountID.end()) { time_t curtime = time(0); if (curtime - it->second < 30) { peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_FAILED, dwHandle, 0); return; } } queryLen = snprintf(queryStr, sizeof(queryStr), "SELECT pid%u FROM player_index%s WHERE id=%d", packet->account_index + 1, GetTablePostfix(), packet->account_id); std::auto_ptr<SQLMsg> pMsg0(CDBManager::instance().DirectQuery(queryStr)); if (pMsg0->Get()->uiNumRows != 0) { if (!pMsg0->Get()->pSQLResult) { peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_FAILED, dwHandle, 0); return; } MYSQL_ROW row = mysql_fetch_row(pMsg0->Get()->pSQLResult); DWORD dwPID = 0; str_to_number(dwPID, row[0]); if (row[0] && dwPID > 0) { peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_ALREADY, dwHandle, 0); sys_log(0, "ALREADY EXIST AccountChrIdx %d ID %d", packet->account_index, dwPID); return; } } else { peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_FAILED, dwHandle, 0); return; } if (g_stLocale == "sjis") snprintf(queryStr, sizeof(queryStr), "SELECT COUNT(*) as count FROM player%s WHERE name='%s' collate sjis_japanese_ci", GetTablePostfix(), packet->player_table.name); else snprintf(queryStr, sizeof(queryStr), "SELECT COUNT(*) as count FROM player%s WHERE name='%s'", GetTablePostfix(), packet->player_table.name); std::auto_ptr<SQLMsg> pMsg1(CDBManager::instance().DirectQuery(queryStr)); if (pMsg1->Get()->uiNumRows) { if (!pMsg1->Get()->pSQLResult) { peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_FAILED, dwHandle, 0); return; } MYSQL_ROW row = mysql_fetch_row(pMsg1->Get()->pSQLResult); if (*row[0] != '0') { sys_log(0, "ALREADY EXIST name %s, row[0] %s query %s", packet->player_table.name, row[0], queryStr); peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_ALREADY, dwHandle, 0); return; } } else { peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_FAILED, dwHandle, 0); return; } queryLen = snprintf(queryStr, sizeof(queryStr), "INSERT INTO player%s " "(id, account_id, name, level, st, ht, dx, iq, " "job, voice, dir, x, y, z, " "hp, mp, random_hp, random_sp, horse_appearance, stat_point, stamina, part_base, part_main, part_hair, gold, playtime, " "skill_level, quickslot) " "VALUES(0, %u, '%s', %d, %d, %d, %d, %d, " "%d, %d, %d, %d, %d, %d, %d, " "%d, %d, %d, %d, %d, %d, %d, 0, %d, 0, ", GetTablePostfix(), packet->account_id, packet->player_table.name, packet->player_table.level, packet->player_table.st, packet->player_table.ht, packet->player_table.dx, packet->player_table.iq, packet->player_table.job, packet->player_table.voice, packet->player_table.dir, packet->player_table.x, packet->player_table.y, packet->player_table.z, packet->player_table.hp, packet->player_table.sp, packet->player_table.sRandomHP, packet->player_table.sRandomSP, packet->player_table.sHorse_appearance, packet->player_table.stat_point, packet->player_table.stamina, packet->player_table.part_base, packet->player_table.part_base, packet->player_table.gold); sys_log(0, "PlayerCreate accountid %d name %s level %d gold %lld, st %d ht %d job %d", packet->account_id, packet->player_table.name, packet->player_table.level, packet->player_table.gold, packet->player_table.st, packet->player_table.ht, packet->player_table.job); static char text[4096 + 1]; CDBManager::instance().EscapeString(text, packet->player_table.skills, sizeof(packet->player_table.skills)); queryLen += snprintf(queryStr + queryLen, sizeof(queryStr) - queryLen, "'%s', ", text); if (g_test_server) sys_log(0, "Create_Player queryLen[%d] TEXT[%s]", queryLen, text); CDBManager::instance().EscapeString(text, packet->player_table.quickslot, sizeof(packet->player_table.quickslot)); queryLen += snprintf(queryStr + queryLen, sizeof(queryStr) - queryLen, "'%s')", text); std::auto_ptr<SQLMsg> pMsg2(CDBManager::instance().DirectQuery(queryStr)); if (g_test_server) sys_log(0, "Create_Player queryLen[%d] TEXT[%s]", queryLen, text); if (pMsg2->Get()->uiAffectedRows <= 0) { peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_ALREADY, dwHandle, 0); sys_log(0, "ALREADY EXIST3 query: %s AffectedRows %lu", queryStr, pMsg2->Get()->uiAffectedRows); return; } player_id = pMsg2->Get()->uiInsertID; snprintf(queryStr, sizeof(queryStr), "UPDATE player_index%s SET pid%d=%d WHERE id=%d", GetTablePostfix(), packet->account_index + 1, player_id, packet->account_id); std::auto_ptr<SQLMsg> pMsg3(CDBManager::instance().DirectQuery(queryStr)); if (pMsg3->Get()->uiAffectedRows <= 0) { sys_err("QUERY_ERROR: %s", queryStr); snprintf(queryStr, sizeof(queryStr), "DELETE FROM player%s WHERE id=%d", GetTablePostfix(), player_id); CDBManager::instance().DirectQuery(queryStr); peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_FAILED, dwHandle, 0); return; } TPacketDGCreateSuccess pack; memset(&pack, 0, sizeof(pack)); pack.bAccountCharacterIndex = packet->account_index; pack.player.dwID = player_id; strlcpy(pack.player.szName, packet->player_table.name, sizeof(pack.player.szName)); pack.player.byJob = packet->player_table.job; pack.player.byLevel = 1; pack.player.dwPlayMinutes = 0; pack.player.byST = packet->player_table.st; pack.player.byHT = packet->player_table.ht; pack.player.byDX = packet->player_table.dx; pack.player.byIQ = packet->player_table.iq; pack.player.wMainPart = packet->player_table.part_base; pack.player.x = packet->player_table.x; pack.player.y = packet->player_table.y; peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_SUCCESS, dwHandle, sizeof(TPacketDGCreateSuccess)); peer->Encode(&pack, sizeof(TPacketDGCreateSuccess)); sys_log(0, "7 name %s job %d", pack.player.szName, pack.player.byJob); s_createTimeByAccountID[packet->account_id] = time(0); }
  4. Yes queryLen = snprintf(queryStr, sizeof(queryStr), "INSERT INTO player%s " "(id, account_id, name, level, st, ht, dx, iq, " "job, voice, dir, x, y, z, " "hp, mp, random_hp, random_sp, horse_appearance, stat_point, stamina, part_base, part_main, part_hair, gold, playtime, " "skill_level, quickslot) " "VALUES(0, %u, '%s', %d, %d, %d, %d, %d, " "%d, %d, %d, %d, %d, %d, %d, " "%d, %d, %d, %d, %d, %d, %d, 0, %d, 0, ", GetTablePostfix(), packet->account_id, packet->player_table.name, packet->player_table.level, packet->player_table.st, packet->player_table.ht, packet->player_table.dx, packet->player_table.iq, packet->player_table.job, packet->player_table.voice, packet->player_table.dir, packet->player_table.x, packet->player_table.y, packet->player_table.z, packet->player_table.hp, packet->player_table.sp, packet->player_table.sRandomHP, packet->player_table.sRandomSP, packet->player_table.sHorse_appearance, packet->player_table.stat_point, packet->player_table.stamina, packet->player_table.part_base, packet->player_table.part_base, packet->player_table.gold); horse_appearance packet->player_table.sHorse_appearance, this is new
  5. Thank you for your help! https://pastebin.com/BPUHinZF
  6. Hello i have a bug, i have add this: this works, but i cant create a new character in the db sysser is that: SYSERR: Feb 10 15:33:15 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Column count doesn't match value count at row 1 query: INSERT INTO player (id, account_id, name, level, st, ht, dx, iq, job, voice, dir, x, y, z, hp, mp, random_hp, random_sp, horse_appearance, stat_point, stamina, part_base, part_main, part_hair, gold, playtime, skill_level, quickslot) VALUES(0, 2, 'hallooo', 1, 5, 3, 3, 5, 6, 0, 0, 459708, 954125, 0, 770, 300, 0, 0, 0, 0, 800, 0, 0, 0, 0, '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ SYSERR: Feb 10 15:33:15 :: __QUERY_PLAYER_CREATE: QUERY_ERROR: UPDATE player_index SET pid4=0 WHERE id=2 can someone help me pls?
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.