Ejemplo n.º 1
0
	public Msg_CollectInfo( body_SC_COLLECT_INFO _collectInfo)
	{
		m_MessageType = eMessageType.COLLECT_INFO;

		collectInfo = _collectInfo;
	}
Ejemplo n.º 2
0
	private void ReceiveCollectInfo( byte[] _packet)
	{
		body_SC_COLLECT_INFO data = new body_SC_COLLECT_INFO();
		data.PacketBytesToClass( _packet);

		eCOLLECT_STATE state = (eCOLLECT_STATE)data.eCollectState;
		Debug.Log( "ReceiveCollectInfo [ npc id : " + data.nCollectNpcIdx + "[ char key : " + data.nCollectorUniqKey
			+ "[ state : " + state);

		AsEntityManager.Instance.DispatchMessageByNpcSessionId( data.nCollectNpcIdx, new Msg_CollectInfo( data));

		if( AsUserInfo.Instance.SavedCharStat.uniqKey_ == data.nCollectorUniqKey)
		{
			AsUserInfo.Instance.GetCurrentUserEntity().HandleMessage( new Msg_CollectResult( state));
			if( eCOLLECT_STATE.eCOLLECT_STATE_CANCEL == state || eCOLLECT_STATE.eCOLLECT_STATE_COMPLETE == state)
				AsHUDController.Instance.targetInfo.EmptyCollectEntity();
		}
		else
		{
			AsEntityManager.Instance.DispatchMessageByUniqueKey( data.nCollectorUniqKey, new Msg_CollectInfo( data));
		}
	}
Ejemplo n.º 3
0
	public void OtherCharAppear( AS_SC_OTHER_CHAR_APPEAR_1 _appear)//game process
	{
		for( int i = 0; i < _appear.nCharCnt; ++i)
		{
			AS_SC_OTHER_CHAR_APPEAR_2 appear = _appear.body[i];

			if( false == m_dicUserEntity_UniqueId.ContainsKey( appear.nCharUniqKey))
			{
				//create
				OtherCharacterAppearData creationData = new OtherCharacterAppearData( appear);
				AsUserEntity entity = AsEntityManager.Instance.CreateUserEntity( "OtherUser", creationData, true, true);
				entity.SetRePosition( entity.transform.position);
				
				_PetProc( entity, creationData);

				Msg_OtherUserMoveIndicate moveInfo = new Msg_OtherUserMoveIndicate( creationData.sessionKey_,
					creationData.uniqKey_, creationData.curPosition_, creationData.destPosition_, eMoveType.Normal);
				entity.HandleMessage( moveInfo);

				if( appear.bProgress)
				{
					entity.ShowProductImg( appear.bProgress);
				}
				else if( 0 != appear.nCollectIdx)
				{
					body_SC_COLLECT_INFO info = new body_SC_COLLECT_INFO();
					info.nCollectNpcIdx = appear.nCollectIdx;
					info.nCollectorUniqKey = appear.nCharUniqKey;
					info.nCollectorSession = appear.nSessionIdx;
					info.eCollectState = ( int)eCOLLECT_STATE.eCOLLECT_STATE_START;
					entity.HandleMessage( new Msg_CollectInfo( info));
				}

				//party
				entity.PartyIdx = appear.nPartyIdx;
				entity.ShowPartyPR( appear.bPartyNotice, System.Text.UTF8Encoding.UTF8.GetString( appear.szPartyNotice));
			}
			else
			{
				AsUserEntity entity = m_dicUserEntity_UniqueId[appear.nCharUniqKey];

				if( entity.CheckShopOpening() == true)
				{
					OtherCharacterAppearData creationData = new OtherCharacterAppearData( appear);
					entity.SetCreationData( creationData);
					entity.SetRePosition( entity.transform.position);
					entity.ShowProductImg( appear.bProgress);

					if( 0 != appear.nCollectIdx)
					{
						body_SC_COLLECT_INFO info = new body_SC_COLLECT_INFO();
						info.nCollectNpcIdx = appear.nCollectIdx;
						info.nCollectorUniqKey = appear.nCharUniqKey;
						info.nCollectorSession = appear.nSessionIdx;
						info.eCollectState = ( int)eCOLLECT_STATE.eCOLLECT_STATE_START;
						entity.HandleMessage( new Msg_CollectInfo( info));
					}
				}
				else
				{
					Debug.LogError( "[AsEntityManager]OtherCharAppear: already created character. id = " + appear.nCharUniqKey);
					continue;
				}
			}
		}
	}