Exemple #1
0
        public UInt64 ConnectRpc( BTL.INTFID interfaceId, PUUID dstPuUid, PUUID srcPuUid, UInt64 anyKey )
        {
            if ( null == m_pRpcClient ) return 0;

            m_pProcessUnit.SetRelayConnector( m_pRelayConnector );

            UInt64 rpcId = m_pRpcClient.Connect( (UInt32)interfaceId, dstPuUid, srcPuUid, anyKey );
            if ( 0 == rpcId ){
            Logger.MLNLOG_WARNING( "Fail Connect interfaceId="+ interfaceId
                +" dstPuUid=0x"+ Utility.ToHex( dstPuUid ) +" srcPuUid=0x"+ Utility.ToHex( srcPuUid ) +" anyKey=0x"+ Utility.ToHex( anyKey ) );
            return 0;
            }

            m_RPCID = rpcId;
            return rpcId;
        }
Exemple #2
0
 public static EffectCover EffectCoverGet(BTL.Play.Effect cEffect)
 {
     lock (_ahEffects)
         return _ahEffects.Values.FirstOrDefault(row => row.oEffect == cEffect);
 }
Exemple #3
0
		static private shared.Status StatusTranslate(BTL.EffectStatus eStatus)
		{
			switch (eStatus)
			{
				case BTL.EffectStatus.Error:
					return shared.Status.Error;
				case BTL.EffectStatus.Idle:
					return shared.Status.Idle;
				case BTL.EffectStatus.Preparing:
					return shared.Status.Prepared;
				case BTL.EffectStatus.Running:
					return shared.Status.Started;
				case BTL.EffectStatus.Stopped:
					return shared.Status.Stopped;
			}
			return shared.Status.Unknown;
		}
Exemple #4
0
		static void OnPlaylistIsEmpty(BTL.Play.Playlist cPlaylist)
        {// Плейлист сам стопится, если он bStopOnEmpty....
            //KeyValuePair<shared.Effect, EffectCover> ahCurrent;
            //try
            //{
            //    lock (_ahEffects)
            //        ahCurrent = _ahEffects.First(o => o.Value.oEffect is BTL.Play.Effect && ((BTL.Play.Effect)o.Value.oEffect) == cEffect);
            //    ahCurrent.Value.Stop();
            //}
            //catch (Exception ex)
            //{
            //    (new Logger()).WriteError(ex);
            //}
		}
Exemple #5
0
 private void OnContainerEffectFailed(BTL.Play.Effect cContainer, BTL.Play.Effect cEffect)
 {
     lock (oContainerEventsLocker)
         Program.OnContainerEvent(shared.ContainerEventType.failed, this, Program.EffectCoverGet(cEffect));
 }
Exemple #6
0
 private void OnContainerEffectIsOffScreen(BTL.Play.Effect cContainer, BTL.Play.Effect cEffect)
 {
     lock (oContainerEventsLocker)
         Program.OnContainerEvent(shared.ContainerEventType.offscreen, this, Program.EffectCoverGet(cEffect));
 }
Exemple #7
0
 public bool StatusIsOlderThen(BTL.EffectStatus eStat, int nSeconds)
 {
     lock (oEffect)
         if (eStatus == eStat && dtStatusChanged.AddSeconds(nSeconds) < DateTime.Now)
             return true;
     return false;
 }
Exemple #8
0
		void iEffect_Stopped(BTL.Play.Effect cSender)
		{
			try
			{
				(new Logger()).WriteDebug("self stopped: [blendf=" + _cPreferences.sBlendFile + "][pythonf=" + _cPreferences.sPythonFile + "]");
				if (null != Stopped)
					Plugin.EventSend(Stopped, this);
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
		}
Exemple #9
0
 public void Recv_AppointmentBattleResult( UInt64 conid, UInt64 matching_room_id ,BTL.BattlePuInfo battle_pu_info ,UInt64 appointment_battle_pu_time, Int32 result )
 {
 }
Exemple #10
0
 public void Recv_GetStatusResult(UInt64 conid, BTL.BattleStatusInfo status_info)
 {
     Logger.MLNLOG_DEBUG( "Recv_GetStatusResult conid=0x"+ Utility.ToHex( conid )
     +", entered_num="+ status_info.entered_num +", max_enter_num="+ status_info.max_enter_num +", status="+ status_info.status );
 }
Exemple #11
0
        public void Recv_GetRoomListResult(UInt64 conid, BTL.BattleRoomInfo[] room_info, UInt32 room_info_len)
        {
            ClientScene.Instance.Log("RoomListNum=" + room_info_len);

            if ( 0 == room_info_len ) return;

            if (PHASE.PHASE_WAIT_CONNECT_SERVER != m_Phase) return;

            if ( 0 == room_info_len ) return;

            for ( UInt32 i = 0; i < room_info_len; ++i ){
            BTL.BattleRoomInfo pInfo = room_info[ i ];

            Logger.MLNLOG_DEBUG( "["+ i +"] ipAddr="+ pInfo.pu_info.ip_addr
                +" port="+ pInfo.pu_info.port +" roomHubPuUid=0x"+ Utility.ToHex( pInfo.pu_info.room_hub_pu_uid )
                +" battlePuUid=0x"+ Utility.ToHex( pInfo.pu_info.battle_pu_uid )
                +" enteredNum="+ pInfo.status_info.entered_num +" maxEnterNum="+ pInfo.status_info.max_enter_num +" status="+ pInfo.status_info.status );
            ClientScene.Instance.Log("[" + i + "] " + pInfo.pu_info.ip_addr + ":" + pInfo.pu_info.port + " 0x" + Utility.ToHex(pInfo.pu_info.battle_pu_uid) + " " + pInfo.status_info.entered_num + "/" + pInfo.status_info.max_enter_num + " " + pInfo.status_info.status);
            }

            // 接続済PUとの通信を切断
            m_RpcConnector.RenewRelayConnector();

            // TODO 本来はユーザーが任意のルームを選択する必要があるが、
            // ひとまずランダムで選択したルームに入室しておく
            Int32 roomIndex = m_pRandom.Next( (Int32)room_info_len );
            BTL.BattleRoomInfo pRoomInfo = room_info[ roomIndex ];
            m_RoomHubPU_PUUID = pRoomInfo.pu_info.room_hub_pu_uid;
            if (ConnectServer(pRoomInfo.pu_info.ip_addr, pRoomInfo.pu_info.port, pRoomInfo.pu_info.battle_pu_uid))
            {
            ClientScene.Instance.Log("m_CharaId=0x" + mln.Utility.ToHex(m_CharaId));
            ClientScene.Instance.Log("Choice [" + roomIndex + "] " + pRoomInfo.pu_info.ip_addr + ":" + pRoomInfo.pu_info.port + " 0x" + Utility.ToHex(pRoomInfo.pu_info.battle_pu_uid) + " " + pRoomInfo.status_info.entered_num + "/" + pRoomInfo.status_info.max_enter_num + " " + pRoomInfo.status_info.status);
            }
        }
Exemple #12
0
        /**
         * マッチング状態取得結果
         */
        public void Recv_GetMatchingStatusResult(UInt64 conid, UInt64 matching_room_id, Byte status, BTL.BattlePuInfo pu_info)
        {
            Logger.MLNLOG_DEBUG("Recv_GetMatchingStatusResult : matching_room_id = " + matching_room_id + ", status = " + status +
            ", ip_addr = " + pu_info.ip_addr + ", port = " + pu_info.port + ", room_hub_pu_uid = " + pu_info.room_hub_pu_uid + ", battle_pu_uid = " + pu_info.battle_pu_uid);

            // そもそもバトル予約が完了していなければ終了
            if ((Int32)status != (Int32)BTL.MatchingStatus.MATCHINGSTATUS_BATTLE_APPOINTMENT_SUCCESS &&
            (Int32)status != (Int32)BTL.MatchingStatus.MATCHINGSTATUS_BATTLE_APPOINTMENT_FAILURE)
            {
            return;
            }

            // バトル予約成功
            if ((Int32)status == (Int32)BTL.MatchingStatus.MATCHINGSTATUS_BATTLE_APPOINTMENT_SUCCESS)
            {
            // バトル子プロセス情報を保存しておく
            m_BattlePuInfo = pu_info;
            }

            // 退室待ち状態に切り替える
            m_Phase = PHASE.PHASE_MATCHING_WAIT_EXIT_ROOM;
        }
Exemple #13
0
 public void SetRpcClient(BTL.PU_Client pRpcClient)
 {
     m_pRpcClient = pRpcClient;
 }
Exemple #14
0
 public void SetBattlePuInfo( BTL.BattlePuInfo info )
 {
     m_BattlePuInfo = info;
 }