Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Problema offtrade

Status
Not open for further replies.
Newbie Spellweaver
Joined
May 26, 2012
Messages
24
Reaction score
5
Hi I have a problem when programming the offtrade.
While achieve already set up to make it online with personal online store when I give another user can not see what the pj sells.
If I schedule this surely someone gave this error, I hope you give me a hand wherever it may come the subject. Use the base of Julia but I'm working on a 99.60T.
thank you very much

The error I get is this:
16:02:55 [PShop] [Account] [Character] PShop Item Buy Request Failed: Seller is Closing (6400)

1.0.80 sources in this error is the following:

Code: [Select]

if (lpObj-> CloseCount> = 0)
{
LogAddTD ( "[PShop] [% s] [% s] PShop Item Buy Request Failed: Seller is Closing (% d)" gObj [aSourceIndex] .AccountID, gObj [aSourceIndex] .Name, MAKE_NUMBERW (lpMsg-> NumberH, lpMsg-> NumberL));
CGPShopAnsBuyItem (aSourceIndex, -1, 0.2);
return;
}


If I put the following in my source lpObj-> CloseCount = -1 I open the shop staff but I can not buy the items.

Thank you

----------------------------------------------------------
Hola gente tengo un problema al programar el offtrade.
Si bien ya logre configurar para que quede online con el personal store online cuando le doy con otro usuario no puedo ver el lo que el pj vende.
Si alguien programo esto seguramente le dio este error, espero que me den una mano de por donde puede venir el tema. Uso la base de Julia pero estoy trabajando en una 99.60T.
Desde ya muchas gracias

El error que me sale es este:
16:02:55 [PShop] [Cuenta][Personaje] PShop Item Buy Request Failed : Seller is Closing (6400)

En las sources 1.0.80 este error es por lo siguiente:

Código: [Seleccionar]

if ( lpObj->CloseCount >= 0 )
{
LogAddTD("[PShop] [%s][%s] PShop Item Buy Request Failed : Seller is Closing (%d)",gObj[aSourceIndex].AccountID, gObj[aSourceIndex].Name, MAKE_NUMBERW(lpMsg->NumberH, lpMsg->NumberL) );
CGPShopAnsBuyItem(aSourceIndex, -1, 0,2);
return;
}


Ahora bien si pongo lo sigueinte en mi source lpObj->CloseCount = -1 Puedo abrir la tienda personal pero no puedo comprar el items.

Gracias de ante mano.
 
Don't be afraid to ask!
Loyal Member
Joined
Jun 2, 2012
Messages
1,454
Reaction score
252
We need to see the code before CloseCount to find out what can be the problem.

Please add some pictures about the source, about the game, about the GS screen when you do this.
 
Upvote 0
Newbie Spellweaver
Joined
May 26, 2012
Messages
24
Reaction score
5
I'm using code:


Code:
static unsigned char bBuxCode[3] = { 0xFC, 0xCF, 0xAB };	// Xox Key for some interesting things :)

#define PLAYER_EMPTY		0
#define MAX_ACCOUNT_LEN	10
#define MAX_GUILD_LEN	8


void BuxConvert(char* buf, int size)
{
	for (int n = 0; n < size; n++)
	{
		buf[n] ^= bBuxCode[n % 3];		// Nice trick from WebZen
	}
}




CRITICAL_SECTION criti;
OffTrade OfflineTrade;

OffTrade::OffTrade(void)
{
	//-- CONSTRUCTOR --
}
void CloseClientHook(int aIndex)
{


	if (aIndex < 0 || aIndex > OBJECT_MAX - 1)
		return;

	if (Player[aIndex].OfflineTrade != 0)
		return;

	if (gObj[aIndex].Connected == PLAYER_EMPTY)
		return;

	if (gObj[aIndex].m_socket != INVALID_SOCKET)
	{
		closesocket(gObj[aIndex].m_socket);
		gObj[aIndex].m_socket = INVALID_SOCKET;
	}
}

void OffTrade::InitOfflineTrade()
{
	func.HookThis((DWORD)&CloseClient2Ex, 0x00401CA8); // 101% 
	func.HookThis((DWORD)&CGPShopAnsClose_Ex, 0x00403DE1); // 101%
	func.HookThis((DWORD)&ResponErrorCloseClientEx, 0x00403ACB); //101%
	func.HookThis((DWORD)&CloseClientHook, 0x00401032); // 101% 

}

OffTrade::~OffTrade(void)
{
	//-- DESTRUCTOR ----
}

void ResponErrorCloseClientEx(int Index)
{
	if (Index < 0 || Index > OBJECT_MAX - 1)
	{
		func.StringSendAll("TEST01", 0);

		return;
	}

	//OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(Index);

	if (gObj[Index].m_bPShopOpen == 1)
	{
		//	gObj[Index].CloseCount = -1;
		//gObj[Index].CloseType = -1;
		
		return;
	}

	if (Player[Index].OfflineTrade == true)
	{
		func.StringSendAll("TEST02", 0);
		return;
	}
	Player[Index].OfflineTrade = true;
	func.StringSendAll("TEST03", 0);
	ResponErrorCloseClient(Index);
}


void OffTrade::CreateOfflineStore(int aIndex)
{
	//OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
	Player[aIndex].OfflineTrade = true;

	CloseClient(aIndex);
}

void CGPShopAnsClose_Ex(int aIndex, BYTE btResult)
{
	// Function calling when Personal store is closing. 
	// Also it is calling when Personal store become empty.

	CGPShopAnsClose(aIndex, btResult);

	if (Player[aIndex].OfflineTrade == true)
	{
		Player[aIndex].OfflineTrade = false;
		gObjDel_Ex(aIndex);

		//OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
	}
}

void CloseClient2Ex(_PER_SOCKET_CONTEXT_2 * lpPerSocketContext, int result)
{
	// Very easy function hooking. Just disable auto log-off of Disconnected Characters ;)
	int index = -1;
	index = lpPerSocketContext->nIndex;
	//---
	if (index >= OBJECT_MIN && index < OBJECT_MAX)
	{

		if (gObj->m_socket != INVALID_SOCKET)
		{
			if (closesocket(gObj->m_socket) == -1)
				if (WSAGetLastError() != WSAENOTSOCK)
					return;
			gObj->m_socket = INVALID_SOCKET;
		}
		gObjDel_Ex(index);
	}
}

short gObjDel_Ex(int aIndex)
{
	//OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);

	if (Player[aIndex].OfflineTrade == true)
	{
		return 1;
	}

	if (aIndex < OBJECT_MIN || Player[aIndex].CloseSetCheck == true)
	{
		return gObjDel1(aIndex);
	}

	return gObjDel1(aIndex);


}
 
Upvote 0
Status
Not open for further replies.
Back
Top