示例#1
0
    //$yde
    void CharMove(byte[] _packet)
    {
 //       AsNotify.Log("CharMove");

        AS_SC_CHAR_MOVE charMove = new AS_SC_CHAR_MOVE();
        charMove.PacketBytesToClass(_packet);
        //Msg_MoveInfo moveInfo = new Msg_MoveInfo(charMove.sDestPosition);
		Msg_OtherUserMoveIndicate moveIndication =
			new Msg_OtherUserMoveIndicate(charMove);
		if( null == AsEntityManager.Instance )
		{
			Debug.LogError("null == AsEntityManager.Instance");
			return;
		}
        AsEntityManager.Instance.DispatchMessageByUniqueKey(moveIndication.charUniqKey_, moveIndication);
//		Debug.Log("Char Move = Uniqkey:" + moveIndication.charUniqKey_ + ", info:" + moveIndication.moveType_);
    }
示例#2
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;
				}
			}
		}
	}