Exemple #1
0
 public async Task <InterestItem> AddInterest(string Category, string Tag)
 {
     return(await FirebaseDbConnection.AddInterest(new InterestItem()
     {
         Category = Category, Name = Tag
     }));
 }
Exemple #2
0
        public void UpdateUserAccessList()
        {
            logger.Log(LogLevel.Information, "Downloading User Access List...");
            var _userAccessListm = FirebaseDbConnection.GetUsers();

            _userAccessListm.Wait();
            _userAccessList = _userAccessListm.Result;
        }
Exemple #3
0
 public new async Task Remove(InterestItem item)
 {
     base.Remove(item);
     if (string.IsNullOrEmpty(item.Key))
     {
         return;
     }
     await FirebaseDbConnection.RemoveInterest(item);
 }
Exemple #4
0
        public async Task <bool> UpdateUser(User user)
        {
            try
            {
                await FirebaseDbConnection.UpdateUser(user);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #5
0
        public async Task <bool> RegisterUser(User user)
        {
            logger.Log(LogLevel.Information, "Registering user: " + user.ToString());
            if (_userAccessList.FirstOrDefault(e => e.Username.Contains(user.Username, StringComparison.InvariantCultureIgnoreCase)) == null)
            {
                var result = await FirebaseDbConnection.CreateUser(user);

                result.Object.Key = result.Key;
                _userAccessList.Add(result.Object);
                return(true);
            }
            return(false);
        }
Exemple #6
0
        public async Task <InterestItem> Add(string Category, string Tag)
        {
            if (string.IsNullOrEmpty(Category) || string.IsNullOrEmpty(Tag))
            {
                return(null);
            }
            var interest = new InterestItem()
            {
                Category = Category, Name = Tag
            };

            try {
                interest.Key = (await FirebaseDbConnection.AddInterest(interest)).Key;
                Add(interest);
            }
            catch (Exception e)
            {
                logger.LogError("Failed adding interest error message: {0}", e.Message);
            }
            return(interest);
        }
Exemple #7
0
 private void GetInterestList()
 {
     logger.Log(LogLevel.Information, "Downloading Interest List...");
     Clear();
     AddRange(FirebaseDbConnection.GetInterests().Result);
 }
Exemple #8
0
 public void Delete(Lobby lobby)
 {
     Task.Run(() => FirebaseDbConnection.removeRoom(lobby));
     Lobbies.Remove(lobby);
 }
Exemple #9
0
 // Active rooms save to Firebase
 public void Add(Lobby lobby)
 {
     Task.Run(() => FirebaseDbConnection.addRoom(lobby));
 }
Exemple #10
0
        public async Task RemoveInterest(InterestItem item)
        {
            await FirebaseDbConnection.RemoveInterest(item);

            Interests.Remove(item);
        }