Esempio n. 1
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            for (var i = memory.Length - NativeIntegerSize; i >= 0; i -= (int)NativeIntegerSize)
            {
                ulong value = MainForm.ToLong(memory, (uint)i, NativeIntegerSize);

                var at     = address + (ulong)i;
                var offset = StackFrame - at;

                var entry = new StackEntry()
                {
                    Address  = BasePlatform.ToHex(at, NativeIntegerSize),
                    HexValue = BasePlatform.ToHex(value, NativeIntegerSize),
                    Value    = value,
                    Offset   = Platform.StackFrame.Name.ToUpperInvariant() +
                               (offset >= 0
                                                ? "-" + BasePlatform.ToHex(offset, 1)
                                                : "+" + BasePlatform.ToHex(-(long)offset, 1)),
                    Index = stackentries.Count,
                    Info  = MainForm.GetAddressInfo(value)
                };

                stackentries.Add(entry);
            }
        }
    public BasePlatform Get()
    {
        int          random         = Random.Range(0, 101);
        BasePlatform platformPrefab = platformContainers[0].PlatformPrefab;

        foreach (PlatformContainer platformContainer in platformContainers)
        {
            random -= platformContainer.SpawnChance;
            if (random <= 0)
            {
                platformPrefab = platformContainer.PlatformPrefab;
                break;
            }
        }
        BasePlatform platform = availiablePlatforms.Find(availiablePlatform => availiablePlatform.GetType() == platformPrefab.GetType());

        if (platform == null)
        {
            platform = CreatePlatform(platformPrefab);
        }
        else
        {
            availiablePlatforms.Remove(platform);
        }
        inUsePlatforms.Add(platform);
        platform.gameObject.SetActive(true);
        return(platform);
    }
Esempio n. 3
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            uint size = NativeIntegerSize;

            for (int i = memory.Length - NativeIntegerSize; i >= 0; i -= (int)size)
            {
                // FIXME: for 64 bit
                ulong value = (ulong)(memory[i] | (memory[i + 1] << 8) | (memory[i + 2] << 16) | (memory[i + 3] << 24));

                var at = address + (ulong)i;

                var offset = (long)(Platform.StackFrame.Value - at);

                var entry = new StackEntry()
                {
                    Address  = BasePlatform.ToHex(at, size),
                    HexValue = BasePlatform.ToHex(value, size),
                    Value    = value,
                    Offset   = Platform.StackFrame.Name.ToUpper() +
                               (offset >= 0
                                                ? "-" + BasePlatform.ToHex((ulong)offset, 1)
                                                : "+" + BasePlatform.ToHex((ulong)-offset, 1)),
                    Index = stackentries.Count,
                };

                stackentries.Add(entry);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Returns true if the specified platform supports JIT compilation; otherwise, false.
        /// </summary>
        public static bool HasJit(this BasePlatform basePlatform) =>
        basePlatform != BasePlatform.Ios
#if !UNITY_5_5_OR_NEWER
        && basePlatform != BasePlatform.Ps3 &&
        basePlatform != BasePlatform.Xbox360
#endif
        ;
        public bool LandOnPlatform(int offset, BasePlatform platform)
        {
            if (!(Velocity.Y > 0))
            {
                return(false);
            }

            var movingObject = this as IDamageable;

            if (Velocity.Y > 25 && Velocity.Y <= 30)
            {
                movingObject?.TakeDamage(1);
            }
            if (Velocity.Y > 30 && Velocity.Y <= 40)
            {
                movingObject?.TakeDamage(2);
            }
            if (Velocity.Y > 40 && Velocity.Y <= 55)
            {
                movingObject?.TakeDamage(3);
            }

            DrawPos.Y = platform.GetPosition().Y - (Texture != null ? Texture.Height : 0) + offset;

            DrawPos.Y = platform.GetPosition().Y - (Texture != null ? Source.Height : 0) + offset;

            Airborn = false;
            ResetDoubleJump();
            Direction.Y = 0;
            Velocity.Y  = 0;

            return(true);
        }
Esempio n. 6
0
 /// <summary>
 /// Returns true if the specified platform supports JIT compilation; otherwise, false.
 /// </summary>
 public static bool HasJit(this BasePlatform basePlatform)
 {
     return(
         basePlatform != BasePlatform.Ios &&
         basePlatform != BasePlatform.Ps3 &&
         basePlatform != BasePlatform.Xbox360);
 }
    private BasePlatform CreatePlatform(BasePlatform platformPrefab)
    {
        BasePlatform platform = Object.Instantiate(platformPrefab);

        platform.Setup(Return, _greenPlatformMultiplier, _redPlatformMultiplier, _blackPlatformChangeTime);
        platform.gameObject.SetActive(false);
        return(platform);
    }
 private void OnEnable()
 {
     if (currentPlatform == null)
     {
         currentPlatform  = GetPlatform();
         hasAuthorization = currentPlatform.HasAuthorization();
     }
 }
Esempio n. 9
0
        public string vcproj_name; /* Project file, NULL for standard */

        #endregion Fields

        #region Constructors

        public Library()
        {
            has_platform_ext = false;
            is_executable = false;
            release_mode = ReleaseMode.ReleaseMode_Release;
            build_mode = BuildMode.BuildMode_Simple;
            platform = BasePlatform.Platform_Linux | BasePlatform.Platform_Windows;
        }
        public void InitialiseIsland(ScoreSystem scoreSystem)
        {
            BasePlatform platform = this.GetComponentInChildren <BasePlatform>();

            platform.InitialisePlatform(this);

            // Gets the score system without the singleton, to limit the chaining on
            this.scoreSystem = scoreSystem;
        }
Esempio n. 11
0
        /// <summary>
        /// Initialises island's inhabitants and transport system on Awake.
        /// </summary>
        public void InitialiseIsland(ScoreSystem scoreSystem)
        {
            // THIS MAY LATER NEED TO BE SEPERATELY CALLED FROM THE PLATFORM
            // As these are both seperate entities from eachother.

            BasePlatform platform = this.GetComponentInChildren <BasePlatform>();

            platform.InitialisePlatform(this);

            // Gets the score system without the singleton, to limit the chaining on
            this.scoreSystem = scoreSystem;
        }
        private static void InitializeOnLoad()
        {
            if (CheckAuthorizationOnPlay && Application.isPlaying)
            {
                currentPlatform  = GetPlatform();
                hasAuthorization = currentPlatform.HasAuthorization();

                if (!hasAuthorization)
                {
                    OpenUtils();
                }
            }
        }
 public EvaluatedSolution(
     BasePlatform platform,
     BaseToolchain toolchain,
     Solution solution,
     Profile profile,
     ResolvedSolution[] resolvedSolutions)
 {
     this.Platform          = platform;
     this.Toolchain         = toolchain;
     this.Solution          = solution;
     this.Profile           = profile;
     this.ResolvedSolutions = resolvedSolutions;
 }
Esempio n. 14
0
    void Spawn()
    {
        if (_platformPool == null)
        {
            throw new Exception("Tried to spawn a platform before initializing the pool.");
        }

        _currentPlatform = _platformPool.Get();
        _lastPosition    = new Vector3(
            Camera.main.transform.position.x + _cameraHorizontalHalfSize + _currentPlatform.transform.localScale.x / 2,
            Random.Range(_minVerticalDistance, _maxHorizontalDistance),
            _currentPlatform.transform.position.z);
        _currentPlatform.transform.position = _lastPosition;
    }
Esempio n. 15
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            string path     = HostingEnvironment.MapPath($"/{WebConfigurationManager.AppSettings["configurationPath"]}");
            var    platform = new BasePlatform(new FilePlatformConfiguration(path));

            platform.Startup();
            var httpControllerActivator = new PlatformHttpControllerActivator(platform);

            GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator), httpControllerActivator);
        }
Esempio n. 16
0
        private void UpdateDisplay(ulong address, byte[] bytes)
        {
            foreach (var watch in Watches)
            {
                if (watch.Watch.Address != address || watch.Size != bytes.Length)
                {
                    continue;
                }

                watch.Value    = ToLong(bytes);
                watch.HexValue = BasePlatform.ToHex(watch.Value, watch.Size);
            }

            Refresh();
        }
Esempio n. 17
0
        public static async Task <bool> Initialize()
        {
            Config = await Config.LoadConfig();

            Pattern  = new Regex(Config.Format, RegexOptions.IgnoreCase | RegexOptions.Compiled);
            platform = BasePlatform.CreatePlatform(Config);
            if (Config.Standalone && Config.UserId > 0)
            {
                Connect();
            }
#if DEBUG
            IsRunning = true;
#endif
            return(platform == null);
        }
Esempio n. 18
0
        public GameScreen(GraphicsDevice graphics, ContentManager content)
            : base(graphics, content)
        {
            rectangles = new List <Rectangle>();
            rectangles.Add(new Rectangle(8, 11, 118, 133));
            rectangles.Add(new Rectangle(139, 11, 117, 133));
            rectangles.Add(new Rectangle(268, 11, 116, 133));
            rectangles.Add(new Rectangle(403, 12, 111, 133));
            rectangles.Add(new Rectangle(539, 13, 103, 133));
            rectangles.Add(new Rectangle(673, 13, 101, 133));
            rectangles.Add(new Rectangle(805, 12, 99, 133));
            rectangles.Add(new Rectangle(24, 162, 98, 133));
            rectangles.Add(new Rectangle(157, 162, 95, 133));
            rectangles.Add(new Rectangle(288, 160, 93, 133));
            rectangles.Add(new Rectangle(418, 159, 95, 133));
            rectangles.Add(new Rectangle(546, 159, 97, 133));
            rectangles.Add(new Rectangle(674, 159, 101, 133));
            rectangles.Add(new Rectangle(800, 159, 104, 133));
            rectangles.Add(new Rectangle(10, 310, 114, 133));
            rectangles.Add(new Rectangle(138, 310, 117, 133));
            rectangles.Add(new Rectangle(275, 310, 108, 133));
            rectangles.Add(new Rectangle(412, 312, 101, 133));
            rectangles.Add(new Rectangle(542, 312, 101, 133));
            rectangles.Add(new Rectangle(671, 312, 102, 133));
            rectangles.Add(new Rectangle(808, 312, 96, 133));
            rectangles.Add(new Rectangle(29, 465, 93, 133));
            rectangles.Add(new Rectangle(156, 463, 98, 133));
            rectangles.Add(new Rectangle(280, 461, 102, 133));
            rectangles.Add(new Rectangle(409, 462, 106, 133));
            rectangles.Add(new Rectangle(537, 462, 108, 133));
            rectangles.Add(new Rectangle(663, 462, 109, 133));

            Texture2D spriteTexture = Content.Load <Texture2D>("Runner");

            sprite                   = new MovingGuy(spriteTexture, new Vector2(0, 0), Color.White, new Vector2(.5f), rectangles, Game1.pixel);
            sprite.Position          = new Vector2(0, Graphics.Viewport.Height - sprite.Origin.Y / 2);
            sprite.IsHitBoxDisplayed = true;

            basePlatform = new BasePlatform(Content.Load <Texture2D>("Flatplatform"), new Vector2(Graphics.Viewport.Width / 2, Graphics.Viewport.Height / 2), Color.White, new Vector2(.5f), Game1.pixel);
            basePlatform.IsHitBoxDisplayed = true;

            textLabel = new TextLabel(new Vector2(100, 100), Color.White, "Welcome you shall die", Content.Load <SpriteFont>("SpriteFont"));

            Sprites.Add(textLabel);
            Sprites.Add(sprite);
            Sprites.Add(basePlatform);
        }
Esempio n. 19
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            var parameters = DebugSource.GetMethodParameters(method);

            if (parameters == null || parameters.Count == 0)
            {
                return;
            }

            long offset = (long)(address - StackFrame);

            foreach (var parameter in parameters)
            {
                var type = DebugSource.GetTypeInfo(parameter.ParameterTypeID);

                uint size = (parameter.Size == NativeIntegerSize || parameter.Size == NativeIntegerSize * 2) ? parameter.Size : 0;

                if (size == 0 && parameter.Size <= NativeIntegerSize)
                {
                    size = NativeIntegerSize;
                }

                ulong value = (size != 0) ? MainForm.ToLong(memory, parameter.Offset, size) : 0;

                var entry = new StackEntry()
                {
                    Index  = (int)parameter.Index,
                    Name   = parameter.Name,
                    Offset = Platform.StackFrame.Name.ToUpperInvariant() +
                             (offset >= 0
                                                ? "+" + BasePlatform.ToHex(offset + parameter.Offset, 1)
                                                : "-" + BasePlatform.ToHex(-offset + parameter.Offset, 1)),
                    Address  = BasePlatform.ToHex(StackFrame + parameter.Offset, size),
                    Size     = size,
                    Value    = value,
                    HexValue = BasePlatform.ToHex(value, size),
                    Type     = type.FullName,
                    Info     = MainForm.GetAddressInfo(value)
                };

                stackentries.Add(entry);
            }
        }
Esempio n. 20
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            uint size = 4;             // fixme

            for (int i = memory.Length - 4; i > 0; i = i - (int)size)
            {
                ulong value = (ulong)(memory[i] | (memory[i + 1] << 8) | (memory[i + 2] << 16) | (memory[i + 3] << 24));

                var at = address + (ulong)i;

                var entry = new StackEntry()
                {
                    Address  = BasePlatform.ToHex(at, size),
                    HexValue = BasePlatform.ToHex(value, size),
                    Value    = value,
                    Offset   = Platform.StackFrame.Name.ToUpper() + "-" + (Platform.StackFrame.Value - at).ToString().PadLeft(2, '0'),
                    Index    = stackentries.Count,
                };

                stackentries.Add(entry);
            }
        }
Esempio n. 21
0
        public bool LandOnIcePlatform(BasePlatform platform)
        {
            if (!(Velocity.Y > 0))
            {
                return(false);
            }

            LandOnPlatform(1, platform);
            Gliding = true;

            switch (LastFacing)
            {
            case Facing.Right:
                Direction.X += 1;
                Velocity.X  += 1;
                break;

            case Facing.Left:
                Direction.X -= 1;
                Velocity.X  -= 1;
                break;
            }
            return(true);
        }
Esempio n. 22
0
 public string ToHex()
 {
     return(BasePlatform.ToHex(Value, Size));
 }
Esempio n. 23
0
 /// <summary>
 /// Returns true if the specified platform does not support JIT compilation; otherwise, false.
 /// </summary>
 public static bool NoJit(this BasePlatform basePlatform)
 {
     return(!HasJit(basePlatform));
 }
 private void Return(BasePlatform platform)
 {
     platform.gameObject.SetActive(false);
     inUsePlatforms.Remove(platform);
     availiablePlatforms.Add(platform);
 }