public QueueGamer(ConnectedClient <IMessage> client, DataOfAccount data) { NickName = data.NickName; Password = data.Password; Client = client; AddInRoom = false; }
public QueueController(ConnectedClient <IMessage> client, DataOfAccount data) { this.client = client; client.Controler = this; client.EventEndSession += Handler_EndSession; client.SendMessage(new RequestJoinToQueue()); gamer = new QueueGamer(client, data); }
private static bool RecordInFile(string nameFile, DataOfAccount data) { using (FileStream fs = new FileStream(nameFile, FileMode.OpenOrCreate)) { formatter.Serialize(fs, data); return(true); } }
public void AddData(DataOfAccount addData) { QuantityKills += addData.QuantityKills; QuantityBattles += addData.QuantityBattles; QuantityDeaths += addData.QuantityDeaths; TimeInGame_Seconds += addData.TimeInGame_Seconds; TimeInGame_Minutes += addData.TimeInGame_Minutes; TimeInGame_Hours += addData.TimeInGame_Hours; TimeInGame_Days += addData.TimeInGame_Days; }
private static bool CheckPassword(string Login, string Password) { DataOfAccount data = ReadData(CreatePathByLogin(Login)); if (data.Password == Password) { return(true); } return(false); }
public static bool AddToStatistic(DataOfAccount achievements) { try { string Path = CreatePathByLogin(achievements.NickName); DataOfAccount mainData = ReadData(Path); mainData.AddData(achievements); if (RecordInFile(Path, mainData)) { return(true); } return(false); } catch (Exception e) { Log.AddNewRecord(e.ToString()); return(false); } }
public static bool CreateAccount(string Login, string Password) { try { string Path = CreatePathByLogin(Login); CreateFileForAccount(Path); //инициализируем ее стандартными данными DataOfAccount emptyAccount = new DataOfAccount(Login, Password, 0, 0, 0, new TimeSpan()); //записываем if (!RecordInFile(Path, emptyAccount)) { return(false); } return(true); } catch (Exception e) { Log.AddNewRecord(e.ToString()); return(false); } }
/// <summary> /// получает данные о клиенте и записывает их в поле data /// </summary> private void InitializeDataAboutClient(string login, string password) { //получаем данные об аккаунте data = BDAccounts.GetDataOfAccount(login, password); }