Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 20.06.2006, 06:16   #3
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

void RequestUserCommand()
Code:
void __cdecl ShowLocPacket(BYTE* pUser,BYTE * pSocket)
{
	LPTSHAREDDATA TSharedData;
	int tileX,tileY;
	int nRegion,nLocaltion;
	int x,y,z;

	TSharedData = (LPTSHAREDDATA)(*(unsigned int*)(pUser + 0xF54));
	x = (int)TSharedData->x;
	y = (int)TSharedData->y;
	z = (int)TSharedData->z;
	tileX = (( x >> 15 ) + 4 )& 0x1F;
	tileY = (( y >> 15 ) + 10)& 0x1F;
	nRegion = _regions[tileY][tileX];
	if (nRegion > 15)	nLocaltion = 924;
	else	nLocaltion = _LOC_MSG[nRegion];

	Lin2Send(pSocket, "cdddddddd", 0x7A, nLocaltion, 3, 1, x, 1, y, 1, z);
}

void __cdecl ShowTimePacket(BYTE* pUser,BYTE * pSocket)
{
	SYSTEMTIME st;
	GetLocalTime(&st);
	if (st.wHour<12)
	{
		Lin2Send(pSocket, "cdddddd", 0x7A, 927, 2, 1, st.wHour, 1, st.wMinute);
	}
	else
		Lin2Send(pSocket, "cdddddd", 0x7A, 928, 2, 1, st.wHour, 1, st.wMinute);
}

void __cdecl ShowPartyInfoPacket(BYTE* pUser,BYTE * pSocket)
{
	BYTE *pParty;
	DWORD dwLoot;
	pParty = GetParty(pUser);
	if (pParty == NULL)		return;
	dwLoot = *(unsigned int*)(pParty +0x44);
	Lin2Send(pSocket, "cd", 0x7A, 1030);
	switch (dwLoot) {
		case 0:	Lin2Send(pSocket, "cd", 0x7A, 1031);	break;
    	case 1:	Lin2Send(pSocket, "cd", 0x7A, 1032);    break;
    	case 2:	Lin2Send(pSocket, "cd", 0x7A, 1033);    break;
    	case 3:	Lin2Send(pSocket, "cd", 0x7A, 1034);    break;
    	case 4:	Lin2Send(pSocket, "cd", 0x7A, 1035);    break;
	}
}

void __cdecl RequestUserCommand(BYTE * pData, BYTE* pUser, BYTE * pSocket)
{
	DWORD dwCommand;
	BYTE* pBuffer;
	pBuffer = pData;
	if (pUser!=NULL)
	{
		dwCommand = *(unsigned int*)pBuffer;
		switch(dwCommand)
		{
			case 0:		ShowLocPacket(pUser,pSocket); break;
			case 77:	ShowTimePacket(pUser,pSocket); break;
			case 81:	ShowPartyInfoPacket(pUser,pSocket); break;
		}
	}
}
torune is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:22.