All pastes #384753 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-07 09:08 UTC
rendered paste body
void ReceivePacket(DWORD * header, DWORD * packet)
{
	#ifdef __DEBUG__
		WORD opCode = NULL, extOpCode =  NULL;
	#else
		BYTE opCode = NULL, extOpCode =  NULL;
	#endif
	//DWORD packetSize = NULL, packetSize2 = NULL, packetSize3 = NULL, packetSize4 = NULL;

	#ifdef __DEBUG_VERBOSE__
		file << ">>> Entered ReceivePacket: now pulling data from the packet.\n";
		file.flush();
	#endif

	//no idea which one is right...
	//packetSize = (BYTE)(packet+1253);
	//packetSize2 = (BYTE)*(packet+1253);
	//packetSize3 = (BYTE)packet;
	//packetSize4 = (BYTE)*packet;

	//if( packetSize > 0 )
	//{
		opCode = (BYTE)*header;

		/*#ifdef __DEBUG_VERBOSE__
			file << ">>>>>> ReceivePacket: packet size: " << packetSize << "/" << packetSize2 << "/" << packetSize3 << "/" << packetSize4 << " opcode: 0x" << opCode << "\n";
			file.flush();
		#endif*/

		switch ( opCode )
		{
			//C4 Extended Packets
			case 0xD0:
				extOpCode = (BYTE)*(header+1);
				#ifdef __DEBUG_VERBOSE__
					file << ">>>>>> ReceivePacket: C4 Extended (0x" << hex << opCode << ") received.\n";
					file.flush();
				#endif
				//extended op code switch for C4 packets
				switch ( extOpCode )
				{
					//RequestAutoSoulShot
					case 0x0F:
						#ifdef __DEBUG_VERBOSE__
							file << ">>>>>>>>> C4 Extended: RequestAutoSoulShot (0x" << hex << extOpCode << ") received.\n";
							file.flush();
						#endif
						break;
				}
				break;
			//RequestParty
			case 0x29:
				#ifdef __DEBUG_VERBOSE__
					file << ">>>>>> ReceivePacket: RequestParty (0x" << hex << opCode << ") received.\n";
					file.flush();
				#endif
				break;
			//RequestRecipeBookOpen
			case 0xAC:
				#ifdef __DEBUG_VERBOSE__
					file << ">>>>>> ReceivePacket: RequestRecipeBookOpen (0x" << hex << opCode << ") received.\n";
					file.flush();
				#endif

				break;
			//RequestRecipeBookDestroy
			case 0xAD:
				#ifdef __DEBUG_VERBOSE__
					file << ">>>>>> ReceivePacket: RequestRecipeBookDestroy (0x" << hex << opCode << ") received.\n";
					file.flush();
				#endif

				break;
			//RequestShowMiniMap
			case 0xCD:
				#ifdef __DEBUG_VERBOSE__
					file << ">>>>>> ReceivePacket: Request Show Mini Map (0x" << hex << opCode << ") received.\n";
					file.flush();
				#endif
				ReplyRequestShowMiniMap( packet, 1665 );
				#ifdef __DEBUG_VERBOSE__
					file << ">>>>>> ReceivePacket: ReplyRequestShowMiniMap() sent to the client.\n";
					file.flush();
				#endif
				break;
		}
	//}
}