• 0
Sign in to follow this  
Katherine

Exchange.cpp error

Question

Hello guys.

Pls help me, what the problem?:/

exchange.cpp:511: error: a function-definition is not allowed here before '{' token
exchange.cpp:619: error: expected `}' at end of input

511:

bool CExchange::Accept(bool bAccept) //511-----------
{
	if (m_bAccept == bAccept)
		return true;

	m_bAccept = bAccept;

	// µŃ ´Ů µżŔÇ ÇßŔ¸ąÇ·Î ±łČŻ Ľş¸ł
	if (m_bAccept && GetCompany()->m_bAccept)
	{
		int	iItemCount;

		LPCHARACTER victim = GetCompany()->GetOwner();

		//PREVENT_PORTAL_AFTER_EXCHANGE
		GetOwner()->SetExchangeTime();
		victim->SetExchangeTime();		
		//END_PREVENT_PORTAL_AFTER_EXCHANGE

		// exchange_check żˇĽ­´Â ±łČŻÇŇ ľĆŔĚĹ۵éŔĚ Á¦ŔÚ¸®żˇ ŔÖłŞ Č®ŔÎÇĎ°í,
		// ż¤Ĺ©µµ ĂćşĐČ÷ ŔÖłŞ Č®ŔÎÇŃ´Ů, µÎąř° ŔÎŔÚ·Î ±łČŻÇŇ ľĆŔĚĹŰ °łĽö
		// ¸¦ ¸®ĹĎÇŃ´Ů.
		if (!Check(&iItemCount))
		{
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		// ¸®ĹĎ ąŢŔş ľĆŔĚĹŰ °łĽö·Î »ó´ëąćŔÇ ĽŇÁöÇ°żˇ ł˛Ŕş ŔÚ¸®°ˇ ŔÖłŞ Č®ŔÎÇŃ´Ů.
		if (!CheckSpace())
		{
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		// »ó´ëąćµµ ¸¶Âů°ˇÁö·Î..
		if (!GetCompany()->Check(&iItemCount))
		{
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		if (!GetCompany()->CheckSpace())
		{
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		if (db_clientdesc->GetSocket() == INVALID_SOCKET)
		{
			sys_err("Cannot use exchange feature while DB cache connection is dead.");
			victim->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
			goto EXCHANGE_END;
		}

		if (Done())
		{
			if (m_lGold) // µ·ŔĚ ŔÖŔ» ‹š¸¸ ŔúŔĺ
				GetOwner()->Save();

			if (GetCompany()->Done())
			{
				if (GetCompany()->m_lGold) // µ·ŔĚ ŔÖŔ» ¶§¸¸ ŔúŔĺ
					victim->Save();

				// INTERNATIONAL_VERSION
				GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´Ô°úŔÇ ±łČŻŔĚ Ľş»ç µÇľú˝Ŕ´Ď´Ů."), victim->GetName());
				victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´Ô°úŔÇ ±łČŻŔĚ Ľş»ç µÇľú˝Ŕ´Ď´Ů."), GetOwner()->GetName());
				// END_OF_INTERNATIONAL_VERSION
			}
		}

EXCHANGE_END:
		Cancel();
		return false;
	}
	else
	{
		// ľĆ´Ď¸é acceptżˇ ´ëÇŃ ĆĐŶŔ» ş¸ł»ŔÚ.
		exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, true, m_bAccept, NPOS, 0);
		exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, false, m_bAccept, NPOS, 0);
		return true;
	}
}

And 619:

void CExchange::Cancel()
{
	exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_END, 0, 0, NPOS, 0);
	GetOwner()->SetExchange(NULL);

	for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
	{
		if (m_apItems[i])
			m_apItems[i]->SetExchanging(false);
	}

	if (GetCompany())
	{
		GetCompany()->SetCompany(NULL);
		GetCompany()->Cancel();
	}

	M2_DELETE(this);
} //------> 619

Pls help me!:) 

Share this post


Link to post
Share on other sites

1 answer to this question

  • 0

Hello guys.

Pls help me, what the problem?:/

exchange.cpp:511: error: a function-definition is not allowed here before '{' token
exchange.cpp:619: error: expected `}' at end of input

511:

bool CExchange::Accept(bool bAccept) //511-----------
{
	if (m_bAccept == bAccept)
		return true;

	m_bAccept = bAccept;

	// µŃ ´Ů µżŔÇ ÇßŔ¸ąÇ·Î ±łČŻ Ľş¸ł
	if (m_bAccept && GetCompany()->m_bAccept)
	{
		int	iItemCount;

		LPCHARACTER victim = GetCompany()->GetOwner();

		//PREVENT_PORTAL_AFTER_EXCHANGE
		GetOwner()->SetExchangeTime();
		victim->SetExchangeTime();		
		//END_PREVENT_PORTAL_AFTER_EXCHANGE

		// exchange_check żˇĽ­´Â ±łČŻÇŇ ľĆŔĚĹ۵éŔĚ Á¦ŔÚ¸®żˇ ŔÖłŞ Č®ŔÎÇĎ°í,
		// ż¤Ĺ©µµ ĂćşĐČ÷ ŔÖłŞ Č®ŔÎÇŃ´Ů, µÎąř° ŔÎŔÚ·Î ±łČŻÇŇ ľĆŔĚĹŰ °łĽö
		// ¸¦ ¸®ĹĎÇŃ´Ů.
		if (!Check(&iItemCount))
		{
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		// ¸®ĹĎ ąŢŔş ľĆŔĚĹŰ °łĽö·Î »ó´ëąćŔÇ ĽŇÁöÇ°żˇ ł˛Ŕş ŔÚ¸®°ˇ ŔÖłŞ Č®ŔÎÇŃ´Ů.
		if (!CheckSpace())
		{
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		// »ó´ëąćµµ ¸¶Âů°ˇÁö·Î..
		if (!GetCompany()->Check(&iItemCount))
		{
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ µ·ŔĚ şÎÁ·ÇĎ°ĹłŞ ľĆŔĚĹŰŔĚ Á¦ŔÚ¸®żˇ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		if (!GetCompany()->CheckSpace())
		{
			victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ëąćŔÇ ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů."));
			goto EXCHANGE_END;
		}

		if (db_clientdesc->GetSocket() == INVALID_SOCKET)
		{
			sys_err("Cannot use exchange feature while DB cache connection is dead.");
			victim->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
			GetOwner()->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
			goto EXCHANGE_END;
		}

		if (Done())
		{
			if (m_lGold) // µ·ŔĚ ŔÖŔ» ‹š¸¸ ŔúŔĺ
				GetOwner()->Save();

			if (GetCompany()->Done())
			{
				if (GetCompany()->m_lGold) // µ·ŔĚ ŔÖŔ» ¶§¸¸ ŔúŔĺ
					victim->Save();

				// INTERNATIONAL_VERSION
				GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´Ô°úŔÇ ±łČŻŔĚ Ľş»ç µÇľú˝Ŕ´Ď´Ů."), victim->GetName());
				victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´Ô°úŔÇ ±łČŻŔĚ Ľş»ç µÇľú˝Ŕ´Ď´Ů."), GetOwner()->GetName());
				// END_OF_INTERNATIONAL_VERSION
			}
		}

EXCHANGE_END:
		Cancel();
		return false;
	}
	else
	{
		// ľĆ´Ď¸é acceptżˇ ´ëÇŃ ĆĐŶŔ» ş¸ł»ŔÚ.
		exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, true, m_bAccept, NPOS, 0);
		exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, false, m_bAccept, NPOS, 0);
		return true;
	}
}

And 619:

void CExchange::Cancel()
{
	exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_END, 0, 0, NPOS, 0);
	GetOwner()->SetExchange(NULL);

	for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
	{
		if (m_apItems[i])
			m_apItems[i]->SetExchanging(false);
	}

	if (GetCompany())
	{
		GetCompany()->SetCompany(NULL);
		GetCompany()->Cancel();
	}

	M2_DELETE(this);
} //------> 619

Pls help me!:) 

Upload to exchange.cpp

Share this post


Link to post
Share on other sites

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.