protected new bool initLevelConfigGenerator()
 {
     if( ! base.initLevelConfigGenerator())
     {
         // Fallback.
         lvlConfigGen = new MPLevelConfigGeneratorServer(null); //new  MPLevelConfigGeneratorRandom();
         Debug.LogWarning("Warning: Using Level Gen Fallback");
     }
     return true;
 }
Пример #2
0
    private void handleImmediateActivityStart()
    {
        //deactivatePersistentObj();
        ILevelConfigGenerator builtLvlGen = null;
        string nextSceneName = "";

        switch(selectedEvent.getApplicationID())
        {
            // Server Based.
        case ApplicationID.SERENADE_HERO : builtLvlGen = new SHLevelConfigGeneratorServer(acServCom); nextSceneName = "SerenadeScene"; break;
        case ApplicationID.DROP_CHOPS : builtLvlGen = new SJLevelConfigGeneratorServer(acServCom); nextSceneName = "SolomonScene";break;
        case ApplicationID.MOVING_PATHWAYS : builtLvlGen = new MPLevelConfigGeneratorServer(acServCom); nextSceneName = "MovingPathwaysScene-Auto";  break;
        case ApplicationID.HARVEST : builtLvlGen = new HarvestLevelConfigGeneratorServer(acServCom);nextSceneName = "HarvestScene";  break;
        case ApplicationID.WHAK_A_MOLE: builtLvlGen = new WAMLevelConfigGeneratorServer(acServCom);nextSceneName = "WhackaMonkeyScene";  break;
        case ApplicationID.MAIL_SORTER : builtLvlGen = new MSLevelConfigGeneratorServer(acServCom);nextSceneName = "MailSorter";  break;
        case ApplicationID.EYE_EXAM: builtLvlGen = new BBLevelConfigGeneratorServer(acServCom); nextSceneName = "BridgeBuilder"; break;
        case ApplicationID.TRAIN_DISPATCHER: builtLvlGen = new TDLevelConfigGeneratorServer(acServCom); nextSceneName = "TrainDispatcher"; break;
        case ApplicationID.ENDLESS_RUNNER: builtLvlGen = new PDLevelConfigGeneratorServer(acServCom); nextSceneName = "PackageDelivery";break;
        }

        if(!WorldViewServerCommunication.error)//Ready to go!
        {
            ActivitySessionMetaData acSessionMetaData = new ActivitySessionMetaData(
                                                            LocalisationMang.getNPCnames()[selectedEvent.getQuestGiverCharID()],
                                                            selectedEvent.getApplicationID(),
                                                            gbMang.getNameForLangArea(selectedEvent.getEncounter().getLanguageArea()),
                                                            gbMang.createDifficultyShortDescription(selectedEvent.getEncounter().getLanguageArea(),selectedEvent.getEncounter().getDifficulty()),
                                                            selectedEvent.getQuestGiverCharID(),
                                                            selectedEvent.getEncounter().getLanguageArea(),
                                                            selectedEvent.getEncounter().getDifficulty(),
                                                            launcherMode,
                                                            launcherDetails);

            GameObject poRef = PersistentObjMang.getInstance();
            DatastoreScript dataStore = poRef.GetComponent<DatastoreScript>();
            dataStore.insertData("LevelGen",builtLvlGen);
            dataStore.insertData("ActivityReturnSceneName",Application.loadedLevelName);
            dataStore.insertData("AcMetaData",acSessionMetaData);
            dataStore.insertData("NextSceneToLoad",nextSceneName);

            Application.LoadLevel("LoadingScene");
            Debug.Log("Progress Script goes to sleep here");

            this.enabled = false;
        }
        else
        {
            Debug.Log("Level wrong");
            abortQuest();
        }
    }