Jump to content
  • 0
Sign in to follow this  
Originale

Show me the message files .txt

Question

Just show me the message files. txt
 
bool CClientManager::InitializeMobTable()
bool CClientManager::InitializeMobTable()
{
	//================== ÇÔ¼ö ¼³¸í ==================//
	//1. ¿ä¾à : 'mob_proto.txt', 'mob_proto_test.txt', 'mob_names.txt' ÆÄÀÏÀ» Àаí,
	//		(!)[mob_table] Å×ÀÌºí ¿ÀºêÁ§Æ®¸¦ »ý¼ºÇÑ´Ù. (ŸÀÔ : TMobTable)
	//2. ¼ø¼­
	//	1) 'mob_names.txt' ÆÄÀÏÀ» Àо (a)[localMap](vnum:name) ¸ÊÀ» ¸¸µç´Ù.
	//	2) 'mob_proto_test.txt'ÆÄÀÏ°ú (a)[localMap] ¸ÊÀ¸·Î
	//		([test_map_mobTableByVnum](vnum:TMobTable) ¸ÊÀ» »ý¼ºÇÑ´Ù.
	//	3) 'mob_proto.txt' ÆÄÀÏ°ú  (a)[localMap] ¸ÊÀ¸·Î
	//		(!)[mob_table] Å×À̺íÀ» ¸¸µç´Ù.
	//			<Âü°í>
	//			°¢ row µé Áß, 
	//			([test_map_mobTableByVnum],(!)[mob_table] ¸ðµÎ¿¡ ÀÖ´Â row´Â
	//			([test_map_mobTableByVnum]ÀÇ °ÍÀ» »ç¿ëÇÑ´Ù.
	//	4) ([test_map_mobTableByVnum]ÀÇ rowÁß, (!)[mob_table]¿¡ ¾ø´Â °ÍÀ» Ãß°¡ÇÑ´Ù.
	//3. Å×½ºÆ®
	//	1)'mob_proto.txt' Á¤º¸°¡ mob_table¿¡ Àß µé¾î°¬´ÂÁö. -> ¿Ï·á
	//	2)'mob_names.txt' Á¤º¸°¡ mob_table¿¡ Àß µé¾î°¬´ÂÁö.
	//	3)'mob_proto_test.txt' ¿¡¼­ [°ãÄ¡´Â] Á¤º¸°¡ mob_table ¿¡ Àß µé¾î°¬´ÂÁö.
	//	4)'mob_proto_test.txt' ¿¡¼­ [»õ·Î¿î] Á¤º¸°¡ mob_table ¿¡ Àß µé¾î°¬´ÂÁö.
	//	5) (ÃÖÁ¾) °ÔÀÓ Å¬¶óÀ̾ðÆ®¿¡¼­ Á¦´ë·Î ÀÛµ¿ ÇÏ´ÂÁö.
	//_______________________________________________//


	//===============================================//
	//	1) 'mob_names.txt' ÆÄÀÏÀ» Àо (a)[localMap] ¸ÊÀ» ¸¸µç´Ù.
	//<(a)localMap ¸Ê »ý¼º>
	map<int,const char*> localMap;
	//bool isNameFile = true;
	//<ÆÄÀÏ Àбâ>
	cCsvTable nameData;
	if(!nameData.Load("mob_names.txt",'t'))
	{
		fprintf(stderr, "Could not load mob_names.txtn");
		//isNameFile = false;
	} else {
		nameData.Next();	//¼³¸írow »ý·«.
		while(nameData.Next()) {
			localMap[atoi(nameData.AsStringByIndex(0))] = nameData.AsStringByIndex(1);
		}
	}
	//________________________________________________//

	cCsvTable data;
	if(!data.Load("mob_proto.txt",'t'))
	{
		fprintf(stderr, "Could not load mob_proto.txt. Wrong file format?n");
		return false;
	}
	data.Next(); //¸Ç À­ÁÙ Á¦¿Ü (¾ÆÀÌÅÛ Ä®·³À» ¼³¸íÇÏ´Â ºÎºÐ)
	//2.2 Å©±â¿¡ ¸Â°Ô mob_table »ý¼º
	if (!m_vec_mobTable.empty())
	{
		sys_log(0, "RELOAD: mob_proto");
		m_vec_mobTable.clear();
	}
	m_vec_mobTable.resize(data.m_File.GetRowCount()-1);
	memset(&m_vec_mobTable[0], 0, sizeof(TMobTable) * m_vec_mobTable.size());
	TMobTable * mob_table = &m_vec_mobTable[0];
	//2.3 µ¥ÀÌÅÍ Ã¤¿ì±â
	while (data.Next())
	{
		
		if (!Set_Proto_Mob_Table(mob_table, data, localMap))
		{
			fprintf(stderr, "Could not process entry.n");			
		}

		sys_log(1, "MOB #%-5d %-24s %-24s level: %-3u rank: %u empire: %d", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
		++mob_table;

	}
	//_____________________________________________________//


	sort(m_vec_mobTable.begin(), m_vec_mobTable.end(), FCompareVnum());
	return true;
}

and

 

bool CClientManager::InitializeItemTable()
 

bool CClientManager::InitializeItemTable()
{
	//================== ÇÔ¼ö ¼³¸í ==================//
	//1. ¿ä¾à : 'item_proto.txt', 'item_proto_test.txt', 'item_names.txt' ÆÄÀÏÀ» Àаí,
	//		<item_table>(TItemTable), <m_map_itemTableByVnum> ¿ÀºêÁ§Æ®¸¦ »ý¼ºÇÑ´Ù.
	//2. ¼ø¼­
	//	1) 'item_names.txt' ÆÄÀÏÀ» Àо (a)[localMap](vnum:name) ¸ÊÀ» ¸¸µç´Ù.
	//	2) 'item_proto_text.txt'ÆÄÀÏ°ú (a)[localMap] ¸ÊÀ¸·Î
	//		([test_map_itemTableByVnum](vnum:TItemTable) ¸ÊÀ» »ý¼ºÇÑ´Ù.
	//	3) 'item_proto.txt' ÆÄÀÏ°ú  (a)[localMap] ¸ÊÀ¸·Î
	//		(!)[item_table], <m_map_itemTableByVnum>À» ¸¸µç´Ù.
	//			<Âü°í>
	//			°¢ row µé Áß, 
	//			([test_map_itemTableByVnum],(!)[mob_table] ¸ðµÎ¿¡ ÀÖ´Â row´Â
	//			([test_map_itemTableByVnum]ÀÇ °ÍÀ» »ç¿ëÇÑ´Ù.
	//	4) ([test_map_itemTableByVnum]ÀÇ rowÁß, (!)[item_table]¿¡ ¾ø´Â °ÍÀ» Ãß°¡ÇÑ´Ù.
	//3. Å×½ºÆ®
	//	1)'item_proto.txt' Á¤º¸°¡ item_table¿¡ Àß µé¾î°¬´ÂÁö. -> ¿Ï·á
	//	2)'item_names.txt' Á¤º¸°¡ item_table¿¡ Àß µé¾î°¬´ÂÁö.
	//	3)'item_proto_test.txt' ¿¡¼­ [°ãÄ¡´Â] Á¤º¸°¡ item_table ¿¡ Àß µé¾î°¬´ÂÁö.
	//	4)'item_proto_test.txt' ¿¡¼­ [»õ·Î¿î] Á¤º¸°¡ item_table ¿¡ Àß µé¾î°¬´ÂÁö.
	//	5) (ÃÖÁ¾) °ÔÀÓ Å¬¶óÀ̾ðÆ®¿¡¼­ Á¦´ë·Î ÀÛµ¿ ÇÏ´ÂÁö.
	//_______________________________________________//



	//=================================================================================//
	//	1) 'item_names.txt' ÆÄÀÏÀ» Àо (a)[localMap](vnum:name) ¸ÊÀ» ¸¸µç´Ù.
	//=================================================================================//
	//bool isNameFile = true;
	map<int,const char*> localMap;
	cCsvTable nameData;
	if(!nameData.Load("item_names.txt",'t'))
	{
		fprintf(stderr, "Could not load item_names.txt.n");
		//isNameFile = false;
	} else {
		nameData.Next();
		while(nameData.Next()) {
			localMap[atoi(nameData.AsStringByIndex(0))] = nameData.AsStringByIndex(1);
		}
	}
	//_________________________________________________________________//

	//=================================================================//
	//	2) 'item_proto_text.txt'ÆÄÀÏ°ú (a)[localMap] ¸ÊÀ¸·Î
	//		([test_map_itemTableByVnum](vnum:TItemTable) ¸ÊÀ» »ý¼ºÇÑ´Ù.
	//=================================================================//
	// map<DWORD, TItemTable *> test_map_itemTableByVnum;
	// //1. ÆÄÀÏ Àоî¿À±â.
	// cCsvTable test_data;
	// if(!test_data.Load("item_proto_test.txt",'t'))
	// {
		// fprintf(stderr, "item_proto_test.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ùn");
		// //return false;
	// } else {
		// test_data.Next();	//¼³¸í ·Î¿ì ³Ñ¾î°¡±â.

		// //2. Å×½ºÆ® ¾ÆÀÌÅÛ Å×ÀÌºí »ý¼º.
		// TItemTable * test_item_table = NULL;
		// int test_itemTableSize = test_data.m_File.GetRowCount()-1;
		// test_item_table = new TItemTable[test_itemTableSize];
		// memset(test_item_table, 0, sizeof(TItemTable) * test_itemTableSize);

		// //3. Å×½ºÆ® ¾ÆÀÌÅÛ Å×ÀÌºí¿¡ °ªÀ» ³Ö°í, ¸Ê¿¡±îÁö ³Ö±â.
		// while(test_data.Next()) {


			// if (!Set_Proto_Item_Table(test_item_table, test_data, localMap))
			// {
				// fprintf(stderr, "¾ÆÀÌÅÛ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆÐ.n");			
			// }

			// test_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(test_item_table->dwVnum, test_item_table));
			// test_item_table++;

		// }
	// }
	//______________________________________________________________________//


	//========================================================================//
	//	3) 'item_proto.txt' ÆÄÀÏ°ú  (a)[localMap] ¸ÊÀ¸·Î
	//		(!)[item_table], <m_map_itemTableByVnum>À» ¸¸µç´Ù.
	//			<Âü°í>
	//			°¢ row µé Áß, 
	//			([test_map_itemTableByVnum],(!)[mob_table] ¸ðµÎ¿¡ ÀÖ´Â row´Â
	//			([test_map_itemTableByVnum]ÀÇ °ÍÀ» »ç¿ëÇÑ´Ù.
	//========================================================================//

	//vnumµéÀ» ÀúÀåÇÒ ¼Â. »õ·Î¿î Å×½ºÆ® ¾ÆÀÌÅÛÀ» ÆǺ°ÇÒ¶§ »ç¿ëµÈ´Ù.
	//set<int> vnumSet;

	//ÆÄÀÏ Àоî¿À±â.
	cCsvTable data;
	if(!data.Load("item_proto.txt",'t'))
	{
		fprintf(stderr, "Could not load item_proto.txt. Wrong file format?n");
		return false;
	}
	data.Next(); //¸Ç À­ÁÙ Á¦¿Ü (¾ÆÀÌÅÛ Ä®·³À» ¼³¸íÇÏ´Â ºÎºÐ)

	if (!m_vec_itemTable.empty())
	{
		sys_log(0, "RELOAD: item_proto");
		m_vec_itemTable.clear();
		m_map_itemTableByVnum.clear();
	}

	//data¸¦ ´Ù½Ã ùÁÙ·Î ¿Å±ä´Ù.(´Ù½Ã Àоî¿Â´Ù;
	data.Destroy();
	if(!data.Load("item_proto.txt",'t'))
	{
		fprintf(stderr, "Could not load item_proto.txt. Wrong file format?n");
		return false;
	}
	data.Next(); //¸Ç À­ÁÙ Á¦¿Ü (¾ÆÀÌÅÛ Ä®·³À» ¼³¸íÇÏ´Â ºÎºÐ)

	m_vec_itemTable.resize(data.m_File.GetRowCount() - 1);
	memset(&m_vec_itemTable[0], 0, sizeof(TItemTable) * m_vec_itemTable.size());
	// int testValue =  m_vec_itemTable.size();

	TItemTable * item_table = &m_vec_itemTable[0];

	while (data.Next())
	{
				
		if (!Set_Proto_Item_Table(item_table, data, localMap))
		{
			fprintf(stderr, "¾ÆÀÌÅÛ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆÐ.n");			
		}

		m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
		++item_table;
	}
	//_______________________________________________________________________//

	// QUEST_ITEM_PROTO_DISABLE
	// InitializeQuestItemTable();
	// END_OF_QUEST_ITEM_PROTO_DISABLE

	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;
}

 

thank you in advance

Share this post


Link to post

1 answer to this question

Recommended Posts

  • 0

Error resolved
I had a mistake in my file ClientManagerBoot.cpp function bool CClientManager :: InitializeShopTable ()

Vote4Close

 

Edit a Post :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.