bool CAISocket::HandlePacket(Packet & pkt)
{
	TRACE("CAISocket::Parsing() - %X (%d), len=%d\n", pkt.GetOpcode(), pkt.GetOpcode(), pkt.size()); 
	switch (pkt.GetOpcode())
	{
		case AG_CHECK_ALIVE_REQ:
			RecvCheckAlive(pkt);
			break;
		case AI_SERVER_CONNECT:
			LoginProcess(pkt);
			break;
		case AG_SERVER_INFO:
			RecvServerInfo(pkt);
			break;
		case NPC_INFO_ALL:
			RecvNpcInfoAll(pkt);
			break;
		case MOVE_RESULT:
			RecvNpcMoveResult(pkt);
			break;
		case MOVE_END_RESULT:
			break;
		case AG_ATTACK_RESULT:
			RecvNpcAttack(pkt);
			break;
		case AG_MAGIC_ATTACK_RESULT:
			RecvMagicAttackResult(pkt);
			break;
		case AG_NPC_INFO:
			RecvNpcInfo(pkt);
			break;
		case AG_USER_SET_HP:
			RecvUserHP(pkt);
			break;
		case AG_USER_EXP:
			RecvUserExp(pkt);
			break;
		case AG_SYSTEM_MSG:
			RecvSystemMsg(pkt);
			break;
		case AG_NPC_GIVE_ITEM:
			RecvNpcGiveItem(pkt);
			break;
		case AG_USER_FAIL:
			RecvUserFail(pkt);
			break;
		case AG_NPC_GATE_DESTORY:
			RecvGateDestory(pkt);
			break;
		case AG_DEAD:
			RecvNpcDead(pkt);
			break;
		case AG_NPC_INOUT:
			RecvNpcInOut(pkt);
			break;
		case AG_BATTLE_EVENT:
			RecvBattleEvent(pkt);
			break;
		case AG_NPC_EVENT_ITEM:
			RecvNpcEventItem(pkt);
			break;
		case AG_NPC_GATE_OPEN:
			RecvGateOpen(pkt);
			break;
		case AG_COMPRESSED:
			RecvCompressed(pkt);
			break;
	}

	return true;
}
Beispiel #2
0
void CAISocket::Parsing( int len, char* pData )
{
	int index = 0;

	BYTE command = GetByte(pData, index);

	//TRACE("CAISocket::Parsing - command=%d, length = %d\n", command, len);

	switch( command )
	{
		case AG_CHECK_ALIVE_REQ:
			RecvCheckAlive(pData+index);
			break;
		case AI_SERVER_CONNECT:
			LoginProcess(pData+index);
			break;
		case AG_SERVER_INFO:
			RecvServerInfo(pData+index);
			break;
		case NPC_INFO_ALL:
			RecvNpcInfoAll(pData+index);
			break;
		case MOVE_RESULT:
			RecvNpcMoveResult(pData+index);
			break;
		case MOVE_END_RESULT:
			break;
		case AG_ATTACK_RESULT:
			RecvNpcAttack(pData+index);
			break;
		case AG_MAGIC_ATTACK_RESULT:
			RecvMagicAttackResult(pData+index);
			break;
		case AG_NPC_INFO:
			RecvNpcInfo(pData+index);
			break;
		case AG_USER_SET_HP:
			RecvUserHP(pData+index);
			break;
		case AG_USER_EXP:
			RecvUserExp(pData+index);
			break;
		case AG_SYSTEM_MSG:
			RecvSystemMsg(pData+index);
			break;
		case AG_NPC_GIVE_ITEM:
			RecvNpcGiveItem(pData+index);
			break;
		case AG_USER_FAIL:
			RecvUserFail(pData+index);
			break;
		case AG_NPC_GATE_DESTORY:
			RecvGateDestory(pData+index);
			break;
		case AG_DEAD:
			RecvNpcDead(pData+index);
			break;
		case AG_NPC_INOUT:
			RecvNpcInOut(pData+index);
			break;
		case AG_BATTLE_EVENT:
			RecvBattleEvent(pData+index);
			break;
		case AG_NPC_EVENT_ITEM:
			RecvNpcEventItem(pData+index);
			break;
		case AG_NPC_GATE_OPEN:
			RecvGateOpen(pData+index);
			break;
	}
}