Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Pakowanie przekonwertowanego proto / problem.


.imaguś.

Rekomendowane odpowiedzi

Opublikowano

Cześć, mam problem z przekonwertowanym item proto, mianowicie cały klient bazuje na starszych plikach, root - locale - uiscript są z terenzo, mniejsza. 

Przy pakowaniu itemproto mam problem z:

item_proto.txt (line 4011): size error [34 != 33]

Ok, poprawiam to.

Chcę spakować jeszcze raz i:

Nastąpiło przepełnienie w czasie wykonywania operacji arytmetycznej.

Próbowałem już chyba wszystkimi metodami, a podobnych tematów nie znalazłem.

would u miss me? 1105814451671351221478.png

 

 

 

Opublikowano

Mam Ci napisać poradnik jak zmienić tryb kodowania w notepadzie? xD

Skoro takiej rzeczy nie potrafisz to nie bierz się za to :P

ah, chodziło ci o kodowanie w notepadzie, to trzeba było z góry pisać, i nie, to też nie pomaga

­

would u miss me? 1105814451671351221478.png

 

 

 

Opublikowano

Poprawione InitializeItemTable,
Powinno wtedy pójść :)
 

bool CClientManager::InitializeItemTable()
{
	std::ostringstream query;
	query << "SELECT vnum, type, subtype, name, " << g_stLocaleNameColumn << ", gold, shop_buy_price, weight, size, flag, wearflag, antiflag, immuneflag+0, refined_vnum, refine_set, magic_pct, socket_pct, addon_type, limittype0, limitvalue0, limittype1, limitvalue1, applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, value0, value1, value2, value3, value4, value5, vnum_range, socket0, socket1, socket2 FROM item_proto ORDER BY vnum";
	SQLMsg* sqlMsg = CDBManager::instance().DirectQuery(query.str().c_str(), 0);
	if (sqlMsg == NULL) {
		sys_err("ClientManagerBoot::InitializeItemTable", __LINE__, "Could not load item_proto. Query failed!");
		return false;
	}

	MYSQL_RES* pRes = sqlMsg->vec_pkResult[0]->pSQLResult;

	if (pRes == NULL) {
		sys_err("ClientManagerBoot::InitializeItemTable", __LINE__, "Could not load item_proto. No result!");
		return 0;
	}

	if (!m_vec_itemTable.empty()) {
		sys_log(__LINE__, " Reloading item_proto");
		m_vec_itemTable.clear();
	}
	MYSQL_ROW row;
	while ((row = mysql_fetch_row(pRes))) {
		//SItemTable temp = {};
		SItemTable temp;
		memset(&temp, 0, sizeof(temp));
		if (row[0]&&*row[0]) temp.dwVnum = strtoul(row[0], NULL, 10);
		if (row[1]&&*row[1]) temp.bType = strtoul(row[1], NULL, 10);
		if (row[2]&&*row[2]) temp.bSubType = strtoul(row[2], NULL, 10);
		if (row[3]&&*row[3]) snprintf(temp.szName, 25, "%s", row[3]);
		if (row[4]&&*row[4]) snprintf(temp.szLocaleName, 25, "%s", row[4]);
		if (row[5]&&*row[5]) temp.dwGold = strtoul(row[5], NULL, 10);
		if (row[6]&&*row[6]) temp.dwShopBuyPrice = strtoul(row[6], NULL, 10);
		if (row[7]&&*row[7]) temp.bWeight = strtoul(row[7], NULL, 10);
		if (row[8]&&*row[8]) temp.bSize = strtoul(row[8], NULL, 10);
		if (row[9]&&*row[9]) temp.dwFlags = strtoul(row[9], NULL, 10);
		if (row[10]&&*row[10]) temp.dwWearFlags = strtoul(row[10], NULL, 10);
		if (row[11]&&*row[11]) temp.dwAntiFlags = strtoul(row[11], NULL, 10);
		if (row[12]&&*row[12]) temp.dwImmuneFlag = strtoul(row[12], NULL, 10);
		if (row[13]&&*row[13]) temp.dwRefinedVnum = strtoul(row[13], NULL, 10);
		if (row[14]&&*row[14]) temp.wRefineSet = strtoul(row[14], NULL, 10);
		if (row[15]&&*row[15]) temp.bAlterToMagicItemPct = strtoul(row[15], NULL, 10);
		if (row[16]&&*row[16]) temp.bGainSocketPct = strtoul(row[16], NULL, 10);
		if (row[17]&&*row[17]) temp.sAddonType = strtoul(row[17], NULL, 10);
		if (row[18]&&*row[18]) temp.aLimits[0].bType = strtoul(row[18], NULL, 10);
		if (row[19]&&*row[19]) temp.aLimits[0].lValue = strtoul(row[19], NULL, 10);
		if (row[20]&&*row[20]) temp.aLimits[1].bType = strtoul(row[20], NULL, 10);
		if (row[21]&&*row[21]) temp.aLimits[1].lValue = strtoul(row[21], NULL, 10);
		if (row[22]&&*row[22]) temp.aApplies[0].bType = strtoul(row[22], NULL, 10);
		if (row[23]&&*row[23]) temp.aApplies[0].lValue = strtoul(row[23], NULL, 10);
		if (row[24]&&*row[24]) temp.aApplies[1].bType = strtoul(row[24], NULL, 10);
		if (row[25]&&*row[25]) temp.aApplies[1].lValue = strtoul(row[25], NULL, 10);
		if (row[26]&&*row[26]) temp.aApplies[2].bType = strtoul(row[26], NULL, 10);
		if (row[27]&&*row[27]) temp.aApplies[2].lValue = strtoul(row[27], NULL, 10);
		if (row[28]&&*row[28]) temp.alValues[0] = strtoul(row[28], NULL, 10);
		if (row[29]&&*row[29]) temp.alValues[1] = strtoul(row[29], NULL, 10);
		if (row[30]&&*row[30]) temp.alValues[2] = strtoul(row[30], NULL, 10);
		if (row[31]&&*row[31]) temp.alValues[3] = strtoul(row[31], NULL, 10);
		if (row[32]&&*row[32]) temp.alValues[4] = strtoul(row[32], NULL, 10);
		if (row[33]&&*row[33]) temp.alValues[5] = strtoul(row[33], NULL, 10);
		if (row[34]&&*row[34]) temp.dwVnumRange = strtoul(row[34], NULL, 10);

		temp.cLimitRealTimeFirstUseIndex = -1;
		temp.cLimitTimerBasedOnWearIndex = -1;
		for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i) {
			if (LIMIT_REAL_TIME_START_FIRST_USE == temp.aLimits[i].bType)
				temp.cLimitRealTimeFirstUseIndex = (char) i;

			if (LIMIT_TIMER_BASED_ON_WEAR == temp.aLimits[i].bType)
				temp.cLimitTimerBasedOnWearIndex = (char) i;
		}
		m_vec_itemTable.push_back(temp);
	}
	std::cout << "CClientManager::InitializeItemTable:: " << m_vec_itemTable.size() << " items loaded." << std::endl;
	mysql_free_result(pRes);
	m_map_itemTableByVnum.clear();

	itertype(m_vec_itemTable) it = m_vec_itemTable.begin();

	while (it != m_vec_itemTable.end()) {
		TItemTable * item_table = &(*(it++));

		sys_log(1, "ITEM: #%-5lu %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %lu ANTI %lu IMMUNE %lu REFINE %lu REFINE_SET %u MAGIC_PCT %u",
				item_table->dwVnum,
				item_table->szName,
				item_table->szLocaleName,
				item_table->alValues[0],
				item_table->alValues[1],
				item_table->alValues[2],
				item_table->alValues[3],
				item_table->alValues[4],
				item_table->alValues[5],
				item_table->dwWearFlags,
				item_table->dwAntiFlags,
				item_table->dwImmuneFlag,
				item_table->dwRefinedVnum,
				item_table->wRefineSet,
				item_table->bAlterToMagicItemPct);

		m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
	}
	sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum());
	return true;
}
Opublikowano

 

Poprawione InitializeItemTable,

Powinno wtedy pójść :)

 

bool CClientManager::InitializeItemTable()
{
	std::ostringstream query;
	query << "SELECT vnum, type, subtype, name, " << g_stLocaleNameColumn << ", gold, shop_buy_price, weight, size, flag, wearflag, antiflag, immuneflag+0, refined_vnum, refine_set, magic_pct, socket_pct, addon_type, limittype0, limitvalue0, limittype1, limitvalue1, applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, value0, value1, value2, value3, value4, value5, vnum_range, socket0, socket1, socket2 FROM item_proto ORDER BY vnum";
	SQLMsg* sqlMsg = CDBManager::instance().DirectQuery(query.str().c_str(), 0);
	if (sqlMsg == NULL) {
		sys_err("ClientManagerBoot::InitializeItemTable", __LINE__, "Could not load item_proto. Query failed!");
		return false;
	}

	MYSQL_RES* pRes = sqlMsg->vec_pkResult[0]->pSQLResult;

	if (pRes == NULL) {
		sys_err("ClientManagerBoot::InitializeItemTable", __LINE__, "Could not load item_proto. No result!");
		return 0;
	}

	if (!m_vec_itemTable.empty()) {
		sys_log(__LINE__, " Reloading item_proto");
		m_vec_itemTable.clear();
	}
	MYSQL_ROW row;
	while ((row = mysql_fetch_row(pRes))) {
		//SItemTable temp = {};
		SItemTable temp;
		memset(&temp, 0, sizeof(temp));
		if (row[0]&&*row[0]) temp.dwVnum = strtoul(row[0], NULL, 10);
		if (row[1]&&*row[1]) temp.bType = strtoul(row[1], NULL, 10);
		if (row[2]&&*row[2]) temp.bSubType = strtoul(row[2], NULL, 10);
		if (row[3]&&*row[3]) snprintf(temp.szName, 25, "%s", row[3]);
		if (row[4]&&*row[4]) snprintf(temp.szLocaleName, 25, "%s", row[4]);
		if (row[5]&&*row[5]) temp.dwGold = strtoul(row[5], NULL, 10);
		if (row[6]&&*row[6]) temp.dwShopBuyPrice = strtoul(row[6], NULL, 10);
		if (row[7]&&*row[7]) temp.bWeight = strtoul(row[7], NULL, 10);
		if (row[8]&&*row[8]) temp.bSize = strtoul(row[8], NULL, 10);
		if (row[9]&&*row[9]) temp.dwFlags = strtoul(row[9], NULL, 10);
		if (row[10]&&*row[10]) temp.dwWearFlags = strtoul(row[10], NULL, 10);
		if (row[11]&&*row[11]) temp.dwAntiFlags = strtoul(row[11], NULL, 10);
		if (row[12]&&*row[12]) temp.dwImmuneFlag = strtoul(row[12], NULL, 10);
		if (row[13]&&*row[13]) temp.dwRefinedVnum = strtoul(row[13], NULL, 10);
		if (row[14]&&*row[14]) temp.wRefineSet = strtoul(row[14], NULL, 10);
		if (row[15]&&*row[15]) temp.bAlterToMagicItemPct = strtoul(row[15], NULL, 10);
		if (row[16]&&*row[16]) temp.bGainSocketPct = strtoul(row[16], NULL, 10);
		if (row[17]&&*row[17]) temp.sAddonType = strtoul(row[17], NULL, 10);
		if (row[18]&&*row[18]) temp.aLimits[0].bType = strtoul(row[18], NULL, 10);
		if (row[19]&&*row[19]) temp.aLimits[0].lValue = strtoul(row[19], NULL, 10);
		if (row[20]&&*row[20]) temp.aLimits[1].bType = strtoul(row[20], NULL, 10);
		if (row[21]&&*row[21]) temp.aLimits[1].lValue = strtoul(row[21], NULL, 10);
		if (row[22]&&*row[22]) temp.aApplies[0].bType = strtoul(row[22], NULL, 10);
		if (row[23]&&*row[23]) temp.aApplies[0].lValue = strtoul(row[23], NULL, 10);
		if (row[24]&&*row[24]) temp.aApplies[1].bType = strtoul(row[24], NULL, 10);
		if (row[25]&&*row[25]) temp.aApplies[1].lValue = strtoul(row[25], NULL, 10);
		if (row[26]&&*row[26]) temp.aApplies[2].bType = strtoul(row[26], NULL, 10);
		if (row[27]&&*row[27]) temp.aApplies[2].lValue = strtoul(row[27], NULL, 10);
		if (row[28]&&*row[28]) temp.alValues[0] = strtoul(row[28], NULL, 10);
		if (row[29]&&*row[29]) temp.alValues[1] = strtoul(row[29], NULL, 10);
		if (row[30]&&*row[30]) temp.alValues[2] = strtoul(row[30], NULL, 10);
		if (row[31]&&*row[31]) temp.alValues[3] = strtoul(row[31], NULL, 10);
		if (row[32]&&*row[32]) temp.alValues[4] = strtoul(row[32], NULL, 10);
		if (row[33]&&*row[33]) temp.alValues[5] = strtoul(row[33], NULL, 10);
		if (row[34]&&*row[34]) temp.dwVnumRange = strtoul(row[34], NULL, 10);

		temp.cLimitRealTimeFirstUseIndex = -1;
		temp.cLimitTimerBasedOnWearIndex = -1;
		for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i) {
			if (LIMIT_REAL_TIME_START_FIRST_USE == temp.aLimits[i].bType)
				temp.cLimitRealTimeFirstUseIndex = (char) i;

			if (LIMIT_TIMER_BASED_ON_WEAR == temp.aLimits[i].bType)
				temp.cLimitTimerBasedOnWearIndex = (char) i;
		}
		m_vec_itemTable.push_back(temp);
	}
	std::cout << "CClientManager::InitializeItemTable:: " << m_vec_itemTable.size() << " items loaded." << std::endl;
	mysql_free_result(pRes);
	m_map_itemTableByVnum.clear();

	itertype(m_vec_itemTable) it = m_vec_itemTable.begin();

	while (it != m_vec_itemTable.end()) {
		TItemTable * item_table = &(*(it++));

		sys_log(1, "ITEM: #%-5lu %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %lu ANTI %lu IMMUNE %lu REFINE %lu REFINE_SET %u MAGIC_PCT %u",
				item_table->dwVnum,
				item_table->szName,
				item_table->szLocaleName,
				item_table->alValues[0],
				item_table->alValues[1],
				item_table->alValues[2],
				item_table->alValues[3],
				item_table->alValues[4],
				item_table->alValues[5],
				item_table->dwWearFlags,
				item_table->dwAntiFlags,
				item_table->dwImmuneFlag,
				item_table->dwRefinedVnum,
				item_table->wRefineSet,
				item_table->bAlterToMagicItemPct);

		m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
	}
	sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum());
	return true;
}

tyle ze ja jestem na game a nie na source

­

would u miss me? 1105814451671351221478.png

 

 

 

Opublikowano

­a czym rozpakowujesz item proto ? 

epack32 ale chce spakować przekonwertowane item proto w txt z sql do item proto klientowego

would u miss me? 1105814451671351221478.png

 

 

 

Opublikowano

ciężko będzie, a w epack32 masz dwie opc­je w zakładce "other" i tam jest size of 15X, tak tylko na marginesie.

 

Co do convertu no to lipa.. a czym convertujesz? toolem od terenzo?

Opublikowano

ciężko będzie, a w epack32 masz dwie opc­je w zakładce "other" i tam jest size of 15X, tak tylko na marginesie.

 

Co do convertu no to lipa.. a czym convertujesz? toolem od terenzo?

tak, wiesz wydaje mi sie że to ze względu na inne "funkcje" (?) nie wiem jak to profesjonalniej nazwać, po prostu zamiast np. "COSTUME_BODY" (nowsze) to w moim starszym item proto jest zupełnie inna funkcja, wydaje mi sie ze przez to 

­

would u miss me? 1105814451671351221478.png

 

 

 

Gość Lajk™
Opublikowano

Cześć, mam problem z przekonwertowanym item proto, mianowicie cały klient bazuje na starszych plikach, root - locale - uiscript są z terenzo, mniejsza. 

Przy pakowaniu itemproto mam problem z:

item_proto.txt (line 4011): size error [34 != 33]

Ok, poprawiam to.

Chcę spakować jeszcze raz i:

Nastąpiło przepełnienie w czasie wykonywania operacji arytmetycznej.

Próbowałem już chyba wszystkimi metodami, a podobnych tematów nie znalazłem.

item_proto.txt (line 4011): size error [34 != 33] Linijka 4011 coś ma 34 znaki (pewnie nazwa jeśli sie nie myle) a powinno mieć 33 :v

CHYBA że się myle ;d

­

  • 2 tygodnie później...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...