Ejemplo n.º 1
0
        /// <summary>
        /// 进入场景结果
        /// </summary>
        /// <param name="msgresponse"></param>
        private void OnEnterSceneResponse(object msgResponse)
        {
            SCSceneEnterResponse msg = msgResponse as SCSceneEnterResponse;

            if (!MsgStatusCodeUtil.OnError(msg.ResponseStatus))
            {
                int gameMode = (this.m_sceneData.playMode / 10000) % 10;
                if (this.m_currentScene != null)
                {
                    this.m_currentScene.DestroyScene();
                }

                LoadingProgressManager.Instance.LoadProgressScene();
                BigWorldManager.Instance.ClearBigWorld();
                //预加载音频
#if MP3
                EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").SoundPath, null);
#elif WAV
                //EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").WavPath, null);
#endif
                GameEvents.System_Events.PlayMainBGM(false);

                this.m_currentScene = SceneFactory.Instance.CreateScene((SceneMode)gameMode, (int)this.m_sceneData.id);
                (this.m_currentScene as GameSceneBase).InitScene(this.m_sceneData, (IList <long>)msg.SceneExhibits, (IList <long>)msg.TaskExhibits, (IList <long>)msg.OfficerIds, msg.Seconds);

                if (msg.IsDropScene)
                {
                    (this.m_currentScene as GameSceneBase).InitRandomOutput(msg.TaskExhibits.Count, msg.DropItems);
                }
            }
        }
Ejemplo n.º 2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfSound config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_Sound", fieldName, fieldValue);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        config = null;
                        return(false);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("Sound 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 通过Audio Key获取Audio文件路径
        /// </summary>
        /// <param name="audioKey"></param>
        /// <returns></returns>
        public static string FetchAudioPathByKey(string audioKey)
        {
            ConfSound audioConf = ConfSound.Get(audioKey);

#if MP3
            return(audioConf != null ? audioConf.SoundPath : string.Empty);
#elif WAV
            return(audioConf != null ? audioConf.WavPath : string.Empty);
#endif
        }
Ejemplo n.º 4
0
        private static ConfSound GetConfByDic(DataTable reader)
        {
            string id        = reader.GetString(0);
            string SoundPath = reader.GetString(1);
            string WavPath   = reader.GetString(2);

            ConfSound new_obj_ConfSound = new ConfSound(id,
                                                        SoundPath,
                                                        WavPath
                                                        );

            return(new_obj_ConfSound);
        }
Ejemplo n.º 5
0
        private string GetAudioPath(string sn_)
        {
            if (ConstAudioKeyDict.ContainsKey(sn_))
            {
                return(ConstAudioKeyDict[sn_]);
            }

            ConfSound s = ConfSound.Get(sn_);

#if MP3
            return(null != s ? s.SoundPath : null);
#elif WAV
            return(null != s ? s.WavPath : null);
#endif
        }
Ejemplo n.º 6
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_Sound");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfSound _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
Ejemplo n.º 7
0
        public static bool GetConfig(string id, out ConfSound config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_Sound", id);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        dic[id] = null;
                        config  = null;
                        return(false);
                    }
                    dic[id] = config;
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("Sound 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
Ejemplo n.º 8
0
        private void OnPrepareScene()
        {
            int gameMode = (this.m_sceneData.playMode / 10000) % 10;

            if (this.m_currentScene != null)
            {
                this.m_currentScene.DestroyScene();
            }

            LoadingProgressManager.Instance.LoadProgressScene();
            BigWorldManager.Instance.ClearBigWorld();
            //预加载音频
#if MP3
            EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").SoundPath, null);
#elif WAV
            //EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").WavPath, null);
#endif

            GameEvents.System_Events.PlayMainBGM(false);
            this.m_currentScene = SceneFactory.Instance.CreateScene((SceneMode)gameMode, (int)this.m_sceneData.id);
        }
Ejemplo n.º 9
0
 public static void Register()
 {
     ConfAchievement.Init();
     ConfActiveDrop.Init();
     ConfActivityBase.Init();
     ConfAssetManifest.Init();
     Confbranchtask.Init();
     ConfBuilding.Init();
     ConfCartoonScene.Init();
     ConfChapter.Init();
     ConfCharge.Init();
     ConfChat.Init();
     ConfChatItem.Init();
     ConfCheckIn.Init();
     ConfCombineFormula.Init();
     ConfDemoScene.Init();
     ConfDropOut.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfDropOut2.Init();
     Confetl.Init();
     ConfEvent.Init();
     ConfEventAttribute.Init();
     ConfEventPhase.Init();
     Confexhibit.Init();
     ConfExpToLevel.Init();
     Conffailtips.Init();
     ConfFeedback.Init();
     ConfFind.Init();
     ConfFindClue.Init();
     ConfFindTypeIcon.Init();
     ConfGMCMD.Init();
     ConfGuid.Init();
     ConfGuidArt.Init();
     ConfGuidNew.Init();
     ConfGuidNewFunction.Init();
     Confinapppurchase.Init();
     ConfJigsawScene.Init();
     ConfKeyWords.Init();
     ConfLanguage.Init();
     ConfMsgCode.Init();
     ConfNode.Init();
     ConfNpc.Init();
     ConfOfficer.Init();
     ConfPath.Init();
     ConfPoliceRankIcon.Init();
     ConfProp.Init();
     ConfPropGift.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfPush.Init();
     ConfReasoning.Init();
     ConfScene.Init();
     ConfSceneDifficulty.Init();
     ConfSceneSpecial.Init();
     ConfServiceConfig.Init();
     ConfSkill.Init();
     ConfSkyEye.Init();
     ConfSound.Init();
     ConfTask.Init();
     ConfTitle.Init();
 }