Пример #1
0
        public async Task <DbPlayerProfile> GetUserPlayerProfile(DeltaConnection conn, DbUser user)
        {
            var filterBuilder = Builders <DbPlayerProfile> .Filter;
            var filter        = filterBuilder.Eq("server_id", _id) & filterBuilder.Eq("steam_id", user.steam_id);
            var results       = await conn.content_player_profiles.FindAsync(filter);

            return(await results.FirstOrDefaultAsync());
        }
Пример #2
0
 /// <summary>
 /// Checks if a user is admin on this server
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public bool CheckIsUserAdmin(DbUser user)
 {
     return(admins.Contains(user._id));
 }