public async STT.Task <ViewModels.Scenario> GetMineAsync(CancellationToken ct)
        {
            if (!(await _authorizationService.AuthorizeAsync(_user, null, new ContentDeveloperRequirement())).Succeeded)
            {
                throw new ForbiddenException();
            }

            var item = await _context.Scenarios.Include(st => st.VmCredentials)
                       .SingleOrDefaultAsync(o => o.Id == _user.GetId(), ct);

            if (item == null)
            {
                var createdDate = DateTime.UtcNow;
                var id          = _user.GetId();
                var name        = _user.Claims.FirstOrDefault(c => c.Type == "name").Value;
                item = new ScenarioEntity()
                {
                    Id           = id,
                    Name         = $"{name} User Scenario",
                    Description  = "Personal Task Builder Scenario",
                    StartDate    = createdDate,
                    EndDate      = createdDate.AddYears(100),
                    Status       = ScenarioStatus.active,
                    OnDemand     = false,
                    DateCreated  = createdDate,
                    DateModified = createdDate,
                    CreatedBy    = id,
                    ModifiedBy   = id
                };
                _context.Scenarios.Add(item);
                await _context.SaveChangesAsync(ct);
            }

            return(_mapper.Map <SAVM.Scenario>(item));
        }
示例#2
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario  = scenarioTag;
     alpha_lift     = new ScenarioEntity <IBloc>(0, scenarioTag.WellKnownItems[0]);
     beta_lift      = new ScenarioEntity <IBloc>(1, scenarioTag.WellKnownItems[1]);
     alpha_ctf_terr = new ScenarioEntity <IScenery>(14, scenarioTag.WellKnownItems[14]);
     bravo_ctf_terr = new ScenarioEntity <IScenery>(15, scenarioTag.WellKnownItems[15]);
     hall1_terr     = new ScenarioEntity <IScenery>(17, scenarioTag.WellKnownItems[17]);
     hall2_terr     = new ScenarioEntity <IScenery>(18, scenarioTag.WellKnownItems[18]);
     center_low     = new ScenarioEntity <IScenery>(72, scenarioTag.WellKnownItems[72]);
     blue_effect    = new ScenarioEntity <IScenery>(78, scenarioTag.WellKnownItems[78]);
     red_effect     = new ScenarioEntity <IScenery>(79, scenarioTag.WellKnownItems[79]);
     drips_1        = new ScenarioEntity <IScenery>(113, scenarioTag.WellKnownItems[113]);
     drips_2        = new ScenarioEntity <IScenery>(114, scenarioTag.WellKnownItems[114]);
     drips_3        = new ScenarioEntity <IScenery>(115, scenarioTag.WellKnownItems[115]);
     drips_4        = new ScenarioEntity <IScenery>(116, scenarioTag.WellKnownItems[116]);
     drips_5        = new ScenarioEntity <IScenery>(117, scenarioTag.WellKnownItems[117]);
     drips_6        = new ScenarioEntity <IScenery>(118, scenarioTag.WellKnownItems[118]);
     drips_7        = new ScenarioEntity <IScenery>(119, scenarioTag.WellKnownItems[119]);
     lametrees      = new ScenarioEntity <IScenery>(120, scenarioTag.WellKnownItems[120]);
     red            = new ScenarioEntity <ISound>(121, scenarioTag.WellKnownItems[121]);
     blue           = new ScenarioEntity <ISound>(122, scenarioTag.WellKnownItems[122]);
     throb          = new ScenarioEntity <ISound>(123, scenarioTag.WellKnownItems[123]);
     redf           = new ScenarioEntity <ISound>(124, scenarioTag.WellKnownItems[124]);
     bluef          = new ScenarioEntity <ISound>(125, scenarioTag.WellKnownItems[125]);
     drips_8        = new ScenarioEntity <IScenery>(126, scenarioTag.WellKnownItems[126]);
     cool_middle    = new ScenarioEntity <ISound>(127, scenarioTag.WellKnownItems[127]);
 }
示例#3
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     crate_left00  = new ScenarioEntity <IBloc>(0, scenarioTag.WellKnownItems[0]);
     crate_right00 = new ScenarioEntity <IBloc>(1, scenarioTag.WellKnownItems[1]);
     crate_left01  = new ScenarioEntity <IBloc>(2, scenarioTag.WellKnownItems[2]);
     crate_left02  = new ScenarioEntity <IBloc>(3, scenarioTag.WellKnownItems[3]);
     crate_left03  = new ScenarioEntity <IBloc>(4, scenarioTag.WellKnownItems[4]);
     crate_left04  = new ScenarioEntity <IBloc>(5, scenarioTag.WellKnownItems[5]);
     crate_left05  = new ScenarioEntity <IBloc>(6, scenarioTag.WellKnownItems[6]);
     crate_left06  = new ScenarioEntity <IBloc>(7, scenarioTag.WellKnownItems[7]);
     crate_left07  = new ScenarioEntity <IBloc>(8, scenarioTag.WellKnownItems[8]);
     crate_left08  = new ScenarioEntity <IBloc>(9, scenarioTag.WellKnownItems[9]);
     crate_left09  = new ScenarioEntity <IBloc>(10, scenarioTag.WellKnownItems[10]);
     crate_left10  = new ScenarioEntity <IBloc>(11, scenarioTag.WellKnownItems[11]);
     crate_left11  = new ScenarioEntity <IBloc>(12, scenarioTag.WellKnownItems[12]);
     crate_right01 = new ScenarioEntity <IBloc>(13, scenarioTag.WellKnownItems[13]);
     crate_right02 = new ScenarioEntity <IBloc>(14, scenarioTag.WellKnownItems[14]);
     crate_right03 = new ScenarioEntity <IBloc>(15, scenarioTag.WellKnownItems[15]);
     crate_right04 = new ScenarioEntity <IBloc>(16, scenarioTag.WellKnownItems[16]);
     crate_right05 = new ScenarioEntity <IBloc>(17, scenarioTag.WellKnownItems[17]);
     crate_right06 = new ScenarioEntity <IBloc>(18, scenarioTag.WellKnownItems[18]);
     crate_right07 = new ScenarioEntity <IBloc>(19, scenarioTag.WellKnownItems[19]);
     crate_right08 = new ScenarioEntity <IBloc>(20, scenarioTag.WellKnownItems[20]);
     crate_right09 = new ScenarioEntity <IBloc>(21, scenarioTag.WellKnownItems[21]);
     crate_right10 = new ScenarioEntity <IBloc>(22, scenarioTag.WellKnownItems[22]);
     crate_right11 = new ScenarioEntity <IBloc>(23, scenarioTag.WellKnownItems[23]);
 }
示例#4
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     core1         = new ScenarioEntity <ISound>(0, scenarioTag.WellKnownItems[0]);
     core2         = new ScenarioEntity <ISound>(1, scenarioTag.WellKnownItems[1]);
     core3         = new ScenarioEntity <ISound>(2, scenarioTag.WellKnownItems[2]);
     core4         = new ScenarioEntity <ISound>(3, scenarioTag.WellKnownItems[3]);
 }
示例#5
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     alpha         = new ScenarioEntity <IScenery>(0, scenarioTag.WellKnownItems[0]);
     charlie       = new ScenarioEntity <IScenery>(1, scenarioTag.WellKnownItems[1]);
     bravo         = new ScenarioEntity <IScenery>(2, scenarioTag.WellKnownItems[2]);
     delta         = new ScenarioEntity <IScenery>(3, scenarioTag.WellKnownItems[3]);
     neutral       = new ScenarioEntity <IScenery>(4, scenarioTag.WellKnownItems[4]);
 }
示例#6
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     ramps         = new ScenarioEntity <IScenery>(0, scenarioTag.WellKnownItems[0]);
     crap          = new ScenarioEntity <IScenery>(1, scenarioTag.WellKnownItems[1]);
     shroud_01     = new ScenarioEntity <IDevice>(2, scenarioTag.WellKnownItems[2]);
     shroud_02     = new ScenarioEntity <IDevice>(3, scenarioTag.WellKnownItems[3]);
     gate          = new ScenarioEntity <IDevice>(4, scenarioTag.WellKnownItems[4]);
     tele_switch   = new ScenarioEntity <IDevice>(5, scenarioTag.WellKnownItems[5]);
 }
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario       = scenarioTag;
     base_gate_machine_0 = new ScenarioEntity <IDevice>(0, scenarioTag.WellKnownItems[0]);
     base_gate_machine_1 = new ScenarioEntity <IDevice>(1, scenarioTag.WellKnownItems[1]);
     group_2             = new ScenarioEntity <IDevice>(2, scenarioTag.WellKnownItems[2]);
     group_3             = new ScenarioEntity <IDevice>(3, scenarioTag.WellKnownItems[3]);
     base_switch_1       = new ScenarioEntity <IDevice>(4, scenarioTag.WellKnownItems[4]);
     base_swtich_0       = new ScenarioEntity <IDevice>(5, scenarioTag.WellKnownItems[5]);
 }
示例#8
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario   = scenarioTag;
     assault         = new ScenarioEntity <IScenery>(0, scenarioTag.WellKnownItems[0]);
     territories     = new ScenarioEntity <IScenery>(1, scenarioTag.WellKnownItems[1]);
     territories_2   = new ScenarioEntity <IScenery>(2, scenarioTag.WellKnownItems[2]);
     territories_3   = new ScenarioEntity <IScenery>(3, scenarioTag.WellKnownItems[3]);
     eastbound_train = new ScenarioEntity <IDevice>(4, scenarioTag.WellKnownItems[4]);
     westbound_train = new ScenarioEntity <IDevice>(5, scenarioTag.WellKnownItems[5]);
     eastbound_death = new ScenarioEntity <IDevice>(6, scenarioTag.WellKnownItems[6]);
     westbound_death = new ScenarioEntity <IDevice>(7, scenarioTag.WellKnownItems[7]);
 }
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario             = scenarioTag;
     tram                      = new ScenarioEntity <IDevice>(0, scenarioTag.WellKnownItems[0]);
     door_tram_1               = new ScenarioEntity <IDevice>(1, scenarioTag.WellKnownItems[1]);
     door_tram_3               = new ScenarioEntity <IDevice>(2, scenarioTag.WellKnownItems[2]);
     door_tram_4               = new ScenarioEntity <IDevice>(3, scenarioTag.WellKnownItems[3]);
     zapper_control            = new ScenarioEntity <IDevice>(4, scenarioTag.WellKnownItems[4]);
     starting_cage             = new ScenarioEntity <IDevice>(5, scenarioTag.WellKnownItems[5]);
     door_elevator_tram_bot    = new ScenarioEntity <IDevice>(6, scenarioTag.WellKnownItems[6]);
     looker_light_bottom_red   = new ScenarioEntity <IDevice>(7, scenarioTag.WellKnownItems[7]);
     looker_light_right_red    = new ScenarioEntity <IDevice>(8, scenarioTag.WellKnownItems[8]);
     looker_light_left_red     = new ScenarioEntity <IDevice>(9, scenarioTag.WellKnownItems[9]);
     looker_light_top_red      = new ScenarioEntity <IDevice>(10, scenarioTag.WellKnownItems[10]);
     elevator_tram             = new ScenarioEntity <IDevice>(11, scenarioTag.WellKnownItems[11]);
     wall_elevator_tram_bot    = new ScenarioEntity <IDevice>(12, scenarioTag.WellKnownItems[12]);
     door_tram_2               = new ScenarioEntity <IDevice>(13, scenarioTag.WellKnownItems[13]);
     inamberclad               = new ScenarioEntity <IScenery>(14, scenarioTag.WellKnownItems[14]);
     zapper_cage               = new ScenarioEntity <IDevice>(15, scenarioTag.WellKnownItems[15]);
     inhibitor                 = new ScenarioEntity <IDevice>(16, scenarioTag.WellKnownItems[16]);
     wall_tram                 = new ScenarioEntity <IDevice>(17, scenarioTag.WellKnownItems[17]);
     wall_platform_1           = new ScenarioEntity <IDevice>(18, scenarioTag.WellKnownItems[18]);
     wall_platform_2           = new ScenarioEntity <IDevice>(19, scenarioTag.WellKnownItems[19]);
     wall_platform_3           = new ScenarioEntity <IDevice>(20, scenarioTag.WellKnownItems[20]);
     wall_platform_4           = new ScenarioEntity <IDevice>(21, scenarioTag.WellKnownItems[21]);
     looker_light_top_green    = new ScenarioEntity <IDevice>(22, scenarioTag.WellKnownItems[22]);
     looker_light_bottom_green = new ScenarioEntity <IDevice>(23, scenarioTag.WellKnownItems[23]);
     looker_light_right_green  = new ScenarioEntity <IDevice>(24, scenarioTag.WellKnownItems[24]);
     looker_light_left_green   = new ScenarioEntity <IDevice>(25, scenarioTag.WellKnownItems[25]);
     wall_platform_5           = new ScenarioEntity <IDevice>(26, scenarioTag.WellKnownItems[26]);
     zapper                    = new ScenarioEntity <IDevice>(27, scenarioTag.WellKnownItems[27]);
     iac_intro                 = new ScenarioEntity <IDevice>(28, scenarioTag.WellKnownItems[28]);
     iac_tram                  = new ScenarioEntity <IDevice>(29, scenarioTag.WellKnownItems[29]);
     cookiesncream             = new ScenarioEntity <IWeapon>(30, scenarioTag.WellKnownItems[30]);
     tram_marine_1             = new ScenarioEntity <IUnit>(31, scenarioTag.WellKnownItems[31]);
     tram_marine_2             = new ScenarioEntity <IUnit>(32, scenarioTag.WellKnownItems[32]);
     tram_marine_3             = new ScenarioEntity <IUnit>(33, scenarioTag.WellKnownItems[33]);
     tram_marine_4             = new ScenarioEntity <IUnit>(34, scenarioTag.WellKnownItems[34]);
     tram_marine_5             = new ScenarioEntity <IUnit>(35, scenarioTag.WellKnownItems[35]);
     tram_marine_6             = new ScenarioEntity <IUnit>(36, scenarioTag.WellKnownItems[36]);
     tram_marine_7             = new ScenarioEntity <IUnit>(37, scenarioTag.WellKnownItems[37]);
     guns                      = new Squad_guns(scenarioTag);
     johnson                   = new Squad_johnson(scenarioTag);
     tracker_elite             = new Squad_tracker_elite(scenarioTag);
     atr1_mar                  = new Squad_atr1_mar(scenarioTag);
     mid_mar                   = new Squad_mid_mar(scenarioTag);
     atr2_mar                  = new Squad_atr2_mar(scenarioTag);
 }
示例#10
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     beam_low      = new ScenarioEntity <ISound>(1, scenarioTag.WellKnownItems[1]);
     island        = new ScenarioEntity <ISound>(2, scenarioTag.WellKnownItems[2]);
     blue_flag     = new ScenarioEntity <IScenery>(3, scenarioTag.WellKnownItems[3]);
     red_flag      = new ScenarioEntity <IScenery>(4, scenarioTag.WellKnownItems[4]);
     n_flag        = new ScenarioEntity <IScenery>(5, scenarioTag.WellKnownItems[5]);
     terr1         = new ScenarioEntity <IScenery>(6, scenarioTag.WellKnownItems[6]);
     terr2         = new ScenarioEntity <IScenery>(7, scenarioTag.WellKnownItems[7]);
     terr4         = new ScenarioEntity <IScenery>(8, scenarioTag.WellKnownItems[8]);
     terr3         = new ScenarioEntity <IScenery>(9, scenarioTag.WellKnownItems[9]);
     terr5         = new ScenarioEntity <IScenery>(10, scenarioTag.WellKnownItems[10]);
     beam_main     = new ScenarioEntity <ISound>(11, scenarioTag.WellKnownItems[11]);
     beam_outer    = new ScenarioEntity <ISound>(12, scenarioTag.WellKnownItems[12]);
 }
示例#11
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     bob           = new ScenarioEntity <IScenery>(0, scenarioTag.WellKnownItems[0]);
     bob1          = new ScenarioEntity <IScenery>(1, scenarioTag.WellKnownItems[1]);
     bob2          = new ScenarioEntity <IScenery>(2, scenarioTag.WellKnownItems[2]);
     bob3          = new ScenarioEntity <IScenery>(3, scenarioTag.WellKnownItems[3]);
     rifle         = new ScenarioEntity <IScenery>(4, scenarioTag.WellKnownItems[4]);
     blade         = new ScenarioEntity <IScenery>(5, scenarioTag.WellKnownItems[5]);
     e3_coil_01    = new ScenarioEntity <IBloc>(6, scenarioTag.WellKnownItems[6]);
     e3_coil_02    = new ScenarioEntity <IBloc>(7, scenarioTag.WellKnownItems[7]);
     e3_coil_03    = new ScenarioEntity <IBloc>(8, scenarioTag.WellKnownItems[8]);
     elite         = new ScenarioEntity <IUnit>(9, scenarioTag.WellKnownItems[9]);
     chief         = new ScenarioEntity <IUnit>(10, scenarioTag.WellKnownItems[10]);
     e3_flag       = new ScenarioEntity <IWeapon>(11, scenarioTag.WellKnownItems[11]);
     house_gate    = new ScenarioEntity <IDevice>(14, scenarioTag.WellKnownItems[14]);
 }
示例#12
0
        public async STT.Task <ViewModels.Scenario> CreateFromScenarioTemplateAsync(Guid scenarioTemplateId, CancellationToken ct)
        {
            var scenarioTemplateEntity = _context.ScenarioTemplates.Find(scenarioTemplateId);

            if (scenarioTemplateEntity == null)
            {
                throw new EntityNotFoundException <SAVM.ScenarioTemplate>($"ScenarioTemplate {scenarioTemplateId} was not found.");
            }

            var scenarioEntity = new ScenarioEntity()
            {
                CreatedBy          = _user.GetId(),
                Name               = $"{scenarioTemplateEntity.Name} - {_user.Claims.FirstOrDefault(c => c.Type == "name").Value}",
                Description        = scenarioTemplateEntity.Description,
                OnDemand           = true,
                ScenarioTemplateId = scenarioTemplateId
            };
            var durationHours = scenarioTemplateEntity.DurationHours != null ? (int)scenarioTemplateEntity.DurationHours : 720;

            scenarioEntity.EndDate = scenarioEntity.StartDate.AddHours(durationHours);
            _context.Scenarios.Add(scenarioEntity);
            await _context.SaveChangesAsync(ct);

            // copy all of the VmCredentials
            var oldVmCredentials         = _context.VmCredentials.Where(vmc => vmc.ScenarioTemplateId == scenarioTemplateId).ToList();
            var newDefaultVmCredentialId = await CopyVmCredentials(scenarioTemplateEntity.DefaultVmCredentialId, null, scenarioEntity.Id, oldVmCredentials, ct);

            scenarioEntity.DefaultVmCredentialId = newDefaultVmCredentialId;
            await _context.SaveChangesAsync(ct);

            // copy all of the Tasks
            var oldTaskEntities = _context.Tasks.Where(dt => dt.ScenarioTemplateId == scenarioTemplateId && dt.TriggerTaskId == null).ToList();

            // copy the PARENT Tasks
            foreach (var oldTaskEntity in oldTaskEntities)
            {
                await _taskService.CopyAsync(oldTaskEntity.Id, scenarioEntity.Id, "scenario", ct);
            }

            var scenario = _mapper.Map <SAVM.Scenario>(scenarioEntity);

            _engineHub.Clients.All.SendAsync(EngineMethods.ScenarioCreated, scenario);

            return(scenario);
        }
示例#13
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     crane         = new ScenarioEntity <IScenery>(0, scenarioTag.WellKnownItems[0]);
     control_room  = new ScenarioEntity <IScenery>(1, scenarioTag.WellKnownItems[1]);
     center        = new ScenarioEntity <IScenery>(2, scenarioTag.WellKnownItems[2]);
     red_tower     = new ScenarioEntity <IScenery>(3, scenarioTag.WellKnownItems[3]);
     blue_tower    = new ScenarioEntity <IScenery>(4, scenarioTag.WellKnownItems[4]);
     bunker        = new ScenarioEntity <IScenery>(5, scenarioTag.WellKnownItems[5]);
     hvac_lift     = new ScenarioEntity <IBloc>(6, scenarioTag.WellKnownItems[6]);
     end_of_canal_water___office  = new ScenarioEntity <ISound>(8, scenarioTag.WellKnownItems[8]);
     end_of_canal_water___storage = new ScenarioEntity <ISound>(9, scenarioTag.WellKnownItems[9]);
     center_high_terries          = new ScenarioEntity <IScenery>(10, scenarioTag.WellKnownItems[10]);
     crane_base           = new ScenarioEntity <ISound>(11, scenarioTag.WellKnownItems[11]);
     crane_tower_cylinder = new ScenarioEntity <ISound>(41, scenarioTag.WellKnownItems[41]);
     garage_ambience      = new ScenarioEntity <ISound>(42, scenarioTag.WellKnownItems[42]);
     city_on_fire         = new ScenarioEntity <ISound>(43, scenarioTag.WellKnownItems[43]);
     control_desk         = new ScenarioEntity <ISound>(45, scenarioTag.WellKnownItems[45]);
     vending_machine      = new ScenarioEntity <ISound>(46, scenarioTag.WellKnownItems[46]);
     storage1             = new ScenarioEntity <ISound>(48, scenarioTag.WellKnownItems[48]);
     storage2             = new ScenarioEntity <ISound>(49, scenarioTag.WellKnownItems[49]);
     storage3             = new ScenarioEntity <ISound>(50, scenarioTag.WellKnownItems[50]);
     vertical_pipes       = new ScenarioEntity <ISound>(52, scenarioTag.WellKnownItems[52]);
     high_vent_1          = new ScenarioEntity <ISound>(53, scenarioTag.WellKnownItems[53]);
     high_vent_2          = new ScenarioEntity <ISound>(54, scenarioTag.WellKnownItems[54]);
     high_vent_6          = new ScenarioEntity <ISound>(55, scenarioTag.WellKnownItems[55]);
     high_vent_5          = new ScenarioEntity <ISound>(56, scenarioTag.WellKnownItems[56]);
     high_vent_4          = new ScenarioEntity <ISound>(57, scenarioTag.WellKnownItems[57]);
     high_vent_3          = new ScenarioEntity <ISound>(58, scenarioTag.WellKnownItems[58]);
     platform             = new ScenarioEntity <IScenery>(60, scenarioTag.WellKnownItems[60]);
     storage         = new ScenarioEntity <IScenery>(61, scenarioTag.WellKnownItems[61]);
     steam           = new ScenarioEntity <ISound>(64, scenarioTag.WellKnownItems[64]);
     steamcloseup    = new ScenarioEntity <ISound>(65, scenarioTag.WellKnownItems[65]);
     broken_light    = new ScenarioEntity <ISound>(66, scenarioTag.WellKnownItems[66]);
     vertical_pipe2  = new ScenarioEntity <ISound>(67, scenarioTag.WellKnownItems[67]);
     vertical_pipe_3 = new ScenarioEntity <ISound>(68, scenarioTag.WellKnownItems[68]);
     pipesvent1      = new ScenarioEntity <ISound>(69, scenarioTag.WellKnownItems[69]);
     pipesvent2      = new ScenarioEntity <ISound>(70, scenarioTag.WellKnownItems[70]);
     roofwalkvent    = new ScenarioEntity <ISound>(71, scenarioTag.WellKnownItems[71]);
     bigwallvent     = new ScenarioEntity <ISound>(72, scenarioTag.WellKnownItems[72]);
     bluebasepipes1  = new ScenarioEntity <ISound>(73, scenarioTag.WellKnownItems[73]);
     bluebasepipes2  = new ScenarioEntity <ISound>(74, scenarioTag.WellKnownItems[74]);
     matthole        = new ScenarioEntity <ISound>(75, scenarioTag.WellKnownItems[75]);
 }
示例#14
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     hanger_can_01 = new ScenarioEntity <IBloc>(0, scenarioTag.WellKnownItems[0]);
     static_01     = new ScenarioEntity <IBloc>(1, scenarioTag.WellKnownItems[1]);
     static_02     = new ScenarioEntity <IBloc>(2, scenarioTag.WellKnownItems[2]);
     static_03     = new ScenarioEntity <IBloc>(3, scenarioTag.WellKnownItems[3]);
     static_04     = new ScenarioEntity <IBloc>(4, scenarioTag.WellKnownItems[4]);
     hanger_can_07 = new ScenarioEntity <IBloc>(5, scenarioTag.WellKnownItems[5]);
     hanger_can_02 = new ScenarioEntity <IBloc>(6, scenarioTag.WellKnownItems[6]);
     hanger_can_03 = new ScenarioEntity <IBloc>(7, scenarioTag.WellKnownItems[7]);
     hanger_can_04 = new ScenarioEntity <IBloc>(8, scenarioTag.WellKnownItems[8]);
     hanger_can_05 = new ScenarioEntity <IBloc>(9, scenarioTag.WellKnownItems[9]);
     hanger_can_06 = new ScenarioEntity <IBloc>(10, scenarioTag.WellKnownItems[10]);
     hanger_can_08 = new ScenarioEntity <IBloc>(11, scenarioTag.WellKnownItems[11]);
     hanger_can_09 = new ScenarioEntity <IBloc>(12, scenarioTag.WellKnownItems[12]);
     hanger_can_10 = new ScenarioEntity <IBloc>(13, scenarioTag.WellKnownItems[13]);
     hanger_can_11 = new ScenarioEntity <IBloc>(14, scenarioTag.WellKnownItems[14]);
     hanger_can_12 = new ScenarioEntity <IBloc>(15, scenarioTag.WellKnownItems[15]);
 }
示例#15
0
        public async Task <ViewModels.Scenario> CopyAsync(Guid oldScenarioId, CancellationToken ct)
        {
            if (!(await _authorizationService.AuthorizeAsync(_user, null, new ContentDeveloperRequirement())).Succeeded)
            {
                throw new ForbiddenException();
            }

            var oldScenarioEntity = _context.Scenarios.Find(oldScenarioId);

            if (oldScenarioEntity == null)
            {
                throw new EntityNotFoundException <Scenario>($"Scenario {oldScenarioId} was not found.");
            }

            var newScenarioEntity = new ScenarioEntity()
            {
                CreatedBy     = _user.GetId(),
                Name          = $"Copy of {oldScenarioEntity.Name}",
                Description   = oldScenarioEntity.Description,
                DurationHours = oldScenarioEntity.DurationHours
            };

            _context.Scenarios.Add(newScenarioEntity);
            await _context.SaveChangesAsync(ct);

            // copy all of the DispatchTasks
            var oldDispatchTaskEntities = _context.DispatchTasks.Where(dt => dt.ScenarioId == oldScenarioId && dt.TriggerTaskId == null);

            // copy the PARENT DispatchTasks
            foreach (var oldDispatchTaskEntity in oldDispatchTaskEntities)
            {
                var newDispatchTaskEntity = await CopyDispatchTaskEntity(oldDispatchTaskEntity, null, newScenarioEntity.Id, ct);

                // copy this PARENT's subtasks
                await CopySubTasks(oldDispatchTaskEntity.Id, newDispatchTaskEntity, ct);
            }
            await _context.SaveChangesAsync(ct);

            return(await GetAsync(newScenarioEntity.Id, ct));
        }
示例#16
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario       = scenarioTag;
     ui_player2          = new ScenarioEntity <IUnit>(0, scenarioTag.WellKnownItems[0]);
     plasma_screen_lower = new ScenarioEntity <IScenery>(1, scenarioTag.WellKnownItems[1]);
     plasma_screen_upper = new ScenarioEntity <IScenery>(2, scenarioTag.WellKnownItems[2]);
     ui_player1          = new ScenarioEntity <IUnit>(3, scenarioTag.WellKnownItems[3]);
     ui_player3          = new ScenarioEntity <IUnit>(4, scenarioTag.WellKnownItems[4]);
     ui_player4          = new ScenarioEntity <IUnit>(5, scenarioTag.WellKnownItems[5]);
     halo_ring2          = new ScenarioEntity <IScenery>(6, scenarioTag.WellKnownItems[6]);
     ui_player1b         = new ScenarioEntity <IUnit>(7, scenarioTag.WellKnownItems[7]);
     ui_player2b         = new ScenarioEntity <IUnit>(8, scenarioTag.WellKnownItems[8]);
     ui_player3b         = new ScenarioEntity <IUnit>(9, scenarioTag.WellKnownItems[9]);
     ui_player4b         = new ScenarioEntity <IUnit>(10, scenarioTag.WellKnownItems[10]);
     ui_player1c         = new ScenarioEntity <IUnit>(11, scenarioTag.WellKnownItems[11]);
     ui_player1d         = new ScenarioEntity <IUnit>(12, scenarioTag.WellKnownItems[12]);
     ui_carrier          = new ScenarioEntity <IScenery>(13, scenarioTag.WellKnownItems[13]);
     ui_flak_01          = new ScenarioEntity <IScenery>(14, scenarioTag.WellKnownItems[14]);
     ui_flak_02          = new ScenarioEntity <IScenery>(15, scenarioTag.WellKnownItems[15]);
     ui_flak_03          = new ScenarioEntity <IScenery>(16, scenarioTag.WellKnownItems[16]);
     ui_flak_04          = new ScenarioEntity <IScenery>(17, scenarioTag.WellKnownItems[17]);
     ui_flak_05          = new ScenarioEntity <IScenery>(18, scenarioTag.WellKnownItems[18]);
 }
示例#17
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     receiver      = new ScenarioEntity <IScenery>(0, scenarioTag.WellKnownItems[0]);
 }
示例#18
0
        private async STT.Task <List <ResultEntity> > CreateResultsAsync(TaskEntity taskToExecute, ScenarioEntity scenarioEntity, Guid userId, CancellationToken ct)
        {
            var  resultEntities = new List <ResultEntity>();
            Guid?viewId         = null;

            if (taskToExecute.VmMask.Count() == 0)
            {
                // this task has no VM's associated. Create one result entity.  Used to send a command to an API, etc.
                var resultEntity = NewResultEntity(taskToExecute, userId);
                resultEntities.Add(resultEntity);
            }
            else
            {
                // A scenario is assigned to a specific view
                viewId = scenarioEntity.ViewId;
                // at this point, the VmMask could contain an actual mask, or a comma separated list of VM ID's
                var vmMaskList = taskToExecute.VmMask.Split(",").ToList();
                var vmIdList   = new List <Guid>();
                var vmList     = new List <Player.Vm.Api.Models.Vm>();
                // create the ID list, if the mask is a list of Guid's. If not Guid's, vmIdList will end up empty.
                foreach (var mask in vmMaskList)
                {
                    Guid vmId;
                    if (Guid.TryParse(mask, out vmId))
                    {
                        vmIdList.Add(vmId);
                    }
                }
                // determine if VM's should match by Name or ID
                var matchName = vmIdList.Count() == 0;
                // create a VmList from the view ID and the VmMask matching criteria
                try
                {
                    using (var scope = _scopeFactory.CreateScope())
                    {
                        PlayerVmApiClient vmApiClient = null;
                        var tokenResponse             = await ApiClientsExtensions.GetToken(scope);

                        vmApiClient = RefreshClient(vmApiClient, tokenResponse, ct);
                        var viewVms = await VmApiExtensions.GetViewVmsAsync(vmApiClient, (Guid)viewId, ct);

                        foreach (var vm in viewVms)
                        {
                            if ((!matchName && vmIdList.Contains((Guid)vm.Id)) || (matchName && vm.Name.ToLower().Contains(taskToExecute.VmMask.ToLower())))
                            {
                                vmList.Add(vm);
                            }
                        }
                    }
                }
                catch (System.Exception)
                {
                    _logger.LogDebug($"CreateResultsAsync - No VM's found in view {viewId}");
                }
                // make sure we are only matching a SINGLE view
                if (vmList.Count() > 0)
                {
                    // create a result for each matched VM
                    foreach (var vm in vmList)
                    {
                        var resultEntity = NewResultEntity(taskToExecute, userId);
                        resultEntity.VmId   = vm.Id;
                        resultEntity.VmName = vm.Name;
                        resultEntities.Add(resultEntity);
                    }
                }
                else
                {
                    // Houston, we've had a problem.  Create a single result to show the error
                    var resultEntity = NewResultEntity(taskToExecute, userId);
                    if (viewId != null)
                    {
                        // The problem is that NO VM's matched
                        resultEntity.ActualOutput = $"No matched VMs!  VM Mask: {taskToExecute.VmMask}.";
                    }
                    else if (scenarioEntity != null)
                    {
                        // The problem is that this task did not have a scenario or a viewId
                        resultEntity.ActualOutput = $"There was no view associated with this task's scenario!  {taskToExecute.Name} ({taskToExecute.Id})";
                    }
                    else
                    {
                        // The problem is that this task did not have a scenario or a viewId
                        resultEntity.ActualOutput = $"There was no scenario associated with this task!  {taskToExecute.Name} ({taskToExecute.Id})";
                    }
                    _logger.LogError($"CreateResultsAsync - {resultEntity.ActualOutput}");
                    resultEntity.Status     = Data.TaskStatus.error;
                    resultEntity.StatusDate = DateTime.UtcNow;
                    resultEntities.Add(resultEntity);
                }
            }
            return(resultEntities);
        }
示例#19
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario = scenarioTag;
     Unnamed       = new ScenarioEntity <ISound>(0, scenarioTag.WellKnownItems[0]);
 }
示例#20
0
        public async STT.Task <ViewModels.Scenario> CreateFromScenarioTemplateAsync(Guid scenarioTemplateId, SAVM.ScenarioCloneOptions options, CancellationToken ct)
        {
            if (!(await _authorizationService.AuthorizeAsync(_user, null, new ContentDeveloperRequirement())).Succeeded)
            {
                throw new ForbiddenException();
            }

            await using var transaction = await _context.Database.BeginTransactionAsync(ct);

            var scenarioTemplateEntity = _context.ScenarioTemplates.Find(scenarioTemplateId);

            if (scenarioTemplateEntity == null)
            {
                throw new EntityNotFoundException <SAVM.ScenarioTemplate>($"ScenarioTemplate {scenarioTemplateId} was not found.");
            }

            var scenarioEntity = new ScenarioEntity()
            {
                CreatedBy          = _user.GetId(),
                Name               = $"{scenarioTemplateEntity.Name} - {_user.Claims.FirstOrDefault(c => c.Type == "name").Value}",
                Description        = scenarioTemplateEntity.Description,
                OnDemand           = true,
                ScenarioTemplateId = scenarioTemplateId
            };

            var durationHours = scenarioTemplateEntity.DurationHours != null ? (int)scenarioTemplateEntity.DurationHours : 720;

            scenarioEntity.EndDate = scenarioEntity.StartDate.AddHours(durationHours);
            _context.Scenarios.Add(scenarioEntity);
            await _context.SaveChangesAsync(ct);

            // copy all of the VmCredentials
            var oldVmCredentials         = _context.VmCredentials.Where(vmc => vmc.ScenarioTemplateId == scenarioTemplateId).ToList();
            var newDefaultVmCredentialId = await CopyVmCredentials(scenarioTemplateEntity.DefaultVmCredentialId, null, scenarioEntity.Id, oldVmCredentials, ct);

            scenarioEntity.DefaultVmCredentialId = newDefaultVmCredentialId;
            await _context.SaveChangesAsync(ct);

            // copy all of the Tasks
            var oldTaskEntities = _context.Tasks.Where(dt => dt.ScenarioTemplateId == scenarioTemplateId && dt.TriggerTaskId == null).ToList();

            // copy the PARENT Tasks
            foreach (var oldTaskEntity in oldTaskEntities)
            {
                await _taskService.CopyAsync(oldTaskEntity.Id, scenarioEntity.Id, "scenario", ct);
            }

            if (options != null)
            {
                if (!string.IsNullOrEmpty(options.NameSuffix))
                {
                    scenarioEntity.Name = scenarioTemplateEntity.Name + options.NameSuffix;
                }

                if (options.ViewId.HasValue)
                {
                    scenarioEntity.ViewId = options.ViewId;
                }

                if (options.UserIds != null && options.UserIds.Any())
                {
                    await AddUsersAsync(scenarioEntity.Id, options.UserIds, ct);
                }

                await _context.SaveChangesAsync(ct);
            }

            await transaction.CommitAsync(ct);

            var scenario = _mapper.Map <SAVM.Scenario>(scenarioEntity);

            return(scenario);
        }
示例#21
0
        public static void Run(SteamfitterContext context)
        {
            // sketch users
            var uAdministrator = new UserEntity {
                Id = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), Name = "admin user"
            };

            context.Users.Add(uAdministrator);

            // scenarioTemplates
            var scenarioTemplate1 = new ScenarioTemplateEntity {
                Name = "First ScenarioTemplate", Description = "My first scenarioTemplate", CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow, DurationHours = 1
            };

            context.ScenarioTemplates.Add(scenarioTemplate1);
            var scenarioTemplate2 = new ScenarioTemplateEntity {
                Name = "Second ScenarioTemplate", Description = "My second scenarioTemplate", CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow, DurationHours = 2
            };

            context.ScenarioTemplates.Add(scenarioTemplate2);
            var scenarioTemplate3 = new ScenarioTemplateEntity {
                Name = "Third ScenarioTemplate", Description = "My third scenarioTemplate", CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow, DurationHours = 3
            };

            context.ScenarioTemplates.Add(scenarioTemplate3);
            context.SaveChanges();
            // scenarios
            var scenario1 = new ScenarioEntity {
                Name = "Scenario001", Description = "Scenario #1", ScenarioTemplateId = scenarioTemplate1.Id, StartDate = DateTime.UtcNow, EndDate = DateTime.UtcNow.AddMonths(1), DateCreated = DateTime.UtcNow, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), ViewId = Guid.Parse("453d394e-bf18-499b-9786-149b0f8d69ec"), View = "RCC -E EM 2018", Status = ScenarioStatus.ready, OnDemand = false
            };

            context.Scenarios.Add(scenario1);
            var scenario2 = new ScenarioEntity {
                Name = "Scenario002", Description = "Scenario #2", ScenarioTemplateId = scenarioTemplate1.Id, StartDate = DateTime.UtcNow, EndDate = DateTime.UtcNow.AddMonths(2), DateCreated = DateTime.UtcNow, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), ViewId = Guid.Parse("453d394e-bf18-499b-9786-149b0f8d69ec"), View = "RCC -E EM 2018", Status = ScenarioStatus.ready, OnDemand = false
            };

            context.Scenarios.Add(scenario2);
            context.SaveChanges();

            // //scenarioVms  (or 5209fff8-8098-f1de-40c3-ac0eb1c8d515?)
            // var vm1 = new ScenarioVmEntity {ScenarioId =scenario1.Id, Vm = Guid.Parse("0539a863-ece6-4ca7-ae8d-f46a909526e9")};
            // context.ScenarioVms.Add(vm1);
            // context.SaveChanges();
            // VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9")

            // scenarioTemplate #1 tasks
            var task2 = new TaskEntity {
                Name = "Get host name", Description = "For scenarioTemplate #1 get the host name from player-vm", ScenarioTemplateId = scenarioTemplate1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_process_run, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"CommandText\": \"CMD.EXE\", \"CommandArgs\": \"/c hostname\"}", ExpectedOutput = "DESKTOP-OM1GOK7", TriggerCondition = TaskTrigger.Manual, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task2);
            var task2b = new TaskEntity {
                Name = "Run netstat -an", Description = "For sceanrion #1 run netstat -an against all of the vm's", ScenarioTemplateId = scenarioTemplate1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_process_run, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"CommandText\": \"CMD.EXE\", \"CommandArgs\": \"/c netstat -an\"}", ExpectedOutput = "This will never work!", TriggerCondition = TaskTrigger.Manual, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task2b);
            // sceanrio #2 tasks
            var taskC1 = new TaskEntity {
                Name = "Parent Task #1", Description = "Read the test file from player-vm", ScenarioTemplateId = scenarioTemplate2.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testGet.txt\"}", ExpectedOutput = "This is the text from the TEST file.", TriggerCondition = TaskTrigger.Manual, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(taskC1);
            var taskC1b = new TaskEntity {
                Name = "Success Task", Description = "Read the success file from player-vm", ScenarioTemplateId = scenarioTemplate2.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testSuccess.txt\"}", ExpectedOutput = "This is the text from the SUCCESS file.", TriggerTask = taskC1, TriggerCondition = TaskTrigger.Success, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(taskC1b);
            var taskC3 = new TaskEntity {
                Name = "Failure Task", Description = "Read the failure file from player-vm", ScenarioTemplateId = scenarioTemplate2.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testFailure.txt\"}", ExpectedOutput = "This is the text from the FAILURE file.", TriggerTask = taskC1, TriggerCondition = TaskTrigger.Failure, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(taskC3);
            var taskC4 = new TaskEntity {
                Name = "Completion Task", Description = "Read the completion file from player-vm", ScenarioTemplateId = scenarioTemplate2.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testCompletion.txt\"}", ExpectedOutput = "This is the text from the COMPLETION file.", TriggerTask = taskC1, TriggerCondition = TaskTrigger.Completion, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(taskC4);
            var taskC5 = new TaskEntity {
                Name = "Expiration Task", Description = "Read the expiration file from player-vm", ScenarioTemplateId = scenarioTemplate2.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testExpiration.txt\"}", ExpectedOutput = "This is the text from the EXPIRATION file.", TriggerTask = taskC1, TriggerCondition = TaskTrigger.Expiration, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(taskC5);
            var taskC6 = new TaskEntity {
                Name = "Delayed Task", Description = "Read the delay file from player-vm", ScenarioTemplateId = scenarioTemplate2.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testDelay.txt\"}", ExpectedOutput = "This is the text from the DELAY file.", TriggerTask = taskC4, TriggerCondition = TaskTrigger.Completion, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, DelaySeconds = 10, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(taskC6);
            // scenario #1 tasks
            var task1 = new TaskEntity {
                Name = "Parent Task", Description = "Parent Task #1a", ScenarioId = scenario1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testGet.txt\"}", ExpectedOutput = "This is the text from the TEST file.", TriggerCondition = TaskTrigger.Manual, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task1);
            var task1b = new TaskEntity {
                Name = "Success Task", Description = "Success Task #1b", ScenarioId = scenario1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testSuccess.txt\"}", ExpectedOutput = "This is the text from the SUCCESS file.", TriggerTask = task1, TriggerCondition = TaskTrigger.Success, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task1b);
            context.Tasks.Add(task2b);
            var task3 = new TaskEntity {
                Name = "Failure Task", Description = "Failure Task #3", ScenarioId = scenario1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testFailure.txt\"}", ExpectedOutput = "This is the text from the FAILURE file.", TriggerTask = task1, TriggerCondition = TaskTrigger.Failure, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task3);
            var task4 = new TaskEntity {
                Name = "Completion Task", Description = "Completion Task #4", ScenarioId = scenario1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testCompletion.txt\"}", ExpectedOutput = "This is the text from the COMPLETION file.", TriggerTask = task1, TriggerCondition = TaskTrigger.Completion, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task4);
            var task5 = new TaskEntity {
                Name = "Expiration Task", Description = "Expiration Task #5", ScenarioId = scenario1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testExpiration.txt\"}", ExpectedOutput = "This is the text from the EXPIRATION file.", TriggerTask = task1, TriggerCondition = TaskTrigger.Expiration, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task5);
            var task6 = new TaskEntity {
                Name = "Delayed Task", Description = "Delayed Task #6", ScenarioId = scenario1.Id, ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testDelay.txt\"}", ExpectedOutput = "This is the text from the DELAY file.", TriggerTask = task4, TriggerCondition = TaskTrigger.Completion, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, DelaySeconds = 10, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task6);
            // independent task
            var task1c = new TaskEntity {
                Name = "Independent Task", Description = "Independent Task #1c", ApiUrl = "stackstorm", Action = TaskAction.guest_file_read, InputString = "{\"VmGuid\": \"42313053-c2e6-42af-cf2a-6db9f791794a\", \"Username\": \"Developer\", \"Password\": \"develop@1\", \"GuestFilePath\": \"C:\\\\Users\\\\Developer\\\\testGet.txt\"}", ExpectedOutput = "This is the text from the TEST file.", TriggerCondition = TaskTrigger.Manual, ExpirationSeconds = 0, IntervalSeconds = 0, Iterations = 0, CreatedBy = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), UserId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), DateCreated = DateTime.UtcNow
            };

            context.Tasks.Add(task1c);
            context.SaveChanges();

            // // Results
            context.Results.Add(new ResultEntity {
                TaskId = task1.Id, VmId = Guid.Parse("0539a863-ece6-4ca7-ae8d-f46a909526e9"), VmName = "VM2", Status = TaskStatus.queued, InputString = "copy test1.txt success.txt", ExpectedOutput = "Copied", ExpirationSeconds = 61, Iterations = 1, IntervalSeconds = 0, DateCreated = DateTime.Now.AddMinutes(-33)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.queued, InputString = "copy test2.txt success.txt", ExpectedOutput = "Oh boy!", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-43)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.succeeded, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ActualOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-53)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.failed, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ActualOutput = "Failure", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-55)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.succeeded, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ActualOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-153)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.sent, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-155)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.error, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-156)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.queued, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-157)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.expired, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-158)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.pending, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-159)
            });
            context.Results.Add(new ResultEntity {
                TaskId = task2.Id, VmId = Guid.Parse("9fd3c38e-58b0-4af1-80d1-1895af91f1f9"), VmName = "VM3", Status = TaskStatus.cancelled, InputString = "copy test.txt success.txt", ExpectedOutput = "Completed", ExpirationSeconds = 62, Iterations = 2, IntervalSeconds = 120, DateCreated = DateTime.Now.AddMinutes(-175)
            });
            context.SaveChanges();

            Console.WriteLine("Seed data completed");
        }
示例#22
0
 public override void InitializeData(ScenarioTag scenarioTag, Scene scene)
 {
     this.Scenario      = scenarioTag;
     dervish            = new ScenarioEntity <IUnit>(0, scenarioTag.WellKnownItems[0]);
     tartarus           = new ScenarioEntity <IUnit>(1, scenarioTag.WellKnownItems[1]);
     prophet_counc_01   = new ScenarioEntity <IUnit>(2, scenarioTag.WellKnownItems[2]);
     prophet_counc_02   = new ScenarioEntity <IUnit>(3, scenarioTag.WellKnownItems[3]);
     prophet_counc_03   = new ScenarioEntity <IUnit>(4, scenarioTag.WellKnownItems[4]);
     prophet_counc_04   = new ScenarioEntity <IUnit>(5, scenarioTag.WellKnownItems[5]);
     elite_counc_01     = new ScenarioEntity <IUnit>(6, scenarioTag.WellKnownItems[6]);
     elite_counc_02     = new ScenarioEntity <IUnit>(7, scenarioTag.WellKnownItems[7]);
     brute_01           = new ScenarioEntity <IUnit>(8, scenarioTag.WellKnownItems[8]);
     brute_02           = new ScenarioEntity <IUnit>(9, scenarioTag.WellKnownItems[9]);
     cruiser_01         = new ScenarioEntity <IScenery>(10, scenarioTag.WellKnownItems[10]);
     cruiser_02         = new ScenarioEntity <IScenery>(11, scenarioTag.WellKnownItems[11]);
     cruiser_03         = new ScenarioEntity <IScenery>(12, scenarioTag.WellKnownItems[12]);
     cruiser_04         = new ScenarioEntity <IScenery>(13, scenarioTag.WellKnownItems[13]);
     cruiser_05         = new ScenarioEntity <IScenery>(14, scenarioTag.WellKnownItems[14]);
     cruiser_06         = new ScenarioEntity <IScenery>(15, scenarioTag.WellKnownItems[15]);
     cruiser_07         = new ScenarioEntity <IScenery>(16, scenarioTag.WellKnownItems[16]);
     cruiser_08         = new ScenarioEntity <IScenery>(17, scenarioTag.WellKnownItems[17]);
     cruiser_09         = new ScenarioEntity <IScenery>(18, scenarioTag.WellKnownItems[18]);
     cruiser_10         = new ScenarioEntity <IScenery>(19, scenarioTag.WellKnownItems[19]);
     cruiser_11         = new ScenarioEntity <IScenery>(20, scenarioTag.WellKnownItems[20]);
     cruiser_12         = new ScenarioEntity <IScenery>(21, scenarioTag.WellKnownItems[21]);
     anchor_x01b        = new ScenarioEntity <IScenery>(22, scenarioTag.WellKnownItems[22]);
     anchor_x01a        = new ScenarioEntity <IScenery>(23, scenarioTag.WellKnownItems[23]);
     hammer             = new ScenarioEntity <IScenery>(24, scenarioTag.WellKnownItems[24]);
     poa_01             = new ScenarioEntity <IScenery>(25, scenarioTag.WellKnownItems[25]);
     halo_exploding     = new ScenarioEntity <IScenery>(26, scenarioTag.WellKnownItems[26]);
     matte_threshold    = new ScenarioEntity <IScenery>(27, scenarioTag.WellKnownItems[27]);
     matte_halo_01      = new ScenarioEntity <IScenery>(28, scenarioTag.WellKnownItems[28]);
     matte_halo_02      = new ScenarioEntity <IScenery>(29, scenarioTag.WellKnownItems[29]);
     matte_reach        = new ScenarioEntity <IScenery>(30, scenarioTag.WellKnownItems[30]);
     banshee_01         = new ScenarioEntity <IVehicle>(31, scenarioTag.WellKnownItems[31]);
     banshee_02         = new ScenarioEntity <IVehicle>(32, scenarioTag.WellKnownItems[32]);
     banshee_03         = new ScenarioEntity <IVehicle>(33, scenarioTag.WellKnownItems[33]);
     banshee_04         = new ScenarioEntity <IVehicle>(34, scenarioTag.WellKnownItems[34]);
     banshee_05         = new ScenarioEntity <IVehicle>(35, scenarioTag.WellKnownItems[35]);
     banshee_06         = new ScenarioEntity <IVehicle>(36, scenarioTag.WellKnownItems[36]);
     banshee_07         = new ScenarioEntity <IVehicle>(37, scenarioTag.WellKnownItems[37]);
     banshee_08         = new ScenarioEntity <IVehicle>(38, scenarioTag.WellKnownItems[38]);
     banshee_09         = new ScenarioEntity <IVehicle>(39, scenarioTag.WellKnownItems[39]);
     banshee_10         = new ScenarioEntity <IVehicle>(40, scenarioTag.WellKnownItems[40]);
     matte_high_charity = new ScenarioEntity <IScenery>(41, scenarioTag.WellKnownItems[41]);
     halo_whole         = new ScenarioEntity <IScenery>(42, scenarioTag.WellKnownItems[42]);
     malta             = new ScenarioEntity <IScenery>(43, scenarioTag.WellKnownItems[43]);
     cairo             = new ScenarioEntity <IScenery>(44, scenarioTag.WellKnownItems[44]);
     athens            = new ScenarioEntity <IScenery>(45, scenarioTag.WellKnownItems[45]);
     iac_01            = new ScenarioEntity <IScenery>(46, scenarioTag.WellKnownItems[46]);
     matte_earth       = new ScenarioEntity <IScenery>(47, scenarioTag.WellKnownItems[47]);
     cart              = new ScenarioEntity <IScenery>(48, scenarioTag.WellKnownItems[48]);
     optics            = new ScenarioEntity <IScenery>(49, scenarioTag.WellKnownItems[49]);
     power_supply      = new ScenarioEntity <IScenery>(50, scenarioTag.WellKnownItems[50]);
     helmet            = new ScenarioEntity <IScenery>(51, scenarioTag.WellKnownItems[51]);
     chief             = new ScenarioEntity <IUnit>(52, scenarioTag.WellKnownItems[52]);
     master_guns       = new ScenarioEntity <IUnit>(53, scenarioTag.WellKnownItems[53]);
     matte_moon        = new ScenarioEntity <IScenery>(54, scenarioTag.WellKnownItems[54]);
     armory            = new ScenarioEntity <IScenery>(55, scenarioTag.WellKnownItems[55]);
     regret            = new ScenarioEntity <IUnit>(56, scenarioTag.WellKnownItems[56]);
     truth             = new ScenarioEntity <IUnit>(57, scenarioTag.WellKnownItems[57]);
     mercy             = new ScenarioEntity <IUnit>(58, scenarioTag.WellKnownItems[58]);
     throne_regret     = new ScenarioEntity <IVehicle>(59, scenarioTag.WellKnownItems[59]);
     throne_truth      = new ScenarioEntity <IVehicle>(60, scenarioTag.WellKnownItems[60]);
     throne_mercy      = new ScenarioEntity <IVehicle>(61, scenarioTag.WellKnownItems[61]);
     elc_01            = new ScenarioEntity <IScenery>(62, scenarioTag.WellKnownItems[62]);
     elc_02            = new ScenarioEntity <IScenery>(63, scenarioTag.WellKnownItems[63]);
     elc_03            = new ScenarioEntity <IScenery>(64, scenarioTag.WellKnownItems[64]);
     elc_04            = new ScenarioEntity <IScenery>(65, scenarioTag.WellKnownItems[65]);
     elc_05            = new ScenarioEntity <IScenery>(66, scenarioTag.WellKnownItems[66]);
     elc_06            = new ScenarioEntity <IScenery>(67, scenarioTag.WellKnownItems[67]);
     elc_07            = new ScenarioEntity <IScenery>(68, scenarioTag.WellKnownItems[68]);
     elc_08            = new ScenarioEntity <IScenery>(69, scenarioTag.WellKnownItems[69]);
     elc_09            = new ScenarioEntity <IScenery>(70, scenarioTag.WellKnownItems[70]);
     elc_10            = new ScenarioEntity <IScenery>(71, scenarioTag.WellKnownItems[71]);
     elc_11            = new ScenarioEntity <IScenery>(72, scenarioTag.WellKnownItems[72]);
     elc_12            = new ScenarioEntity <IScenery>(73, scenarioTag.WellKnownItems[73]);
     elc_13            = new ScenarioEntity <IScenery>(74, scenarioTag.WellKnownItems[74]);
     elc_14            = new ScenarioEntity <IScenery>(75, scenarioTag.WellKnownItems[75]);
     elc_15            = new ScenarioEntity <IScenery>(76, scenarioTag.WellKnownItems[76]);
     elc_16            = new ScenarioEntity <IScenery>(77, scenarioTag.WellKnownItems[77]);
     elc_17            = new ScenarioEntity <IScenery>(78, scenarioTag.WellKnownItems[78]);
     elc_18            = new ScenarioEntity <IScenery>(79, scenarioTag.WellKnownItems[79]);
     elc_19            = new ScenarioEntity <IScenery>(80, scenarioTag.WellKnownItems[80]);
     elc_20            = new ScenarioEntity <IScenery>(81, scenarioTag.WellKnownItems[81]);
     elc_21            = new ScenarioEntity <IScenery>(82, scenarioTag.WellKnownItems[82]);
     elc_22            = new ScenarioEntity <IScenery>(83, scenarioTag.WellKnownItems[83]);
     elc_23            = new ScenarioEntity <IScenery>(84, scenarioTag.WellKnownItems[84]);
     elc_24            = new ScenarioEntity <IScenery>(85, scenarioTag.WellKnownItems[85]);
     elc_25            = new ScenarioEntity <IScenery>(86, scenarioTag.WellKnownItems[86]);
     elc_26            = new ScenarioEntity <IScenery>(87, scenarioTag.WellKnownItems[87]);
     elc_27            = new ScenarioEntity <IScenery>(88, scenarioTag.WellKnownItems[88]);
     elc_28            = new ScenarioEntity <IScenery>(89, scenarioTag.WellKnownItems[89]);
     elc_29            = new ScenarioEntity <IScenery>(90, scenarioTag.WellKnownItems[90]);
     elc_30            = new ScenarioEntity <IScenery>(91, scenarioTag.WellKnownItems[91]);
     pcc_01            = new ScenarioEntity <IScenery>(92, scenarioTag.WellKnownItems[92]);
     pcc_02            = new ScenarioEntity <IScenery>(93, scenarioTag.WellKnownItems[93]);
     pcc_03            = new ScenarioEntity <IScenery>(94, scenarioTag.WellKnownItems[94]);
     pcc_04            = new ScenarioEntity <IScenery>(95, scenarioTag.WellKnownItems[95]);
     pcc_05            = new ScenarioEntity <IScenery>(96, scenarioTag.WellKnownItems[96]);
     pcc_06            = new ScenarioEntity <IScenery>(97, scenarioTag.WellKnownItems[97]);
     pcc_07            = new ScenarioEntity <IScenery>(98, scenarioTag.WellKnownItems[98]);
     pcc_08            = new ScenarioEntity <IScenery>(99, scenarioTag.WellKnownItems[99]);
     pcc_09            = new ScenarioEntity <IScenery>(100, scenarioTag.WellKnownItems[100]);
     pcc_10            = new ScenarioEntity <IScenery>(101, scenarioTag.WellKnownItems[101]);
     pcc_11            = new ScenarioEntity <IScenery>(102, scenarioTag.WellKnownItems[102]);
     pcc_12            = new ScenarioEntity <IScenery>(103, scenarioTag.WellKnownItems[103]);
     pcc_13            = new ScenarioEntity <IScenery>(104, scenarioTag.WellKnownItems[104]);
     pcc_14            = new ScenarioEntity <IScenery>(105, scenarioTag.WellKnownItems[105]);
     pcc_15            = new ScenarioEntity <IScenery>(106, scenarioTag.WellKnownItems[106]);
     pcc_16            = new ScenarioEntity <IScenery>(107, scenarioTag.WellKnownItems[107]);
     pcc_17            = new ScenarioEntity <IScenery>(108, scenarioTag.WellKnownItems[108]);
     pcc_18            = new ScenarioEntity <IScenery>(109, scenarioTag.WellKnownItems[109]);
     pcc_19            = new ScenarioEntity <IScenery>(110, scenarioTag.WellKnownItems[110]);
     pcc_20            = new ScenarioEntity <IScenery>(111, scenarioTag.WellKnownItems[111]);
     pcc_21            = new ScenarioEntity <IScenery>(112, scenarioTag.WellKnownItems[112]);
     pcc_22            = new ScenarioEntity <IScenery>(113, scenarioTag.WellKnownItems[113]);
     pcc_23            = new ScenarioEntity <IScenery>(114, scenarioTag.WellKnownItems[114]);
     pcc_24            = new ScenarioEntity <IScenery>(115, scenarioTag.WellKnownItems[115]);
     pcc_25            = new ScenarioEntity <IScenery>(116, scenarioTag.WellKnownItems[116]);
     pcc_26            = new ScenarioEntity <IScenery>(117, scenarioTag.WellKnownItems[117]);
     pcc_27            = new ScenarioEntity <IScenery>(118, scenarioTag.WellKnownItems[118]);
     pcc_28            = new ScenarioEntity <IScenery>(119, scenarioTag.WellKnownItems[119]);
     pcc_29            = new ScenarioEntity <IScenery>(120, scenarioTag.WellKnownItems[120]);
     pcc_30            = new ScenarioEntity <IScenery>(121, scenarioTag.WellKnownItems[121]);
     pcc_31            = new ScenarioEntity <IScenery>(122, scenarioTag.WellKnownItems[122]);
     pcc_32            = new ScenarioEntity <IScenery>(123, scenarioTag.WellKnownItems[123]);
     carrier_01        = new ScenarioEntity <IScenery>(124, scenarioTag.WellKnownItems[124]);
     carrier_02        = new ScenarioEntity <IScenery>(125, scenarioTag.WellKnownItems[125]);
     carrier_03        = new ScenarioEntity <IScenery>(126, scenarioTag.WellKnownItems[126]);
     carrier_04        = new ScenarioEntity <IScenery>(127, scenarioTag.WellKnownItems[127]);
     carrier_05        = new ScenarioEntity <IScenery>(128, scenarioTag.WellKnownItems[128]);
     carrier_06        = new ScenarioEntity <IScenery>(129, scenarioTag.WellKnownItems[129]);
     carrier_07        = new ScenarioEntity <IScenery>(130, scenarioTag.WellKnownItems[130]);
     carrier_08        = new ScenarioEntity <IScenery>(131, scenarioTag.WellKnownItems[131]);
     x01_fleet         = new ScenarioEntity <IScenery>(132, scenarioTag.WellKnownItems[132]);
     ehg_01            = new ScenarioEntity <IScenery>(133, scenarioTag.WellKnownItems[133]);
     ehg_02            = new ScenarioEntity <IScenery>(134, scenarioTag.WellKnownItems[134]);
     ehg_03            = new ScenarioEntity <IScenery>(135, scenarioTag.WellKnownItems[135]);
     ehg_04            = new ScenarioEntity <IScenery>(136, scenarioTag.WellKnownItems[136]);
     ehg_05            = new ScenarioEntity <IScenery>(137, scenarioTag.WellKnownItems[137]);
     ehg_06            = new ScenarioEntity <IScenery>(138, scenarioTag.WellKnownItems[138]);
     ehg_07            = new ScenarioEntity <IScenery>(139, scenarioTag.WellKnownItems[139]);
     ehg_08            = new ScenarioEntity <IScenery>(140, scenarioTag.WellKnownItems[140]);
     ehg_09            = new ScenarioEntity <IScenery>(141, scenarioTag.WellKnownItems[141]);
     ehg_10            = new ScenarioEntity <IScenery>(142, scenarioTag.WellKnownItems[142]);
     elc_31            = new ScenarioEntity <IScenery>(143, scenarioTag.WellKnownItems[143]);
     elc_32            = new ScenarioEntity <IScenery>(144, scenarioTag.WellKnownItems[144]);
     elc_33            = new ScenarioEntity <IScenery>(145, scenarioTag.WellKnownItems[145]);
     elc_34            = new ScenarioEntity <IScenery>(146, scenarioTag.WellKnownItems[146]);
     elc_35            = new ScenarioEntity <IScenery>(147, scenarioTag.WellKnownItems[147]);
     elc_36            = new ScenarioEntity <IScenery>(148, scenarioTag.WellKnownItems[148]);
     elc_37            = new ScenarioEntity <IScenery>(149, scenarioTag.WellKnownItems[149]);
     elc_38            = new ScenarioEntity <IScenery>(150, scenarioTag.WellKnownItems[150]);
     elc_39            = new ScenarioEntity <IScenery>(151, scenarioTag.WellKnownItems[151]);
     elc_40            = new ScenarioEntity <IScenery>(152, scenarioTag.WellKnownItems[152]);
     elc_41            = new ScenarioEntity <IScenery>(153, scenarioTag.WellKnownItems[153]);
     elc_42            = new ScenarioEntity <IScenery>(154, scenarioTag.WellKnownItems[154]);
     pcc_33            = new ScenarioEntity <IScenery>(155, scenarioTag.WellKnownItems[155]);
     pcc_34            = new ScenarioEntity <IScenery>(156, scenarioTag.WellKnownItems[156]);
     pcc_35            = new ScenarioEntity <IScenery>(157, scenarioTag.WellKnownItems[157]);
     pcc_36            = new ScenarioEntity <IScenery>(158, scenarioTag.WellKnownItems[158]);
     pcc_37            = new ScenarioEntity <IScenery>(159, scenarioTag.WellKnownItems[159]);
     pcc_38            = new ScenarioEntity <IScenery>(160, scenarioTag.WellKnownItems[160]);
     iac_02            = new ScenarioEntity <IScenery>(161, scenarioTag.WellKnownItems[161]);
     iac_03            = new ScenarioEntity <IScenery>(162, scenarioTag.WellKnownItems[162]);
     iac_04            = new ScenarioEntity <IScenery>(163, scenarioTag.WellKnownItems[163]);
     iac_05            = new ScenarioEntity <IScenery>(164, scenarioTag.WellKnownItems[164]);
     poa_02            = new ScenarioEntity <IScenery>(165, scenarioTag.WellKnownItems[165]);
     poa_03            = new ScenarioEntity <IScenery>(166, scenarioTag.WellKnownItems[166]);
     fighter_01        = new ScenarioEntity <IScenery>(167, scenarioTag.WellKnownItems[167]);
     fighter_02        = new ScenarioEntity <IScenery>(168, scenarioTag.WellKnownItems[168]);
     fighter_03        = new ScenarioEntity <IScenery>(169, scenarioTag.WellKnownItems[169]);
     fighter_04        = new ScenarioEntity <IScenery>(170, scenarioTag.WellKnownItems[170]);
     fighter_05        = new ScenarioEntity <IScenery>(171, scenarioTag.WellKnownItems[171]);
     fighter_06        = new ScenarioEntity <IScenery>(172, scenarioTag.WellKnownItems[172]);
     fighter_07        = new ScenarioEntity <IScenery>(173, scenarioTag.WellKnownItems[173]);
     fighter_08        = new ScenarioEntity <IScenery>(174, scenarioTag.WellKnownItems[174]);
     ehg_11            = new ScenarioEntity <IScenery>(175, scenarioTag.WellKnownItems[175]);
     ehg_12            = new ScenarioEntity <IScenery>(176, scenarioTag.WellKnownItems[176]);
     yellow_01a        = new ScenarioEntity <IScenery>(177, scenarioTag.WellKnownItems[177]);
     yellow_01b        = new ScenarioEntity <IScenery>(178, scenarioTag.WellKnownItems[178]);
     yellow_02a        = new ScenarioEntity <IScenery>(179, scenarioTag.WellKnownItems[179]);
     yellow_02b        = new ScenarioEntity <IScenery>(180, scenarioTag.WellKnownItems[180]);
     red_01            = new ScenarioEntity <IScenery>(181, scenarioTag.WellKnownItems[181]);
     matte_stardust_01 = new ScenarioEntity <IScenery>(182, scenarioTag.WellKnownItems[182]);
     matte_stardust_02 = new ScenarioEntity <IScenery>(183, scenarioTag.WellKnownItems[183]);
 }