Exemplo n.º 1
0
	private void PartyUserAdd( byte[] _packet)
	{

		AS_SC_PARTY_USER_ADD userAdd = new AS_SC_PARTY_USER_ADD();
		userAdd.PacketBytesToClass( _packet);

		#if _PARTY_LOG_
		Debug.Log( "PartyUserAdd");
		Debug.Log( userAdd.nCharUniqKey.ToString() + "PartyUserAdd" + userAdd.nPartyIdx.ToString() );
		#endif
		AsPartyManager.Instance.PartyUserAdd(userAdd);


		AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity();
		if( null != userEntity)
		{
			if(userAdd.nCharUniqKey == userEntity.UniqueId)
				AsPartySender.SendPartyDetailInfo(userAdd.nPartyIdx);
			else
			{
				string userName = System.Text.UTF8Encoding.UTF8.GetString( userAdd.szCharName );
				string strMsg = string.Format( AsTableManager.Instance.GetTbl_String(45),  AsUtil.GetRealString(userName)  );
				AsChatManager.Instance.InsertChat( strMsg, eCHATTYPE.eCHATTYPE_SYSTEM);
			}
		}

	}
Exemplo n.º 2
0
	public void PartyUserAdd( AS_SC_PARTY_USER_ADD data, bool bOption = true)
	{
		if( null == data)
			return;

		PartyIdx = data.nPartyIdx;

		if( data.nPartyIdx == 0)
		{
			string strMsg = "Error PartyUserAdd Party Index zero !!!!";
			Debug.LogError( strMsg);
			AsChatManager.Instance.InsertChat( strMsg, eCHATTYPE.eCHATTYPE_SYSTEM);
		}

		if( 0 == m_PartyMembers.Count)
		{
			AsPartyManager.Instance.TargetCharUniqKey = 0;
			
			AsPartySender.SendPartyUserPosition();
			AsPartyManager.Instance.IsPartyWarpXZMsgBox = true;
			
			if( null != MsgBox_PartySearch)
				MsgBox_PartySearch.Close();
			PartyMyAdd();
			IsPartying = true;
			if( bOption && false == AsPvpManager.Instance.isMatching && false == AsInstanceDungeonManager.Instance.isMatching)
				AsPartySender.SendPartyDetailInfo( data.nPartyIdx);
			
		}

		if( 0 == m_PartyMembers.Count)
		{
			if( AsHudDlgMgr.Instance != null)
				if( AsHudDlgMgr.Instance.partyAndQuestToggleMgr != null)
					AsHudDlgMgr.Instance.partyAndQuestToggleMgr.AddPartyProcess();
		}

		AS_PARTY_USER member = GetPartyMember( data.nCharUniqKey);
		if( member == null)
		{
			AS_PARTY_USER new_member = new AS_PARTY_USER();

			new_member.nCharUniqKey = data.nCharUniqKey;
			new_member.nSessionIdx = data.nSessionIdx;
			new_member.strCharName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( data.szCharName));
			new_member.eRace 	= data.eRace;
			new_member.eClass = data.eClass;
			new_member.nLevel = data.nLevel;
			new_member.nImageTableIdx = data.nImageTableIdx;

			new_member.fHpCur = data.fHpCur;
			new_member.fHpMax = data.fHpMax;
			new_member.nCondition = data.nCondition;
			new_member.strChannelName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( data.szChannelName));
			m_PartyMembers.Add( new_member.nCharUniqKey, new_member);

			AS_PARTY_USER tmp_member = new AS_PARTY_USER();

			tmp_member.nCharUniqKey = data.nCharUniqKey;
			tmp_member.nSessionIdx = data.nSessionIdx;
			tmp_member.strCharName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( data.szCharName));
			tmp_member.eRace 	= data.eRace;
			tmp_member.eClass = data.eClass;
			tmp_member.nLevel = data.nLevel;
			tmp_member.nImageTableIdx = data.nImageTableIdx;

			tmp_member.fHpCur = data.fHpCur;
			tmp_member.fHpMax = data.fHpMax;
			tmp_member.nCondition = data.nCondition;
			tmp_member.strChannelName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( data.szChannelName));
			if( m_TempPartyMembers.ContainsKey( tmp_member.nCharUniqKey) == false)
				m_TempPartyMembers.Add( tmp_member.nCharUniqKey, tmp_member);

			member = new_member;
		}
		else
		{
			member.nCharUniqKey = data.nCharUniqKey;
			member.nSessionIdx = data.nSessionIdx;
			member.strCharName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( data.szCharName));
			member.eRace 	= data.eRace;
			member.eClass = data.eClass;
			member.nLevel = data.nLevel;
			member.nImageTableIdx = data.nImageTableIdx;

			member.fHpCur = data.fHpCur;
			member.fHpMax = data.fHpMax;
			member.nCondition = data.nCondition;
			member.strChannelName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( data.szChannelName));
		}

		if( AsHudDlgMgr.Instance != null)
			if( AsHudDlgMgr.Instance.partyAndQuestToggleMgr != null)
				AsHudDlgMgr.Instance.partyAndQuestToggleMgr.AddPartyProcess();

		if( 1 < m_PartyMembers.Count)
			AsPartyTrackManager.Instance.SetEvent(AsPartyTrackManager.ePartyTrackEvent.eJoin_Party);

		if( !m_IsReadyUI)
			return;

		AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity();
		if( null != userEntity)
		{
			if( data.nCharUniqKey == userEntity.UniqueId)
			{
				IsPartying = true;
				return;
			}
		}

		m_PartyUI.PartyMemberUI.ReSetPartyMember();

		SetPartyEditSolt();

		QuestMessageBroadCaster.BrocastQuest( QuestMessages.QM_ADD_PARTY, new AchAddParty( m_PartyMembers.Count));

		AutoDelPartyNotice();
	}