Пример #1
0
            //------------------------------------------------
            //---------------------------------------

            /// <summary>
            /// This function will create the Security data in
            /// location <see cref="endFileName"/>
            /// at the server.
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private async void CreatingTheProfileSecurityWorker(object sender, EventArgs e)
            {
                ((Timer)sender).Enabled = false;
                ((Timer)sender).Dispose();
                //MessageBox.Show("I am");
                var          targetFile = _username + endFileName;
                StrongString myString   =
                    _username + charSeparater +
                    _password + charSeparater +
                    _token + charSeparater;
                await ThereIsServer.Actions.CreateFile(ThereIsServer.ServersInfo.MyServers[0],
                                                       targetFile,
                                                       new DataBaseCreation("Testing for Creating", QString.Parse(myString)));

                Father.IsSecuredMeWorkingOver = true;
                if (!Directory.Exists(ThereIsConstants.Path.Profile_Folder_Path))
                {
                    Directory.CreateDirectory(ThereIsConstants.Path.Profile_Folder_Path);
                }
                ProfileInfo myInfo = new ProfileInfo(_username.GetValue(), _token.GetValue(),
                                                     ThereIsConstants.AppSettings.GlobalTiming.GetForServer().GetValue());

                ProfileInfo.UpdateInfo(myInfo, ThereIsConstants.Path.ProfileInfo_File_Path);
                AccountInfo myAccInfo = new AccountInfo(1,
                                                        ThereIsConstants.AppSettings.GlobalTiming.GetForServer().GetValue());

                AccountInfo.UpdateInfo(myAccInfo, ThereIsConstants.Path.AccountInfo_File_Path);
                GC.Collect();
            }
Пример #2
0
 //-------------------------------------------------
 #region Contructors Region
 public DataBaseUpdateRequest(StrongString theMessage, StrongString theContext, StrongString theSha) :
     base(theMessage.GetValue(),
          QString.Parse(theContext).GetString(),
          theSha.GetValue())
 {
     // do nothing here...
 }
Пример #3
0
 //--------------------------------------------------
 public UpdatingServerSandBox(GameControls.PageControl theCurrentForm,
                              ref StrongString releaseDate) : base(theCurrentForm)
 {
     Mode           = SandBoxMode.UpdatingServerMode;
     ClosedForRetry = false;
     ReleaseDate    = releaseDate.GetValue();
     InitializeComponent();
 }
Пример #4
0
        public byte[] GetBytes(StrongString name)
        {
            var _r = base.GetObject(name.GetValue());

            if (_r is byte[] _b)
            {
                return(_b);
            }
            return(null);
        }
Пример #5
0
        //-------------------------------------------------
        public override string ToString()
        {
            StrongString myString =
                HP_Rate.GetForServer() + OutCharSeparator +         // index: 0
                ATK_Rate.GetForServer() + OutCharSeparator +        // index : 1
                INT_Rate.GetForServer() + OutCharSeparator +        // index : 2
                DEF_Rate.GetForServer() + OutCharSeparator +        // index : 3
                RES_Rate.GetForServer() + OutCharSeparator +        // index : 4
                SPD_Rate.GetForServer() + OutCharSeparator +        // index : 5
                PEN_Rate.GetForServer() + OutCharSeparator +        // index : 6
                Block_Rate.GetForServer() + OutCharSeparator;       // index : 7

            return(myString.GetValue());
        }
Пример #6
0
 /// <summary>
 /// Loading the ordinary Information of this hero from
 /// the file.
 /// loading <see cref="Name"/>,
 /// <see cref="HeroSkill"/> (by: <see cref="HeroSkill.GetHeroSkill(string, uint)"/>
 /// which string is <see cref="HeroSerialize.HeroSkillsString"/> and
 /// uint is <see cref="HeroSerialize.HeroSkillsCount"/>),
 /// <see cref="HeroType"/>.
 /// </summary>
 /// <param name="heroID"></param>
 protected virtual void LoadMe(StrongString heroID)
 {
     if (this.MyRes is null)
     {
         this.MyRes = new WotoRes(typeof(Hero));
     }
     //---------------------------------------------
     this.HeroSerialize =
         HeroSerialize.GetHeroSerialize(heroID.GetValue());
     this.Name      = this.HeroSerialize.HeroName;
     this.HeroSkill = HeroSkill.GetHeroSkill(this.HeroSerialize.HeroSkillsString,
                                             this.HeroSerialize.HeroSkillsCount, this);
     this.HeroType    = this.HeroSerialize.HeroType;
     this.HeroElement = this.HeroSerialize.HeroElement;
     //---------------------------------------------
 }
Пример #7
0
        //-------------------------------------------------


        #endregion Properties Region
        //-------------------------------------------------
        #region Constructor Region
        /// <summary>
        ///
        /// </summary>
        /// <param name="heroIDValue"></param>
        /// <param name="customNameValue"></param>
        /// <param name="levelValue"></param>
        /// <param name="powerValue"></param>
        /// <param name="skillStringValue"></param>
        protected Hero(
            StrongString customNameValue,
            StrongString heroIDValue,
            uint levelValue,
            Unit powerValue,
            Unit skillPoint,
            uint stars,
            StrongString skillStringValue
            )
        {
            CustomName = customNameValue;
            HeroID     = heroIDValue;
            Level      = levelValue;
            Power      = powerValue;
            SkillPoint = skillPoint;
            Stars      = stars;
            LoadMe(heroIDValue);                             // Load values which should be loaded locally.
            HeroSkill.LoadInfo(skillStringValue.GetValue()); // Load from the server string.
        }
Пример #8
0
 //-------------------------------------------------
 #region Constructors Region
 public DataBaseDeleteRequest(StrongString theMessage, StrongString theSha) :
     base(theMessage.GetValue(), theSha.GetValue())
 {
     // do nothing here ... (for now)
 }
Пример #9
0
 public object GetObject(StrongString name)
 {
     return(base.GetObject(name.GetValue()));
 }
Пример #10
0
 public StrongString GetString(StrongString name)
 {
     return(base.GetString(name.GetValue()));
 }
Пример #11
0
 /// <summary>
 /// Setting the Text property to customValue.
 /// </summary>
 /// <param name="customValue">
 /// the custom Text.
 /// </param>
 public override void SetLabelText(StrongString customValue)
 {
     this.Text = customValue.GetValue();
 }
Пример #12
0
 private float FindWidth(StrongString value, Font font, Graphics graphics)
 {
     return(FindWidth(value.GetValue(), font, graphics));
 }
Пример #13
0
        //-------------------------------------------------
        #region Constants Region

        #endregion
        //-------------------------------------------------
        #region Contructors Region
        public DataBaseCreation(StrongString theMessage,
                                QString theContext) :
            base(theMessage.GetValue(), theContext.GetString())
        {
            // do nothing here...
        }
Пример #14
0
            private async void LoginToTheProfileWorker(object sender, EventArgs e)
            {
                ((Timer)sender).Enabled = false;
                ((Timer)sender).Dispose();
                //MessageBox.Show("I am");
                var targetFile   = _username + endFileName;
                var ExistingFile =
                    await ThereIsServer.Actions.GetAllContentsByRef(ThereIsServer.ServersInfo.MyServers[0],
                                                                    targetFile);

                if (ExistingFile.IsDeadCallBack || ThereIsServer.ServerSettings.HasConnectionClosed)
                {
                    NoInternetConnectionSandBox.PrepareConnectionClosedSandBox();
                    return;
                }
                StrongString myString = ExistingFile.Decode();

                Father.HasLogin = (_password == myString.Split(charSeparater)[1]);
                if (!Father.HasLogin)
                {
                    Father.IsSecuredMeWorkingOver = true;
                    return;
                }
                StrongString[] myStrings = myString.Split(charSeparater);
                StrongString   myToken   = GenerateToken();

                if (myStrings.Length >= 7)
                {
                    StrongString myAnotherString;
                    bool         ThisTokenAlreadyExists = false;
                    for (int i = 3; i < myStrings.Length; i++)
                    {
                        myAnotherString  = myStrings[i];
                        myStrings[i - 1] = myAnotherString;
                        if (myToken == myAnotherString)
                        {
                            ThisTokenAlreadyExists = true;
                        }
                    }
                    if (!ThisTokenAlreadyExists)
                    {
                        myStrings[6] = myToken;
                        myString     = charSeparater;
                        for (int i = 0; i < myStrings.Length; i++)
                        {
                            myString += charSeparater + myStrings[i];
                        }
                        await ThereIsServer.Actions.UpdateFile(ThereIsServer.ServersInfo.MyServers[0],
                                                               targetFile,
                                                               new DataBaseUpdateRequest("By SAO", QString.Parse(myString), ExistingFile.Sha));
                    }
                    else
                    {
                        // impossible to reach this branch of the code...
                    }
                }
                else
                {
                    myString = charSeparater;
                    for (int i = 0; i < myStrings.Length; i++)
                    {
                        myString += myStrings[i] + charSeparater;
                    }
                    myString += myToken;
                    await ThereIsServer.Actions.UpdateFile(ThereIsServer.ServersInfo.MyServers[0],
                                                           targetFile,
                                                           new DataBaseUpdateRequest("By SAO", QString.Parse(myString), ExistingFile.Sha));
                }
                Father.IsSecuredMeWorkingOver = true;

                if (!Directory.Exists(ThereIsConstants.Path.Profile_Folder_Path))
                {
                    Directory.CreateDirectory(ThereIsConstants.Path.Profile_Folder_Path);
                }
                ProfileInfo myInfo = new ProfileInfo(_username.GetValue(), myToken.GetValue(),
                                                     ThereIsConstants.AppSettings.GlobalTiming.GetForServer().GetValue());

                ProfileInfo.UpdateInfo(myInfo, ThereIsConstants.Path.ProfileInfo_File_Path);
                AccountInfo myAccInfo = new AccountInfo(1,
                                                        ThereIsConstants.AppSettings.GlobalTiming.GetForServer().GetValue());

                AccountInfo.UpdateInfo(myAccInfo, ThereIsConstants.Path.AccountInfo_File_Path);
                GC.Collect();
            }