public CombatantOffsets(GameRegion region)
        {
            this.Name              = 48;
            this.ID                = 116;
            this.OwnerID           = 132;
            this.Type              = 140;
            this.EffectiveDistance = 146;
            this.PosX              = 160;
            this.PosZ              = this.PosX + 4;
            this.PosY              = this.PosZ + 4;
            this.Heading           = this.PosY + 8;
            this.FateID            = 232;
            this.EventType         = 400;
            this.CairnIsUnlocked   = 418;
            this.TargetID          = 472;
            this.TargetID2         = 2448;
            int offset = (region == GameRegion.Global) ? 6288 : 6300;

            this.StatusEffectsStart = offset + ((region == GameRegion.Global) ? 200 : 204);
            this.BNpcNameID         = offset - ((region == GameRegion.Global) ? 40 : 32);
            this.CurrentHP          = offset + 8;
            this.MaxHP     = offset + 12;
            this.CurrentMP = offset + 16;
            this.CurrentGP = offset + 26;
            this.MaxGP     = offset + 28;
            this.CurrentCP = offset + 30;
            this.MaxCP     = offset + 32;
            if (region == GameRegion.Global)
            {
                offset += 6;
            }
            this.Job   = offset + 64;
            this.Level = offset + 66;
        }
Пример #2
0
        private void SymbolButton_Click(object sender, RoutedEventArgs e)
        {
            // We do not have a JP keyboard
            _region = GameRegion.US;

            Control ctl = sender as Control;

            if (ctl != null)
            {
                string num = Regex.Replace(ctl.Name, @"\D", "");
                byte   id  = byte.Parse(num);

                if (currentPic >= _secretLength)
                {
                    data[_secretLength - 1] = id;
                    uxSecretDisplay.SetSecret(data, _region);
                }
                else
                {
                    data[currentPic] = id;
                    currentPic++;
                    uxSecretDisplay.SetSecret(data.Take(currentPic).ToArray(), _region);
                }

                txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region);
            }
        }
Пример #3
0
 /// <summary>
 /// Loads all the game data from the specified file
 /// </summary>
 /// <returns>All of the game information in the save file</returns>
 /// <param name="filename">The input file path.</param>
 /// <param name="region">The region of the game</param>
 public static IEnumerable <GameInfo> LoadAll(string filename, GameRegion region)
 {
     using (FileStream inFile = File.OpenRead(filename))
     {
         return(LoadAll(inFile, region));
     }
 }
Пример #4
0
        public DecoderForm(SecretType mode, GameRegion region)
        {
            this.Build();
            switch (mode)
            {
            case SecretType.Game:
                _secretLength = 20;
                break;

            case SecretType.Ring:
                _secretLength = 15;
                break;

            case SecretType.Memory:
                _secretLength = 5;
                break;
            }
            _region = region;
            data    = new byte[_secretLength];
            Mode    = mode;
            chkAppendRings.Visible = Mode == SecretType.Ring;

            if (region == GameRegion.US)
            {
                notebook1.RemovePage(1);
            }
            else if (region == GameRegion.JP)
            {
                notebook1.RemovePage(0);
                label7.Text = "Secrets can be entered in kana, romaji, or both";
                label8.Text = "んすなこゆ\nn su na ko yu\nN すな KoYu";
            }
        }
Пример #5
0
        public Ecco2Tool(CustomMainForm f, GameRegion r) : base(f, r)
        {
            _top  = _bottom = 112;
            _left = _right = 160;
            ClientApi.SetGameExtraPadding(_left, _top, _right, _bottom);
            switch (r)
            {
            case GameRegion.J:
                _3DTypeProvider = new J3DProvider();
                _2DTypeProvider = new J2DProvider();
                break;

            case GameRegion.U:
                _3DTypeProvider = new U3DProvider();
                _2DTypeProvider = new U2DProvider();
                break;

            case GameRegion.E:
                _3DTypeProvider = new E3DProvider();
                _2DTypeProvider = new E2DProvider();
                break;

            default:
                break;
            }
        }
Пример #6
0
        /// <summary>
        /// Loads all the game data from the specified stream
        /// </summary>
        /// <returns>All of the game information in the save file</returns>
        /// <param name="stream">The input stream.</param>
        /// <param name="region">The region of the game</param>
        public static IEnumerable <GameInfo> LoadAll(Stream stream, GameRegion region)
        {
            GameInfo tmp;

            // These offsets seem to be static for both versions, but I can't be certain.

            // Slot 1
            tmp = Load(stream, region, Slot1Offset);
            var gameData = new List <GameInfo>();

            if (!(tmp is null))
            {
                gameData.Add(tmp);
            }

            // Slot 2
            tmp = Load(stream, region, Slot2Offset);
            if (!(tmp is null))
            {
                gameData.Add(tmp);
            }

            // Slot 3
            tmp = Load(stream, region, Slot3Offset);
            if (!(tmp is null))
            {
                gameData.Add(tmp);
            }

            return(gameData);
        }
Пример #7
0
 /// <summary>
 /// Loads a game info from the file at the specified offset
 /// </summary>
 /// <param name="filename">File.</param>
 /// <param name="region">The region of the game</param>
 /// <param name="offset">Offset.</param>
 /// <returns>The game information at the specified offset</returns>
 /// <remarks>This method has only been tested with the US version of the games</remarks>
 public static GameInfo Load(string filename, GameRegion region, int offset)
 {
     using (FileStream inFile = File.OpenRead(filename))
     {
         return(Load(inFile, region, offset));
     }
 }
Пример #8
0
        public void WhenSelectGameRegionCommandExecuted_SelectedRegionPropertyChanged()
        {
            //Prepare
            Mock <IRegionManager> mockedRegionManager = new Mock <IRegionManager>();

            MockLoginStatusChangedEvent mockedLoginStatusChangedEvent = new MockLoginStatusChangedEvent();
            Mock <IEventAggregator>     mockedEventAggregator         = new Mock <IEventAggregator>();

            mockedEventAggregator.Setup(x => x.GetEvent <LoginStatusChangedEvent>()).Returns(mockedLoginStatusChangedEvent);

            Mock <IUserService> mockedUserService = new Mock <IUserService>();

            mockedUserService.Setup(x => x.Login(It.Is <string>(user => user == "user"),
                                                 It.Is <SecureString>(pass => pass.Length == 2))).Returns(new UserQueryResult()).Verifiable();

            AuthenticateViewModel target = new AuthenticateViewModel(mockedRegionManager.Object,
                                                                     mockedEventAggregator.Object, mockedUserService.Object);

            GameRegion gameRegion = new GameRegion();

            //Act
            target.SelectGameRegionCommand.Execute(gameRegion);

            //Verify
            Assert.AreEqual(gameRegion, target.SelectedRegion);
        }
Пример #9
0
 public GameMemoryAttribute(string name, GameRegion region, int targetpos = 0, int s7 = 0)
 {
     Name        = name;
     Region      = region;
     TargetPos   = targetpos;
     SymbolTable = s7 - GameMemory.SymbolTableOffset;
 }
Пример #10
0
        public static byte[] WriteSramToSavestate(this Stream source, GameRegion region, byte[] sram)
        {
            var unchangedSavestate = SavestateReader.Load(source, true);
            var changedSavestate   = SavestateWramHelper.CopySramToSavestate(unchangedSavestate, region, sram);

            return(SavestateWriter.Save(source, changedSavestate));
        }
Пример #11
0
        private IEnumerator CreateRegions()
        {
            var index        = 0;
            var regionObject = Resources.Load <GameObject>(RegionObject);
            var regions      = scene.MatrixRegion.GetAllRegions();

            foreach (var region in regions)
            {
                var gameRegion       = new GameRegion(index, region);
                var regionGameObject = Instantiate(
                    regionObject,
                    gameRegion.Position,
                    Quaternion.identity,
                    transform);
                regionGameObject.transform.localScale = gameRegion.Size - size;
                regionGameObject.name =
                    $"Index: {index} (X: {gameRegion.Size.x} Y: {gameRegion.Size.y})";

                var gameRegionVisualGraphics =
                    regionGameObject.GetComponent <GameRegionVisualGraphics>();
                if (gameRegionVisualGraphics != null)
                {
                    gameRegionVisualGraphics.SetRegion(region);
                }

                index++;
                yield return(null);
            }
        }
Пример #12
0
        public void SetSecret(byte[] secret, GameRegion region)
        {
            Reset();
            for (int i = 0; i < secret.Length && i < pics.Length; i++)
            {
                if (secret[i] > 63)
                {
                    pics[i].Pixbuf = null;
                }
                else
                {
                    string folder;
                    if (region == GameRegion.JP)
                    {
                        folder = "Symbols_JP";
                    }
                    else
                    {
                        folder = "Symbols";
                    }

                    string imgUri = string.Format("Zyrenth.ZoraGen.GtkUI.Images." + folder + ".{0:00}.png", secret[i]);
                    pics[i].Pixbuf = Gdk.Pixbuf.LoadFromResource(imgUri);
                }
            }
            //SetImageVisibility();
        }
Пример #13
0
    private void RecordTrackRegion()
    {
        switch (selectIndex)
        {
        case 0:
            trackRegion = GameRegion.England;
            break;

        case 1:
            trackRegion = GameRegion.France;
            break;

        case 2:
            trackRegion = GameRegion.Japan;
            break;

        case 3:
            trackRegion = GameRegion.England;
            break;

        default:
            trackRegion = GameRegion.England;
            break;
        }
    }
Пример #14
0
 public void SetSecret(byte[] secret, GameRegion region)
 {
     Reset();
     sym01.SetSecret(secret.Take(5).ToArray(), region);
     sym02.SetSecret(secret.Skip(5).Take(5).ToArray(), region);
     sym03.SetSecret(secret.Skip(10).Take(5).ToArray(), region);
     sym04.SetSecret(secret.Skip(15).Take(5).ToArray(), region);
 }
Пример #15
0
        public ActionResult DeleteConfirmed(int id)
        {
            GameRegion gameRegion = db.GameRegions.Find(id);

            db.GameRegions.Remove(gameRegion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #16
0
        private static void RemoveGameRegion_Command(CommandEventArgs e)
        {
            GameRegion region = Region.Find(e.Mobile.Location, e.Mobile.Map) as GameRegion;

            if (region != null)
            {
                region.Unregister();
            }
        }
Пример #17
0
        private void SelectGameRegion(object param)
        {
            GameRegion region = param as GameRegion;

            if (region != null)
            {
                SelectedRegion = region;
            }
        }
Пример #18
0
        public void MergeAllData(DefaultDataCollection defaultDataCollection, GameDataCollection gameDataCollection)
        {
            // Merge data from default do game

            // Add all buildings do Game Collection
            gameDataCollection.AllBuildings = defaultDataCollection.Buildings;
            gameDataCollection.Countrys     = new StaticDictionary <GameCountry>();

            foreach (var country in defaultDataCollection.Countries.Values)
            {
                gameDataCollection.Countrys.Add(country.TagName, new GameCountry(country));
            }

            foreach (var country in gameDataCollection.Countrys.Values)
            {
                country.Regions = new StaticDictionary <GameRegion>();
                foreach (var region in defaultDataCollection.Regions.Values.Where(x => x.CountryTag == country.TagName))
                {
                    var gameRegion = new GameRegion(region);

                    gameRegion.City = new GameCity(defaultDataCollection.Citys[region.CityTag]);
                    MergeBuildings(defaultDataCollection, gameRegion.City, RequiredEnum.City);

                    gameRegion.Farm = new GameFarm(defaultDataCollection.Farms[region.FarmTag]);
                    MergeBuildings(defaultDataCollection, gameRegion.Farm, RequiredEnum.Farm);

                    gameRegion.Port = new GamePort(defaultDataCollection.Ports[region.PortTag]);
                    MergeBuildings(defaultDataCollection, gameRegion.Port, RequiredEnum.Port);

                    gameRegion.Industry = new GameIndustry(defaultDataCollection.Industries[region.IndustryTag]);
                    MergeBuildings(defaultDataCollection, gameRegion.Industry, RequiredEnum.Industry);

                    gameRegion.Infrastructure = new GameInfrastructure(defaultDataCollection.Infrastructures[region.InfrastructureTag]);
                    MergeBuildings(defaultDataCollection, gameRegion.Infrastructure, RequiredEnum.Infrastructure);

                    country.Regions.Add(gameRegion.TagName, gameRegion);
                }

                foreach (var provinceTag in defaultDataCollection.Regions.Values.Select(x => x.ProvinceTag).Distinct())
                {
                    foreach (var province in defaultDataCollection.Provinces.Values.Where(x => x.TagName == provinceTag))
                    {
                        country.Provinces.Add(province.TagName, new GameProvince(province));
                    }
                }
            }


            gameDataCollection.AllBuildings = defaultDataCollection.Buildings;


            //MergeRegionData(defaultDataCollection);

            //MergeBuildings(defaultDataCollection.Infrastructures, defaultDataCollection.Buildings);
            //MergeBuildings(defaultDataCollection.Farms, defaultDataCollection.Buildings);
        }
Пример #19
0
 public ActionResult Edit([Bind(Include = "GameRegionId,GameRegionName")] GameRegion gameRegion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gameRegion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(gameRegion));
 }
Пример #20
0
 // Use this for initialization
 void Start()
 {
     // originalSize = Camera.main.orthographicSize;
     camera_Z   = transform.position.z;
     gameRegion = gameRegionObject.GetComponent <GameRegion>();
     // RegionMinX = CameraRegion.transform.position.x - CameraRegion.GetComponent<SpriteRenderer>().size.x/2 + Camera.main.sensorSize.x;
     // RegionMaxX = CameraRegion.transform.position.x + CameraRegion.GetComponent<SpriteRenderer>().size.x/2 - Camera.main.sensorSize.x;
     // RegionMinY = CameraRegion.transform.position.y - CameraRegion.GetComponent<SpriteRenderer>().size.y/2 + Camera.main.sensorSize.y;
     // RegionMaxY = CameraRegion.transform.position.y + CameraRegion.GetComponent<SpriteRenderer>().size.y/2 - Camera.main.sensorSize.y;
 }
Пример #21
0
        public CombatantOffsets(bool Is64Bit, GameRegion region)
        {
            Name              = 0x30;
            ID                = 0x74;
            OwnerID           = 0x84;
            Type              = 0x8C;
            EffectiveDistance = 0x92;
            PosX              = 0xA0;
            PosZ              = PosX + 0x4;
            PosY              = PosZ + 0x4;
            Heading           = PosZ + 0x8;
            FateID            = 0xE8;
            TargetID          = Is64Bit ? 0x1D8 : 0x1C8;
            TargetID2         = Is64Bit ? 0x990 : 0x9D8;
            int offset;

            if (region == GameRegion.Chinese)
            {
                ContentID = Is64Bit ? 0x1694 : 0x136C;
                offset    = Is64Bit ? 0x16B0 : 0x1388;
                Job       = offset + 0x3E;
                Level     = offset + 0x40;
            }
            else if (region == GameRegion.Korean)
            {
                ContentID = Is64Bit ? 0x1684 : 0x1354;
                offset    = Is64Bit ? 0x16A0 : 0x1370;
                Job       = offset + 0x3E;
                Level     = offset + 0x40;
            }
            else
            {
                ContentID = Is64Bit ? 0x16D8 : 0x1380;
                offset    = Is64Bit ? 0x16F8 : 0x13A0;
                Job       = offset + 0x40;
                Level     = offset + 0x42;
            }
            CurrentHP = offset + 0x8;
            MaxHP     = offset + 0xC;
            CurrentMP = offset + 0x10;
            MaxMP     = offset + 0x14;
            CurrentTP = offset + 0x18;
            CurrentGP = offset + 0x1A;
            MaxGP     = offset + 0x1C;
            CurrentCP = offset + 0x1E;
            MaxCP     = offset + 0x20;
            if (region == GameRegion.Chinese || region == GameRegion.Korean)
            {
                StatusEffectsStart = Is64Bit ? offset + 0xB8 : offset + 0x94;
            }
            else
            {
                StatusEffectsStart = Is64Bit ? offset + 0xC0 : offset + 0xA4;
            }
        }
Пример #22
0
        public ActionResult Create([Bind(Include = "GameRegionId,GameRegionName")] GameRegion gameRegion)
        {
            if (ModelState.IsValid)
            {
                db.GameRegions.Add(gameRegion);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gameRegion));
        }
Пример #23
0
 /// <summary>
 /// Gets the <see cref="System.Text.Encoding"/> associated with the specified <paramref name="region"/>
 /// </summary>
 /// <param name="region">The region of the game</param>
 /// <returns></returns>
 public static Encoding GetEncoding(this GameRegion region)
 {
     if (region == GameRegion.US)
     {
         return(new USEncoding());
     }
     else
     {
         return(new JapaneseEncoding());
     }
 }
Пример #24
0
        public async Task PlayerStoreTest()
        {
            const string         connectionString = "Data Source=(LocalDb)\\MSSQLLocalDB;Initial Catalog=GuildTools;Integrated Security=True";
            KeyedResourceManager manager          = new KeyedResourceManager();

            BlizzardApiSecrets blizzardSecrets = new BlizzardApiSecrets()
            {
                ClientId     = this.config.GetValue <string>("BlizzardApiSecrets:ClientId"),
                ClientSecret = this.config.GetValue <string>("BlizzardApiSecrets:ClientSecret")
            };

            IMemoryCache      memoryCache = new MemoryCache(new MemoryCacheOptions());
            GuildToolsContext context     = new GuildToolsContext(SqlServerDbContextOptionsExtensions.UseSqlServer(new DbContextOptionsBuilder(), connectionString).Options as DbContextOptions);

            HttpClient              client          = new HttpClient();
            IDataRepository         repo            = new DataRepository(context);
            IBlizzardService        blizzardService = new BlizzardService(repo, this.config, client);
            PerRequestCallThrottler throttler       = new PerRequestCallThrottler(TimeSpan.FromSeconds(1));
            IGuildService           guildService    = new GuildService(blizzardService, throttler);

            int profileId = 1;

            GameRegion region = new GameRegion()
            {
                Id         = 1,
                RegionName = "US"
            };

            StoredRealm realm = context.StoredRealms.Include(a => a.Region).First();
            StoredGuild guild = context.StoredGuilds.First();

            PlayerStoreByValue playerStore = new PlayerStoreByValue(guildService, memoryCache, context, manager);

            DateTime initial = DateTime.Now;

            var realms = await playerStore.GetPlayerAsync("Kromp", realm, guild, profileId);

            DateTime second       = DateTime.Now;
            TimeSpan sinceInitial = second - initial;

            var realms2 = await playerStore.GetPlayerAsync("Kromp", realm, guild, profileId);

            DateTime third       = DateTime.Now;
            TimeSpan sinceSecond = third - second;

            var realms3 = await playerStore.GetPlayerAsync("Kromp", realm, guild, profileId);

            DateTime fourth     = DateTime.Now;
            TimeSpan sinceThird = fourth - third;

            int x = 42;
        }
Пример #25
0
 public ContentFinderOffsets(bool Is64Bit, GameRegion region)
 {
     if (region == GameRegion.Korean)
     {
         StateOffset      = Is64Bit ? 0x6D : 0x65;
         RouletteIdOffset = Is64Bit ? 0x72 : 0x6A;
     }
     else
     {
         StateOffset      = Is64Bit ? 0x71 : 0x69;
         RouletteIdOffset = Is64Bit ? 0x76 : 0x6E;
     }
 }
        public void WhenSelectGameRegionCommandExecuted_SelectedRegionPropertyChanged()
        {
            //Prepare
            Mock <INewsService> mockedNewsService = new Mock <INewsService>();
            GameViewModel       target            = new GameViewModel(mockedNewsService.Object);
            GameRegion          gameRegion        = new GameRegion();

            //Act
            target.SelectGameRegionCommand.Execute(gameRegion);

            //Verify
            Assert.AreEqual(gameRegion, target.SelectedRegion);
        }
Пример #27
0
        // GET: GameRegions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GameRegion gameRegion = db.GameRegions.Find(id);

            if (gameRegion == null)
            {
                return(HttpNotFound());
            }
            return(View(gameRegion));
        }
Пример #28
0
        public void StartGame(bool resetTeams)
        {
            m_Running = false;

            if (m_GameTimer != null)
            {
                m_GameTimer.Stop();
            }

            if (m_ScoreTimer != null)
            {
                m_ScoreTimer.Stop();
            }

            if (resetTeams)
            {
                PlayerMessage("The game will start in 30 seconds, please select your team.");

                int       teamSize = this.TeamSize;
                ArrayList players  = new ArrayList();
                for (int i = 0; i < m_Teams.Count; i++)
                {
                    CTFTeam t = (CTFTeam)m_Teams[i];
                    for (int j = 0; j < t.Members.Count; j++)
                    {
                        Mobile m = (Mobile)t.Members[i];
                        m.Frozen = true;
                        m.SendGump(new GameTeamSelector(this, teamSize));
                        players.Add(m);
                    }

                    t.Members.Clear();
                }

                new StartTimer(this, players).Start();
            }
            else
            {
                ResetGame();
            }
            if (m_GameType == 1)
            {
                m_Region = new GameRegion(1);
            }
            else
            {
                m_Region = new GameRegion(2);
            }
        }
Пример #29
0
        private static void DecreaseFishPop(string GUID, GameRegion regionID, float curTime)
        {
            if (regionID == GameRegion.CoastalRegion)
            {
                return;
            }
            FishingHole hole = GetFishingHole(GUID, regionID, curTime);

            hole.curPop = Mathf.Max(0f, hole.curPop - 1);
            Debug.Log(Enum.GetName(typeof(GameRegion), regionID) + " pop update to" + hole.curPop);
            if (regionID == GameRegion.LakeRegion)
            {
                UpdateOtherLakeHolesPop(hole);
            }
        }
            private static void Prefix(ref string sceneName)
            {
                if (!overrideSceneToLoad)
                {
                    return;
                }

                GameRegion startRegion = GameManager.m_StartRegion;

                if (startRegion != GameRegion.RandomRegion && startRegion != GameRegion.FutureRegion)
                {
                    sceneName = GameManager.m_StartRegion.ToString();
                }
                overrideSceneToLoad = false;
            }