Пример #1
0
 /// <summary>
 /// Adds the new.
 /// </summary>
 private void AddNew()
 {
     var frmVersion = new frm_VersionName();
     frmVersion.ShowDialog();
     if (frmVersion.NewVersion != string.Empty) {
         if (CurrentCollection == null) {
             CurrentCollection = new AddressDTOCollection();
         }
         var res = (from addr in CurrentCollection where addr.ClientVersion == frmVersion.NewVersion select addr);
         if (res.Count() == 0) {
             CurrentAddress = new AddressDTO() { ClientVersion = frmVersion.NewVersion };
             CurrentCollection.Add(CurrentAddress);
             Save(false);
             LoadCollection(false);
             AllowChangeAddress = true;
             ddlVersion.SelectComboItem(CurrentAddress.ClientVersion);
         }
         else {
             MessageBox.Show("This version already exist!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             AllowChangeAddress = true;
             ddlVersion.SelectComboItem(res.First().ClientVersion);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AddressProvider"/> class.
 /// </summary>
 public MemoryAddresses(AddressDTO dto)
 {
     Parse(dto);
 }
Пример #3
0
        /// <summary>
        /// Parses the specified dto.
        /// </summary>
        /// <param name="dto">The dto.</param>
        private void Parse(AddressDTO dto)
        {
            this.Version = dto.ClientVersion;

            this.Containers = new Containers() {
                StarT = dto.ContainerBegin
            };
            this.Inventory = new Inventory() {
                Head = dto.HeadInventory
            };
            this.Map = new Map() {
                Pointer = dto.MapPointer,
                FullLight = dto.FullLight,
                FullLightNop = dto.FullLightNop
            };
            this.Player = new Player() {
                Exp = dto.Exp,
                InGame = dto.InGame,
                Target_ID = dto.RedSquare
            };
            this.VipList = new VipList() {
                VipBegin = dto.VipBegin
            };
            this.SpyLevel = new SpyLevel() {
                LevelSpy1 = dto.LevelSpy1,
                LevelSpy2 = dto.LevelSpy2,
                LevelSpy3 = dto.LevelSpy3,
                LevelSpyPtr = dto.LevelSpyPtr,
                NameSpy1 = dto.NameSpy1,
                NameSpy2 = dto.NameSpy2,
            };
            this.Client = new Address.Client() {
                XTeaKey = dto.XTeaKey,
                RSAKey = dto.RSAKey,
                DatPointer = dto.DatPointer,
                FrameRateBegin = dto.FrameRateBegin,
                MultiClient = dto.MapPointer,
                SafeMode = dto.SafeMode,
                LoginCharList = dto.LoginCharList,
                LoginServerStart = dto.LoginServerStart,
                LoginSelectedChar = dto.LoginSelectedChar,
                PrintName = dto.PrintName,
                PrintFPS = dto.PrintFPS,
                howFPS = dto.howFPS,
                NopFPS = dto.NopFPS,
                PrintTextFunc = dto.PrintTextFunc,
            };
            this.BattleList = new BattleList(Player.Exp) {
                RedSQuare = dto.RedSquare
            };
            this.Creature = new Creature();
            this.DatItem = new DatItem();
            this.Skills = new Skills(Player.Exp);
        }