路书上在线的人过滤掉比赛中的用户,获取服务器UTC时间转换成当地时间
This commit is contained in:
parent
dcc65cdd86
commit
6ad01c50df
@ -188,17 +188,24 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据路书获取在线用户
|
||||
/// 根据路书获取在线用户(非比赛用户不能看到比赛中的用户)
|
||||
/// </summary>
|
||||
/// <param name="routeId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<OnlineUser> GetOnlineUsers(params int[] routeId)
|
||||
{
|
||||
//return onlineUsers.Where(n => routeId.Contains(n.RouteId)).ToList();
|
||||
var result = onlineUserHelper.OnlineUsers.Where(u => routeId.Contains(u.RouteId)).ToList();
|
||||
var result = onlineUserHelper.OnlineUsers.Where(u => routeId.Contains(u.RouteId) && u.CompetitionId == 0).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//比赛中的人只能看到当前比赛的人
|
||||
public static List<OnlineUser> GetCompetitionOnlineUsers(int competitionId)
|
||||
{
|
||||
var result = onlineUserHelper.OnlineUsers.Where(u => u.CompetitionId == competitionId).ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int GetNearRiderCount()
|
||||
{
|
||||
return onlineUserHelper.OnlineUsers.Count();
|
||||
|
||||
@ -126,8 +126,7 @@ namespace Assets.Scripts.Apis
|
||||
public async Task<DateTime> GetNow()
|
||||
{
|
||||
var result = await GetAsync("NoAuth/GetNow");
|
||||
|
||||
return DateTime.Parse(System.Text.Encoding.UTF8.GetString(result));
|
||||
return DateTime.Parse(System.Text.Encoding.UTF8.GetString(result)).ToLocalTime();//将服务器UTC时间转换成当地时区的时间
|
||||
}
|
||||
|
||||
public async Task<JsonResult<object>> Register(string Phone, string Pwd, string Captcha)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user