Jump to content
Sign in to follow this  
lDesconocid0l

Errror al compilar

Recommended Posts

Buenas noches.

Tengo un problema al compilar arroja el siguiente error:

ClientManager.h:336: error: expected ',' or '...' before '*' token
ClientManager.h:336: error: ISO C++ forbids declaration of 'TPacketGDCombatZoneResetRanking' with no type
ClientManager.h:337: error: expected ',' or '...' before '*' token
ClientManager.h:337: error: ISO C++ forbids declaration of 'TPacketGDCombatZoneSkillsCache' with no type

 

Las declaraciones son las siguientes en ClientManager.cpp

#if defined(WJ_COMBAT_ZONE)	
void CClientManager::CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p)
{
	CDBManager::instance().DirectQuery("UPDATE player.player SET combat_zone_rank = 0 WHERE combat_zone_rank > 0");

	std::auto_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery("SELECT * FROM player.combat_zone_ranking_weekly ORDER BY memberPoints DESC LIMIT 3"));	
	if (pMsg->Get()->uiNumRows == 3)
	{
		MYSQL_ROW row;
		int memberRank = 1;
		char szQuery[512 + 1];
		while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
		{
			sprintf(szQuery, "UPDATE player.player SET combat_zone_rank = '%d' WHERE name = '%s'", memberRank, row[0]);
			CDBManager::instance().DirectQuery(szQuery);
			memberRank++;
		}
	}
	else {
		sys_err("The giving ranking medals not was possible because not was exist 3 players on ranking weekly.");
	}

	CDBManager::instance().DirectQuery("TRUNCATE TABLE player.combat_zone_ranking_weekly");
}

void CClientManager::UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p)
{
	char szQuery[2048 + 1];
	sprintf(szQuery, 
		"INSERT INTO player.combat_zone_skills_cache (pid, skillLevel1, skillLevel2, skillLevel3, skillLevel4, skillLevel5, skillLevel6) "
			"VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d') "
				"ON DUPLICATE KEY UPDATE skillLevel1 = '%d', skillLevel2 = '%d', skillLevel3 = '%d', skillLevel4 = '%d', skillLevel5 = '%d', skillLevel6 = '%d'", 
					p->dwPID, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6);
	CDBManager::instance().DirectQuery(szQuery);
}
#endif

 

Las declaraciones son las siguientes en ClientManager.h

 

#if defined(WJ_COMBAT_ZONE)	
	void		CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p);
	void		UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p);
#endif

 

Alguno sabe de que forma va estas dos funciones?

 

Saludos.

Share this post


Link to post
Share on other sites

Tu script tiene error de la formatacion.

 

teste:

#ifndef WJ_COMBAT_ZONE
void CClientManager::CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p)
{
	CDBManager::instance().DirectQuery("UPDATE player.player SET combat_zone_rank = 0 WHERE combat_zone_rank > 0");

	std::auto_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery("SELECT * FROM player.combat_zone_ranking_weekly ORDER BY memberPoints DESC LIMIT 3"));	
	if (pMsg->Get()->uiNumRows == 3)
	{
		MYSQL_ROW row;
		int memberRank = 1;
		char szQuery[512 + 1];
		while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
		{
			sprintf(szQuery, "UPDATE player.player SET combat_zone_rank = '%d' WHERE name = '%s'", memberRank, row[0]);
			CDBManager::instance().DirectQuery(szQuery);
			memberRank++;
		}
	}
	else {
		sys_err("The giving ranking medals not was possible because not was exist 3 players on ranking weekly.");
	}

	CDBManager::instance().DirectQuery("TRUNCATE TABLE player.combat_zone_ranking_weekly");
}

void CClientManager::UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p)
{
	char szQuery[2048 + 1];
	sprintf(szQuery, 
		"INSERT INTO player.combat_zone_skills_cache (pid, skillLevel1, skillLevel2, skillLevel3, skillLevel4, skillLevel5, skillLevel6) "
			"VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d') "
				"ON DUPLICATE KEY UPDATE skillLevel1 = '%d', skillLevel2 = '%d', skillLevel3 = '%d', skillLevel4 = '%d', skillLevel5 = '%d', skillLevel6 = '%d'", 
					p->dwPID, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6);
	CDBManager::instance().DirectQuery(szQuery);
}
#endif
#ifndef WJ_COMBAT_ZONE
	void		CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p);
	void		UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p);
#endif

 

or

 

#if defined(WJ_COMBAT_ZONE)
void CClientManager::CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p)
{
	CDBManager::instance().DirectQuery("UPDATE player.player SET combat_zone_rank = 0 WHERE combat_zone_rank > 0");

	std::auto_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery("SELECT * FROM player.combat_zone_ranking_weekly ORDER BY memberPoints DESC LIMIT 3"));	
	if (pMsg->Get()->uiNumRows == 3)
	{
		MYSQL_ROW row;
		int memberRank = 1;
		char szQuery[512 + 1];
		while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
		{
			sprintf(szQuery, "UPDATE player.player SET combat_zone_rank = '%d' WHERE name = '%s'", memberRank, row[0]);
			CDBManager::instance().DirectQuery(szQuery);
			memberRank++;
		}
	}
	else {
		sys_err("The giving ranking medals not was possible because not was exist 3 players on ranking weekly.");
	}

	CDBManager::instance().DirectQuery("TRUNCATE TABLE player.combat_zone_ranking_weekly");
}

void CClientManager::UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p)
{
	char szQuery[2048 + 1];
	sprintf(szQuery, 
		"INSERT INTO player.combat_zone_skills_cache (pid, skillLevel1, skillLevel2, skillLevel3, skillLevel4, skillLevel5, skillLevel6) "
			"VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d') "
				"ON DUPLICATE KEY UPDATE skillLevel1 = '%d', skillLevel2 = '%d', skillLevel3 = '%d', skillLevel4 = '%d', skillLevel5 = '%d', skillLevel6 = '%d'", 
					p->dwPID, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6);
	CDBManager::instance().DirectQuery(szQuery);
}
#endif
#if defined(WJ_COMBAT_ZONE)
	void		CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p);
	void		UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p);
#endif

 

Share this post


Link to post
Share on other sites
En 30/5/2018 a las 20:34, renssis dijo:

Tu script tiene error de la formatacion.

 

teste:

#ifndef WJ_COMBAT_ZONE
void CClientManager::CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p)
{
	CDBManager::instance().DirectQuery("UPDATE player.player SET combat_zone_rank = 0 WHERE combat_zone_rank > 0");

	std::auto_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery("SELECT * FROM player.combat_zone_ranking_weekly ORDER BY memberPoints DESC LIMIT 3"));	
	if (pMsg->Get()->uiNumRows == 3)
	{
		MYSQL_ROW row;
		int memberRank = 1;
		char szQuery[512 + 1];
		while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
		{
			sprintf(szQuery, "UPDATE player.player SET combat_zone_rank = '%d' WHERE name = '%s'", memberRank, row[0]);
			CDBManager::instance().DirectQuery(szQuery);
			memberRank++;
		}
	}
	else {
		sys_err("The giving ranking medals not was possible because not was exist 3 players on ranking weekly.");
	}

	CDBManager::instance().DirectQuery("TRUNCATE TABLE player.combat_zone_ranking_weekly");
}

void CClientManager::UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p)
{
	char szQuery[2048 + 1];
	sprintf(szQuery, 
		"INSERT INTO player.combat_zone_skills_cache (pid, skillLevel1, skillLevel2, skillLevel3, skillLevel4, skillLevel5, skillLevel6) "
			"VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d') "
				"ON DUPLICATE KEY UPDATE skillLevel1 = '%d', skillLevel2 = '%d', skillLevel3 = '%d', skillLevel4 = '%d', skillLevel5 = '%d', skillLevel6 = '%d'", 
					p->dwPID, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6);
	CDBManager::instance().DirectQuery(szQuery);
}
#endif
#ifndef WJ_COMBAT_ZONE
	void		CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p);
	void		UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p);
#endif

 

or

 

#if defined(WJ_COMBAT_ZONE)
void CClientManager::CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p)
{
	CDBManager::instance().DirectQuery("UPDATE player.player SET combat_zone_rank = 0 WHERE combat_zone_rank > 0");

	std::auto_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery("SELECT * FROM player.combat_zone_ranking_weekly ORDER BY memberPoints DESC LIMIT 3"));	
	if (pMsg->Get()->uiNumRows == 3)
	{
		MYSQL_ROW row;
		int memberRank = 1;
		char szQuery[512 + 1];
		while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
		{
			sprintf(szQuery, "UPDATE player.player SET combat_zone_rank = '%d' WHERE name = '%s'", memberRank, row[0]);
			CDBManager::instance().DirectQuery(szQuery);
			memberRank++;
		}
	}
	else {
		sys_err("The giving ranking medals not was possible because not was exist 3 players on ranking weekly.");
	}

	CDBManager::instance().DirectQuery("TRUNCATE TABLE player.combat_zone_ranking_weekly");
}

void CClientManager::UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p)
{
	char szQuery[2048 + 1];
	sprintf(szQuery, 
		"INSERT INTO player.combat_zone_skills_cache (pid, skillLevel1, skillLevel2, skillLevel3, skillLevel4, skillLevel5, skillLevel6) "
			"VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d') "
				"ON DUPLICATE KEY UPDATE skillLevel1 = '%d', skillLevel2 = '%d', skillLevel3 = '%d', skillLevel4 = '%d', skillLevel5 = '%d', skillLevel6 = '%d'", 
					p->dwPID, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6, p->dwSkillLevel1, p->dwSkillLevel2, p->dwSkillLevel3, p->dwSkillLevel4, p->dwSkillLevel5, p->dwSkillLevel6);
	CDBManager::instance().DirectQuery(szQuery);
}
#endif
#if defined(WJ_COMBAT_ZONE)
	void		CombatZoneResetRanking(const TPacketGDCombatZoneResetRanking* p);
	void		UpdateSkillsCache(const TPacketGDCombatZoneSkillsCache* p);
#endif

 

Hola gracias por responder,

 

Me arroja el siguiente error:

 


ClientManager.cpp:2670: error: 'HEADER_GD_COMBAT_ZONE_RESET_RANKING' was not declared in this scope
ClientManager.cpp:2671: error: 'TPacketGDCombatZoneResetRanking' was not declared in this scope
ClientManager.cpp:2671: error: expected primary-expression before ')' token
ClientManager.cpp:2671: error: 'CombatZoneResetRanking' was not declared in this scope
ClientManager.cpp:2674: error: 'HEADER_GD_COMBAT_ZONE_SKILLS_CACHE' was not declared in this scope
ClientManager.cpp:2675: error: 'TPacketGDCombatZoneSkillsCache' was not declared in this scope
ClientManager.cpp:2675: error: expected primary-expression before ')' token
ClientManager.cpp:2675: error: 'UpdateSkillsCache' was not declared in this scope
gmake: *** [.obj/ClientManager.o] Error 1

 

 

Saludos.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...