Esempio n. 1
0
bool CGameSocket::HandlePacket(Packet & pkt)
{
	switch (pkt.GetOpcode())
	{
	case AI_SERVER_CONNECT:
		RecvServerConnect(pkt);
		break;
	case AG_USER_INFO:
		RecvUserInfo(pkt);
		break;
	case AG_USER_INOUT:
		RecvUserInOut(pkt);
		break;
	case AG_USER_MOVE:
		RecvUserMove(pkt);
		break;
	case AG_USER_MOVEEDGE:
		RecvUserMoveEdge(pkt);
		break;
	case AG_ATTACK_REQ:
		RecvAttackReq(pkt);
		break;
	case AG_USER_LOG_OUT:
		RecvUserLogOut(pkt);
		break;
	case AG_USER_REGENE:
		RecvUserRegene(pkt);
		break;
	case AG_USER_SET_HP:
		RecvUserSetHP(pkt);
		break;
	case AG_NPC_HP_CHANGE:
		RecvNpcHpChange(pkt);
		break;
	case AG_USER_UPDATE:
		RecvUserUpdate(pkt);
		break;
	case AG_ZONE_CHANGE:
		RecvZoneChange(pkt);
		break;
	case AG_USER_PARTY:
		m_Party.PartyProcess(pkt);
		break;
	case AG_USER_INFO_ALL:
		RecvUserInfoAllData(pkt);
		break;
	case AG_PARTY_INFO_ALL:
		RecvPartyInfoAllData(pkt);
		break;
	case AG_CHECK_ALIVE_REQ:
		RecvCheckAlive(pkt);
		break;
	case AG_HEAL_MAGIC:
		RecvHealMagic(pkt);
		break;
	case AG_TIME_WEATHER:
		RecvTimeAndWeather(pkt);
		break;
	case AG_USER_FAIL:
		RecvUserFail(pkt);
		break;
	case AG_BATTLE_EVENT:
		RecvBattleEvent(pkt);
		break;
	case AG_NPC_GATE_OPEN:
		RecvGateOpen(pkt);
		break;
	case AG_USER_VISIBILITY:
		RecvUserVisibility(pkt);
		break;
	}
	return true;
}
void CGameSocket::Parsing( int length, char* pData )
{
	int index = 0;
	BYTE bType = GetByte(pData, index);

	switch(bType)
	{
	case SERVER_CONNECT:
		RecvServerConnect(pData);
		break;
	case AG_USER_INFO:
		RecvUserInfo(pData+index);
		break;
	case AG_USER_INOUT:
		RecvUserInOut(pData+index);
		break;
	case AG_USER_MOVE:
		RecvUserMove(pData+index);
		break;
	case AG_USER_MOVEEDGE:
		RecvUserMoveEdge(pData+index);
		break;
	case AG_ATTACK_REQ:
		RecvAttackReq(pData+index);
		break;
	case AG_USER_LOG_OUT:
		RecvUserLogOut(pData+index);
		break;
	case AG_USER_REGENE:
		RecvUserRegene(pData+index);
		break;
	case AG_USER_SET_HP:
		RecvUserSetHP(pData+index);
		break;
	case AG_USER_UPDATE:
		RecvUserUpdate(pData+index);
		break;
	case AG_ZONE_CHANGE:
		RecvZoneChange(pData+index);
		break;
	case AG_USER_PARTY:
		//if(m_pParty)
		m_Party.PartyProcess(pData+index);
		break;
	case AG_MAGIC_ATTACK_REQ:
		RecvMagicAttackReq(pData+index);
		break;
	case AG_COMPRESSED_DATA:
		RecvCompressedData(pData+index);
		break;
	case AG_USER_INFO_ALL:
		RecvUserInfoAllData(pData+index);
		break;
	case AG_PARTY_INFO_ALL:
		RecvPartyInfoAllData(pData+index);
		break;
	case AG_CHECK_ALIVE_REQ:
		RecvCheckAlive(pData+index);
		break;
	case AG_HEAL_MAGIC:
		RecvHealMagic(pData+index);
		break;
	case AG_TIME_WEATHER:
		RecvTimeAndWeather(pData+index);
		break;
	case AG_USER_FAIL:
		RecvUserFail(pData+index);
		break;
	case AG_BATTLE_EVENT:
		RecvBattleEvent(pData+index);
		break;
	case AG_NPC_GATE_OPEN:
		RecvGateOpen(pData+index);
		break;
	}
}
Esempio n. 3
0
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;
}
Esempio n. 4
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;
	}
}