Exemplo n.º 1
0
        public void BuildScripts()
        {
#if DEBUG
            DebugService.LogInfo("BuildScripts started");
#endif
#if PERF
            int start = Environment.TickCount;
#endif

            for (int i = 0; i < Abc.Instances.Count; ++i)
            {
                var instance = Abc.Instances[i];
                if (instance.Script != null)
                {
                    continue;
                }
                DefineScript(instance);
            }

#if PERF
            Console.WriteLine("AbcGen.BuildScripts: {0}", Environment.TickCount - start);
#endif

#if DEBUG
            DebugService.LogInfo("BuildScripts succeeded");
#endif
        }
 public ScopesHandler(
     ILoggerFactory loggerFactory,
     DebugService debugService)
 {
     _logger       = loggerFactory.CreateLogger <ScopesHandler>();
     _debugService = debugService;
 }
Exemplo n.º 3
0
        public override void LoadContent()
        {
            _serviceContainer        = new ServiceContainer(_simulationState, ScreenManager.Game.Content, ScreenManager.Game.GraphicsDevice);
            _serviceContainer.Map    = new Map(_simulationState.MapName);
            _serviceContainer.Camera = new Camera2D(new Viewport(0, 0, 638, 566), (int)_serviceContainer.Map.WorldSizePixels.X, (int)_serviceContainer.Map.WorldSizePixels.Y, 1.0f);
            _serviceContainer.Camera.Move(new Vector2(319, 248));


            _mapRenderingService = new MapRenderingService();
            var spriteRenderingService = new SpriteRenderingService();
            var networkInputService    = new NetworkInputService(_playerID);
            var explosionService       = new ExplosionSpriteService();

            var movementService = new MovementService(_playerID);

            movementService.SpriteDescriptorLookup = spriteRenderingService.SpriteDescriptorLookup;

            var entitySyncService         = new EntitySyncService();
            var interfaceRenderingService = new InterfaceRenderingService();

            _debugService = new DebugService();

            _serviceContainer.AddService(_mapRenderingService);
            _serviceContainer.AddService(spriteRenderingService);
            _serviceContainer.AddService(networkInputService);
            _serviceContainer.AddService(movementService);
            _serviceContainer.AddService(entitySyncService);
            _serviceContainer.AddService(_debugService);
            _serviceContainer.AddService(explosionService);
            _serviceContainer.AddService(interfaceRenderingService);


            base.LoadContent();
        }
Exemplo n.º 4
0
 public ZergBuildingPlacement(ActiveUnitData activeUnitData, SharkyUnitData sharkyUnitData, DebugService debugService, BuildingService buildingService)
 {
     ActiveUnitData  = activeUnitData;
     SharkyUnitData  = sharkyUnitData;
     DebugService    = debugService;
     BuildingService = buildingService;
 }
Exemplo n.º 5
0
 public void DoNothingForNow()
 {
     foreach (var item in TemporaryForms)
     {
         DebugService.WriteLine(item.Information);
     }
 }
 public InitializeHandler(
     ILoggerFactory factory,
     DebugService debugService)
 {
     _logger       = factory.CreateLogger <InitializeHandler>();
     _debugService = debugService;
 }
Exemplo n.º 7
0
        public SupportAttackTask(AttackData attackData, TargetingData targetingData, ActiveUnitData activeUnitData, MicroTaskData microTaskData,
                                 IMicroController microController,
                                 DebugService debugService, ChatService chatService, TargetingService targetingService, DefenseService defenseService, DistractionSquadService distractionSquadService, EnemyCleanupService enemyCleanupService,
                                 ArmySplitter armySplitter,
                                 List <UnitTypes> mainAttackerTypes,
                                 float priority, bool enabled = true)
        {
            AttackData     = attackData;
            TargetingData  = targetingData;
            ActiveUnitData = activeUnitData;
            MicroTaskData  = microTaskData;

            MicroController = microController;

            DebugService            = debugService;
            ChatService             = chatService;
            TargetingService        = targetingService;
            DefenseService          = defenseService;
            DistractionSquadService = distractionSquadService;
            EnemyCleanupService     = enemyCleanupService;

            ArmySplitter = armySplitter;

            MainAttackers  = mainAttackerTypes;
            Priority       = priority;
            Enabled        = enabled;
            UnitCommanders = new List <UnitCommander>();
        }
Exemplo n.º 8
0
        public static string Dump(string path)
        {
#if DEBUG
            DebugService.LogInfo("AvmDump started");
            int start = Environment.TickCount;
#endif

            var opts = new Options
            {
                Verbose = true
            };

            int    exitCode;
            string cout = Run(opts, out exitCode, path);

            string dir = Path.GetDirectoryName(path);
            File.WriteAllText(Path.Combine(dir, "avmdump.txt"), cout);

            //if (exitCode != 0)
            //{
            //    return string.Format("Unable to play ABC file {0}", path);
            //}

#if DEBUG
            int end = Environment.TickCount;
            DebugService.LogInfo("AvmDump succeeded. Ellapsed Time: {0}", (end - start) + "ms");
#endif

            return(cout);
        }
 public ContinueHandler(
     ILoggerFactory loggerFactory,
     DebugService debugService)
 {
     _logger       = loggerFactory.CreateLogger <ContinueHandler>();
     _debugService = debugService;
 }
 public PauseHandler(
     ILoggerFactory loggerFactory,
     DebugService debugService)
 {
     _logger       = loggerFactory.CreateLogger <PauseHandler>();
     _debugService = debugService;
 }
 public StackTraceHandler(
     ILoggerFactory loggerFactory,
     DebugService debugService)
 {
     _logger       = loggerFactory.CreateLogger <StackTraceHandler>();
     _debugService = debugService;
 }
Exemplo n.º 12
0
        public override void LoadState(BinaryReader reader, Version version)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            _trackLoaded  = reader.ReadBoolean();
            _trackChanged = reader.ReadBoolean();
            _trackNumber  = reader.ReadInt32();
            _trackOffset  = reader.ReadInt32();
            if (_trackLoaded)
            {
                reader.Read(_trackData, 0, _trackData.Length);
            }
            if (reader.ReadBoolean())
            {
                DebugService.WriteMessage("Loading machine '{0}'", typeof(Disk525).Name);
                _disk = Disk525.LoadState(reader, version);
            }
            else
            {
                _disk = null;
            }
        }
Exemplo n.º 13
0
        public ILMethod(MethodDefinition def, ILType type, ILRuntime.Runtime.Enviorment.AppDomain domain)
        {
            this.def      = def;
            declaringType = type;
            if (def.ReturnType.IsGenericParameter)
            {
                ReturnType = FindGenericArgument(def.ReturnType.Name);
            }
            else
            {
                ReturnType = domain.GetType(def.ReturnType, type, this);
            }
            if (type.IsDelegate && def.Name == "Invoke")
            {
                isDelegateInvoke = true;
            }
            this.appdomain = domain;
            paramCnt       = def.HasParameters ? def.Parameters.Count : 0;
#if DEBUG
            if (def.HasBody)
            {
                var sp = DebugService.FindSequencePoint(def.Body.Instructions[0]);
                if (sp != null)
                {
                    StartLine = sp.StartLine;
                    sp        = DebugService.FindSequencePoint(def.Body.Instructions[def.Body.Instructions.Count - 1]);
                    if (sp != null)
                    {
                        EndLine = sp.EndLine;
                    }
                }
            }
#endif
        }
Exemplo n.º 14
0
        static bool LoadAssembly(TestCase tc, TestDriverSettings tds, out IAssembly asm)
        {
            asm = tc.LoadAssembly();
            if (asm == null)
            {
                return(false);
            }

#if DEBUG
            DebugService.LogInfo("TestCase assembly was deserialized");
#endif

            if (tds.IsCancel)
            {
                return(false);
            }

            if (tds.ExportCSharpFile)
            {
                string cspath = Path.Combine(tc.Root, "src.cs");
                ExportTools.ToCSharp(asm, cspath);
            }

            if (tds.IsCancel)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 15
0
        public DebugServiceTests()
        {
            var logger = Logging.NullLogger;

            this.powerShellContext = PowerShellContextFactory.Create(logger);
            this.powerShellContext.SessionStateChanged += powerShellContext_SessionStateChanged;

            this.workspace = new Workspace(this.powerShellContext.LocalPowerShellVersion.Version, logger);

            // Load the test debug file
            this.debugScriptFile =
                this.workspace.GetFile(
                    @"..\..\..\..\PowerShellEditorServices.Test.Shared\Debugging\DebugTest.ps1");

            this.variableScriptFile =
                this.workspace.GetFile(
                    @"..\..\..\..\PowerShellEditorServices.Test.Shared\Debugging\VariableTest.ps1");

            this.debugService = new DebugService(this.powerShellContext, logger);
            this.debugService.DebuggerStopped   += debugService_DebuggerStopped;
            this.debugService.BreakpointUpdated += debugService_BreakpointUpdated;
            this.runnerContext = SynchronizationContext.Current;

            // Load the test debug file
            this.debugScriptFile =
                this.workspace.GetFile(
                    @"..\..\..\..\PowerShellEditorServices.Test.Shared\Debugging\DebugTest.ps1");
        }
Exemplo n.º 16
0
        //TODO: Add options to control level of reflection support

        public AbcMethod Define_Assembly_GetTypeNum(IMethod method, AbcInstance instance)
        {
            _emitReflection = true;
            var m = instance.DefineMethod(_generator.MethodBuilder.SigOf(method), null);

            _generator.AddLateMethod(
                m,
                code =>
            {
#if DEBUG
                DebugService.LogInfo("FinishInitTypes started");
#endif

                DefineInitTypeMethods();
                DefineGetTypeIdMethods();

                code.PushInt(_initTypes.Count);
                code.ReturnValue();

#if DEBUG
                DebugService.LogInfo("FinishInitTypes succeeded");
#endif
            }
                );
            return(m);
        }
Exemplo n.º 17
0
        private static Task <Page> CreatePage(Type viewModelType)
        {
            Type pageType = GetPageTypeForViewModel(viewModelType);

            if (pageType == null)
            {
                throw new Exception($"Cannot locate page type for {viewModelType}");
            }

            Page page = null;

            try
            {
                page = Activator.CreateInstance(pageType) as Page;
            }
            catch (Exception e)
            {
                DebugService.WriteLine($"Exception thrown at CreatePage {e}");
                DebugService.WriteLine($"{e.Message}");
            }
            if (page == null)
            {
                DebugService.WriteLine($"Page not created");
                return(null);
            }
            else
            {
                DebugService.WriteLine($"{page} successfully created");
                return(Task.FromResult(page));
            }
        }
Exemplo n.º 18
0
 public DebuggerActionHandlers(
     ILoggerFactory loggerFactory,
     DebugService debugService)
 {
     _logger       = loggerFactory.CreateLogger <ContinueHandlerBase>();
     _debugService = debugService;
 }
Exemplo n.º 19
0
        public UnitManager(ActiveUnitData activeUnitData, SharkyUnitData sharkyUnitData, SharkyOptions sharkyOptions, TargetPriorityService targetPriorityService, CollisionCalculator collisionCalculator, MapDataService mapDataService, DebugService debugService, DamageService damageService, UnitDataService unitDataService)
        {
            ActiveUnitData = activeUnitData;

            SharkyUnitData        = sharkyUnitData;
            SharkyOptions         = sharkyOptions;
            TargetPriorityService = targetPriorityService;
            CollisionCalculator   = collisionCalculator;
            MapDataService        = mapDataService;
            DebugService          = debugService;
            DamageService         = damageService;
            UnitDataService       = unitDataService;

            ActiveUnitData.EnemyUnits   = new ConcurrentDictionary <ulong, UnitCalculation>();
            ActiveUnitData.SelfUnits    = new ConcurrentDictionary <ulong, UnitCalculation>();
            ActiveUnitData.NeutralUnits = new ConcurrentDictionary <ulong, UnitCalculation>();

            ActiveUnitData.Commanders = new ConcurrentDictionary <ulong, UnitCommander>();

            ActiveUnitData.DeadUnits = new List <ulong>();

            TargetPriorityCalculationFrame = 0;

            UndeadTypes = new List <UnitTypes> {
                UnitTypes.ZERG_BROODLING, UnitTypes.ZERG_EGG, UnitTypes.ZERG_LARVA, UnitTypes.TERRAN_KD8CHARGE, UnitTypes.ZERG_OVERLORD, UnitTypes.ZERG_OVERLORDCOCOON, UnitTypes.ZERG_OVERLORDTRANSPORT, UnitTypes.ZERG_TRANSPORTOVERLORDCOCOON
            };
        }
Exemplo n.º 20
0
        private static HttpRequestMessage HttpRequestMessageGenerator(HttpMethod httpMethod, string requestUri, object requestBody = null)
        {
            #region ObjectValidator

            if (httpMethod == HttpMethod.Post && requestBody == null)
            {
                DebugService.WriteLine("[BaseRestService] WARNING : No valid request body");
            }

            #endregion

            var content = new StringContent(JsonConvert.SerializeObject(requestBody), Encoding.UTF8, "application/json");
            HttpRequestMessage httpRequest;
            if (httpMethod == HttpMethod.Get)
            {
                httpRequest = new HttpRequestMessage(httpMethod, requestUri);
            }
            else
            {
                httpRequest = new HttpRequestMessage(httpMethod, requestUri)
                {
                    Content = content
                };
            }
            return(httpRequest);
        }
Exemplo n.º 21
0
 public void InsertDisk(string name, Stream stream, bool isWriteProtected)
 {
     DebugService.WriteMessage("Inserting disk '{0}'", name);
     FlushTrack();
     _disk        = Disk525.CreateDisk(name, stream, isWriteProtected);
     _trackLoaded = false;
 }
 public SetVariableHandler(
     ILoggerFactory loggerFactory,
     DebugService debugService)
 {
     _logger       = loggerFactory.CreateLogger <SetVariableHandler>();
     _debugService = debugService;
 }
Exemplo n.º 23
0
        /// <summary>
        /// Sends a GET request to the server
        /// </summary>
        /// <typeparam name="T">Type of request object</typeparam>
        /// <param name="identifier">Identifier for the server to lookup</param>
        /// <param name="optionalClient">Optional client for other client request</param>
        /// <returns>Requested Object</returns>
        public static async Task <Tuple <string, T> > RequestGetAsync <T>(string identifier = null, HttpClient optionalClient = null) where T : new()
        {
            var client     = optionalClient ?? Client;
            var requestUri = UriGenerator <T>(HttpMethod.Get, identifier);

            var    httpRequest  = HttpRequestMessageGenerator(HttpMethod.Get, requestUri);
            string errorMessage = null;

            try
            {
                var requestTask  = client.SendAsync(httpRequest);
                var httpResponse = requestTask.GetAwaiter().GetResult();

                if (httpResponse.IsSuccessStatusCode)
                {
                    var result = JsonConvert.DeserializeObject <T>(await httpResponse.Content.ReadAsStringAsync());
                    DebugService.WriteLine($"Get request JSON result: {JsonConvert.SerializeObject(result)}");

                    return(Tuple.Create("OK", result));
                }
            }
            catch (Exception e)
            {
                DebugService.WriteLine(e);
                errorMessage = e.Message;
                DebugService.WriteLine($"Exception thrown in RequestGetAsync, Message: {errorMessage}");
            }
            return(Tuple.Create($"{errorMessage}", new T()));
        }
Exemplo n.º 24
0
        public void Play(string name, bool isCrossfade = false)
        {
            if (config == null)
            {
                return;
            }
            if (_curAnimName == name)
            {
                return;
            }
            var idx = _animNames.IndexOf(name);

            if (idx == -1)
            {
                UnityEngine.Debug.LogError("miss animation " + name);
                return;
            }

            DebugService.Trace($"{baseEntity.EntityId} PlayAnim {name} rawName {_curAnimName}");
            var hasChangedAnim = _curAnimName != name;

            _curAnimName = name;
            _curAnimIdx  = idx;
            UpdateBindInfo();
            if (hasChangedAnim)
            {
                //owner.TakeDamage(0, owner.transform2D.Pos3);
                ResetAnim();
            }

            view?.Play(_curAnimName, isCrossfade);
        }
        public DebugServiceTests()
        {
            var logger = NullLogger.Instance;

            this.powerShellContext = PowerShellContextFactory.Create(logger);
            this.powerShellContext.SessionStateChanged += powerShellContext_SessionStateChanged;

            this.workspace = new WorkspaceService(NullLoggerFactory.Instance);

            // Load the test debug files
            this.debugScriptFile    = GetDebugScript("DebugTest.ps1");
            this.variableScriptFile = GetDebugScript("VariableTest.ps1");

            this.debugService = new DebugService(
                this.powerShellContext,
                null,
                new BreakpointService(
                    NullLoggerFactory.Instance,
                    powerShellContext,
                    new DebugStateService()),
                NullLoggerFactory.Instance);

            this.debugService.DebuggerStopped   += debugService_DebuggerStopped;
            this.debugService.BreakpointUpdated += debugService_BreakpointUpdated;
        }
Exemplo n.º 26
0
        static bool Compile(TestCase tc)
        {
            if (tc.CompileAVM)
            {
                tc.VM = VM.AVM;
                if (!Compiler.Compile(tc))
                {
                    return(false);
                }
            }

            if (tc.CompileCLR)
            {
                tc.VM = VM.CLR;
                if (!Compiler.Compile(tc))
                {
                    return(false);
                }
            }
#if DEBUG
            DebugService.LogInfo("TestCase '{0}' has been compiled", tc.FullName);
#endif

            return(true);
        }
Exemplo n.º 27
0
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var nativeWindowManager = new NativeWindowManager();
            var screenManager       = new ScreenManager();
            var audioManager        = new AudioManager();
            var versionRepository   = new VersionRepository();
            var settingService      = new SettingService();
            var debugService        = new DebugService();

            settingService.Init();

            var isDebugMode = System.Environment.GetCommandLineArgs().Count(v => v == "--debug") == 1;

            if (isDebugMode)
            {
                debugService.AllocConsole();
            }

            var _ = new Views.UmaMadoManagerUI(
                new Core.ViewModels.AxisStandardViewModel(
                    nativeWindowManager,
                    screenManager,
                    audioManager,
                    versionRepository,
                    settingService));

            Application.Run();
        }
Exemplo n.º 28
0
        public static void RunTestCase(TestCase test, TestDriverSettings settings)
        {
            if (settings == null)
            {
                settings = new TestDriverSettings();
            }

#if DEBUG
            DebugService.LogInfo("TestCase {0} started", test.Name);
#endif

            test.Reset();

            // TODO: provide option to clear caches
            CommonLanguageInfrastructure.ClearCaches();

            try
            {
                RunCore(test, settings);
            }
            finally
            {
                CommonLanguageInfrastructure.ClearCaches();
            }
        }
Exemplo n.º 29
0
 public MiningDefenseService(BaseData baseData, ActiveUnitData activeUnitData, IIndividualMicroController workerMicroController, DebugService debugService)
 {
     BaseData              = baseData;
     ActiveUnitData        = activeUnitData;
     WorkerMicroController = workerMicroController;
     DebugService          = debugService;
 }
Exemplo n.º 30
0
        protected virtual void OnDebugServiceUpdateSync(object sender, SledDebugServiceBreakpointEventArgs e)
        {
            if (Collection.Count <= 0)
            {
                return;
            }

            // See if any variables need to be looked up
            foreach (var state in Collection[0].ExpandedStates)
            {
                foreach (var node in state.GetFlattenedHierarchy())
                {
                    if (node.LookUp == null)
                    {
                        continue;
                    }

                    // Already looking up this item
                    if (ListNameInsert.Contains(node.Variable.Name))
                    {
                        continue;
                    }

                    // Keep track of items getting looked up
                    ListNameInsert.Add(node.Variable.Name);
                    ListNameInsertDict.Add(node.Variable.Name, new Pair <string, IList <SledLuaVarNameTypePairType> >(node.Variable.DisplayName, node.Variable.TargetHierarchy));

                    //SledOutDevice.OutLine(SledMessageType.Error, "[Variable Lookup] {0}", node.LookUp);

                    DebugService.SendScmp(new Scmp.LuaVarLookUp(LuaLanguagePlugin.LanguageId, node.LookUp));
                }
            }
        }
        /// <summary>
        /// SCORM Engine Service constructor that takes a single configuration parameter
        /// </summary>
        /// <param name="config">The Configuration object to be used to configure the Scorm Engine Service client</param>
        public ScormEngineService(Configuration config)
        {
            System.Net.ServicePointManager.Expect100Continue = false;

            configuration = config;
            courseService = new CourseService(configuration, this);
            dispatchService = new DispatchService(configuration, this);
            registrationService = new RegistrationService(configuration, this);
            invitationService = new InvitationService(configuration, this);
            uploadService = new UploadService(configuration, this);
            ftpService = new FtpService(configuration, this);
            exportService = new ExportService(configuration, this);
            reportingService = new ReportingService(configuration, this);
            debugService = new DebugService(configuration, this);
        }
        public DebugServiceTests()
        {
            this.workspace = new Workspace();

            // Load the test debug file
            this.debugScriptFile =
                this.workspace.GetFile(
                    @"..\..\..\PowerShellEditorServices.Test.Shared\Debugging\DebugTest.ps1");

            this.powerShellContext = new PowerShellContext();
            this.powerShellContext.SessionStateChanged += powerShellContext_SessionStateChanged;

            this.debugService = new DebugService(this.powerShellContext);
            this.debugService.DebuggerStopped += debugService_DebuggerStopped;
            this.debugService.BreakpointUpdated += debugService_BreakpointUpdated;
        }