2022-05-10 19:24:07 +08:00
|
|
|
|
using Assets.Scripts.Apis.Models;
|
|
|
|
|
|
using GeoJSON.Net.Geometry;
|
2021-03-30 17:15:16 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2021-06-09 17:17:11 +08:00
|
|
|
|
using System.Globalization;
|
2021-03-30 17:15:16 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Assets.Scenes.Ride.Scripts.Model
|
|
|
|
|
|
{
|
2022-04-29 19:03:18 +08:00
|
|
|
|
public class RoomModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int UserId { get; set; }//房主
|
|
|
|
|
|
|
|
|
|
|
|
public int Status { get; set; }//房间状态 0 :准备状态 1:开始loading
|
|
|
|
|
|
|
|
|
|
|
|
public DateTime? StartTime { get; set; }//开始时间
|
|
|
|
|
|
|
|
|
|
|
|
public static RoomModel Parse(string msg)
|
|
|
|
|
|
{
|
|
|
|
|
|
var detail = new RoomModel();
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var arr = msg.Split(',');
|
|
|
|
|
|
DateTime? startTime = null;
|
|
|
|
|
|
if(!string.IsNullOrEmpty(arr[3]))
|
|
|
|
|
|
startTime = Convert.ToDateTime(arr[3], CultureInfo.InvariantCulture);
|
|
|
|
|
|
|
|
|
|
|
|
detail.Id = Convert.ToInt32(arr[0], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.UserId = Convert.ToInt32(arr[1], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.Status = Convert.ToInt32(arr[2], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.StartTime = startTime;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
return detail;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public class ExtendInfo
|
|
|
|
|
|
{
|
2022-05-13 09:28:58 +08:00
|
|
|
|
public int TotalTicks { get; set; }
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public int RoomId { get; set; }
|
2022-05-13 09:28:58 +08:00
|
|
|
|
public int FrameRate { get; set; }
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
public static ExtendInfo Parse(string s)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(s))
|
|
|
|
|
|
return null;
|
|
|
|
|
|
var info = s.Split(',');
|
|
|
|
|
|
var ex = new ExtendInfo()
|
|
|
|
|
|
{
|
|
|
|
|
|
UserId = Convert.ToInt32(info[0]),
|
|
|
|
|
|
RoomId = Convert.ToInt32(info[1]),
|
2022-05-13 09:28:58 +08:00
|
|
|
|
FrameRate = Convert.ToInt32(info[2]),
|
|
|
|
|
|
TotalTicks = Convert.ToInt32(info[3]),
|
2022-05-10 19:24:07 +08:00
|
|
|
|
};
|
|
|
|
|
|
return ex;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-04-28 18:01:51 +08:00
|
|
|
|
public class RoomDetailModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int RoomId { get; set; }
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
public DateTime JoinAt { get; set; }
|
|
|
|
|
|
public int Status { get; set; }
|
|
|
|
|
|
public double Process { get; set; }
|
|
|
|
|
|
public bool IsOwner { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static RoomDetailModel Parse(string msg)
|
|
|
|
|
|
{
|
|
|
|
|
|
var detail = new RoomDetailModel();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var arr = msg.Split(',');
|
|
|
|
|
|
detail.RoomId = Convert.ToInt32(arr[0], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.UserId = Convert.ToInt32(arr[1], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.JoinAt = Convert.ToDateTime(arr[2], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.Status = Convert.ToInt32(arr[3], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.Process = Convert.ToDouble(arr[4], CultureInfo.InvariantCulture);
|
|
|
|
|
|
detail.IsOwner = Convert.ToBoolean(arr[5], CultureInfo.InvariantCulture);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
return detail;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public class QueryGameRoomListCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public byte CommandType { get; set; }
|
|
|
|
|
|
public byte SubType { get; set; }
|
|
|
|
|
|
public int V { get; set; }
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
public int PageIndex { get; set; }
|
|
|
|
|
|
public int PageSize { get; set; }
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
public class QueryGameRoomDetailCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public byte CommandType { get; set; }
|
|
|
|
|
|
public byte SubType { get; set; }
|
|
|
|
|
|
public int V { get; set; }
|
|
|
|
|
|
public int RoomId { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
public class CreateGameRoomCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public byte CommandType { get; set; }
|
|
|
|
|
|
public byte SubType { get; set; }
|
|
|
|
|
|
public int V { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int RouteId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int CloseTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int MaxMembers { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Password { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public DateTime CreateTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string MapRouteName { get; set; }
|
|
|
|
|
|
public double Distance { get; set; }
|
|
|
|
|
|
public double TotalClimb { get; set; }
|
|
|
|
|
|
public double AverageGrade { get; set; }
|
|
|
|
|
|
public bool Enable3D { get; set; }
|
|
|
|
|
|
public bool EnableAR { get; set; }
|
|
|
|
|
|
public bool IsLock { get; set; }
|
|
|
|
|
|
public string FileName { get; set; }
|
|
|
|
|
|
public string FileUrl { get; set; }
|
|
|
|
|
|
public string AltitudeGraph { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-04-28 18:01:51 +08:00
|
|
|
|
public class JoinGameRoomCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public byte CommandType { get; set; }
|
|
|
|
|
|
public byte SubType { get; set; }
|
|
|
|
|
|
public int V { get; set; }
|
|
|
|
|
|
public int RoomId { get; set; }
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
public DateTime JoinAt { get; set; }
|
2022-03-10 18:32:53 +08:00
|
|
|
|
}
|
2021-03-30 17:15:16 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 排名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class CompetitionRankingSortModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Index { get; set; }
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Headimage { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Near { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string KGWeight { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Speed { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string CountryImg { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsSelf { get; set; }
|
2021-08-10 16:36:13 +08:00
|
|
|
|
|
|
|
|
|
|
public DateTime CreateTime { get; set; }
|
|
|
|
|
|
public bool IsCompleted { get; set; }
|
|
|
|
|
|
public double EndDistance { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 结果页模型
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class CompetitionResultModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Index { get; set; }
|
|
|
|
|
|
|
2021-07-16 18:37:02 +08:00
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public string WxHeadImg { get; set; }
|
2021-07-16 18:37:02 +08:00
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
//public string Time { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Power { get; set; }
|
|
|
|
|
|
public double WeightKg { get; set; }
|
|
|
|
|
|
public double Weight { get; set; }
|
|
|
|
|
|
public double BicycleWeight { get; set; }
|
|
|
|
|
|
|
2021-08-10 16:36:13 +08:00
|
|
|
|
public double? HeartRate { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
|
public string DeviceType { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string CreateTime { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 骑行时长
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string TripTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string CompleteTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 与冲线时间的差距
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Gap { get; set; }
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public string Country { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
2021-07-23 09:04:56 +08:00
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public class RankingDataModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public TargetData data { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public class CompetitionTopModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
public int Index { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Country { get; set; }
|
|
|
|
|
|
|
2021-07-27 19:34:33 +08:00
|
|
|
|
public string Head { get; set; }
|
|
|
|
|
|
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public string TripTime { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public class RankingSortData
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Index { get; set; }
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string WxHeadImg { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string NickName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 注意这里TotalTime不是时间是距离,为了重用前端组件,没改名称
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double TotalTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int Ticks { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 其他人和我的距离(m)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double Near { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
public class CyclingFrameRankingModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public List<RankingDataModel> data { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public List<RankingSortData> sort { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int myranking { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 比赛的排名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class CompetitionRankingModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public List<CompetitionRankingSortModel> Sorts { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int Total { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int MyRanking { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public List<CompetitionResultModel> Results { get; set; }
|
2021-07-23 09:04:56 +08:00
|
|
|
|
|
|
|
|
|
|
public List<CompetitionTopModel> TopList { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 骑行中 输出的数据模型
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class OutModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public double progress { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double? Elevation { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Seconds { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int? EleIndex { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
//public long ExcuteTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
//public double? Bearing { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 坡度
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double SlopeGrade { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public TargetData targetData { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public List<OutUser> baseRiders { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public CyclingFrameRankingModel Ranking { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public CompetitionRankingModel CompetitionRanking { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public bool CanStart { get; set; } = true;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 开始倒计时
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int StartCountDown { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 结束倒计时
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int EndCountDown { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 标识比赛的倒计时是关门时间
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsClosed { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 是否已保存
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//public bool Saved { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 比赛模式下,第一名的坐标
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public GeographicPosition FirstPoint { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChartSymbol ChartSymbol { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class OutUser
|
|
|
|
|
|
{
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string InMapId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double NextDistance { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double PreDistance { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
//public TargetData targetData { get; set; }//暂时不需要此字段
|
|
|
|
|
|
public List<double[]> NextFrameArray { get; set; }
|
|
|
|
|
|
//private List<object> _nextFrameArray { get; set; }
|
|
|
|
|
|
//public List<object> NextFrameArray
|
|
|
|
|
|
//{
|
|
|
|
|
|
// get
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (_nextFrameArray != null)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// return _nextFrameArray;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// _nextFrameArray = (List<object>)CefBrowserPool.GetFrame(BrowserWindow.Main).EvaluateScriptAsync($"getFrameArray({PreDistance},{NextDistance})").ConfigureAwait(false).GetAwaiter().GetResult().Result;
|
|
|
|
|
|
// return _nextFrameArray;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
public string NickName { get; set; }
|
|
|
|
|
|
public string WxHeadImg { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsSelf
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-04-12 17:35:56 +08:00
|
|
|
|
return this.UserId == App.CurrentUser.Id;
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public GeographicPosition Point { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Bearing { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class ChartSymbol
|
|
|
|
|
|
{
|
|
|
|
|
|
private double _grade = 0;
|
|
|
|
|
|
private double _nextGrade = 0;
|
|
|
|
|
|
public string GradeSymbol
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_grade > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "+";
|
|
|
|
|
|
}
|
|
|
|
|
|
if (_grade < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "-";
|
|
|
|
|
|
}
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public string GradeDisplay
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_grade < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (_grade * -1).ToString("0.#");
|
|
|
|
|
|
}
|
|
|
|
|
|
if (_grade > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return _grade.ToString("0.#");
|
|
|
|
|
|
}
|
|
|
|
|
|
return "0";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string NextGrade
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_nextGrade > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "+" + _nextGrade.ToString("0.#");
|
|
|
|
|
|
}
|
|
|
|
|
|
return _nextGrade.ToString("0.#");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 单位m
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double Distance { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="grade"></param>
|
|
|
|
|
|
/// <param name="nextGrade"></param>
|
|
|
|
|
|
/// <param name="distance">单位m</param>
|
|
|
|
|
|
public ChartSymbol(double grade, double nextGrade, double distance)
|
|
|
|
|
|
{
|
|
|
|
|
|
this._grade = grade;
|
|
|
|
|
|
this._nextGrade = nextGrade;
|
|
|
|
|
|
this.Distance = Math.Round(distance, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class NearRiderModel
|
|
|
|
|
|
{
|
2021-04-12 17:35:56 +08:00
|
|
|
|
public int Id { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Headimage { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Near { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string KGWeight { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Speed { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string CountryImg { get; set; }
|
|
|
|
|
|
|
2021-04-30 17:25:28 +08:00
|
|
|
|
public string Country { get; set; }
|
|
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public bool IsSelf { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class MsgModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int RouteId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int MemberId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double[] Point { get; set; }
|
|
|
|
|
|
|
2021-07-01 18:41:35 +08:00
|
|
|
|
//public bool exit { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
|
public double Speed { get; set; }
|
|
|
|
|
|
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public double Power { get; set; }
|
2021-07-30 19:39:01 +08:00
|
|
|
|
public double? HeartRate { get; set; }
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public double? Cadence { get; set; }
|
|
|
|
|
|
public int TotalTicks { get; set; }
|
|
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public bool IsCompleted { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 需要展示的属性
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
//public string Prop { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double EndDistance { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 是否展示在线的人
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//public bool ShowVirtual { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 命令类型,0命令,1消息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public byte CommandType { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
//public bool IsVirtual { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 功率体重比
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double WeightKg { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double PreDistance { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int Competitionid { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 客户端通过是否有用户保存了数据,来拉取相应的已经被保存的数据。(主要用在比赛)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool Saved { get; set; }
|
|
|
|
|
|
|
2021-07-01 18:41:35 +08:00
|
|
|
|
//public int V { get; set; }
|
2022-04-20 17:32:27 +08:00
|
|
|
|
|
|
|
|
|
|
public int FrameRate { get; set; }
|
2022-04-28 18:01:51 +08:00
|
|
|
|
public int RoomId { get; set; }
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public string Model { get; set; }
|
2022-04-28 18:01:51 +08:00
|
|
|
|
public DateTime? StartTime { get; set; }
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public string Request { get; set; }
|
2021-07-01 18:41:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class GzipMsgModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int CommandType { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public int V { get; set; }
|
2021-07-01 18:41:35 +08:00
|
|
|
|
public string Encoding { get; set; }
|
|
|
|
|
|
public string Client { get; set; }
|
2021-07-06 18:24:15 +08:00
|
|
|
|
public int MemberId { get; set; }
|
|
|
|
|
|
public int Competitionid { get; set; }
|
|
|
|
|
|
public bool IsWatch { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class ReceiveMsgModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public int RouteId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int MemberId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double[] Point { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
//public bool exit { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Speed { get; set; }
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public double Power { get; set; }
|
|
|
|
|
|
public double HeartRate { get; set; }
|
|
|
|
|
|
public double Cadence { get; set; }
|
|
|
|
|
|
public int TotoalTicks { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
|
public bool IsCompleted { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 需要展示的属性
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
//public string Prop { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double EndDistance { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否展示在线的人
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
//public bool ShowVirtual { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 命令类型,0命令,1消息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
//public byte CommandType { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
//public bool IsVirtual { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public double PreDistance { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 功率体重比
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double WeightKg { get; set; }
|
|
|
|
|
|
public int Competitionid { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public bool Saved { get; set; }
|
|
|
|
|
|
|
2021-07-06 18:24:15 +08:00
|
|
|
|
public string WatchIdList { get; set; }
|
|
|
|
|
|
|
2022-05-13 09:28:58 +08:00
|
|
|
|
public int FrameRate { get; set; }
|
2022-04-28 18:01:51 +08:00
|
|
|
|
public int? RoomId { get; set; }
|
2022-05-13 09:28:58 +08:00
|
|
|
|
|
|
|
|
|
|
public int GameRoomTotal { get; set; }
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public List<GameRoomModel> RoomList { get; set; }
|
|
|
|
|
|
public GameRoomModel RoomDetail { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
|
public static ReceiveMsgModel Parse(string str)
|
|
|
|
|
|
{
|
|
|
|
|
|
var list = str.Split(',');
|
2022-04-28 18:01:51 +08:00
|
|
|
|
if (list.Length < 14)
|
2021-03-30 17:15:16 +08:00
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-04-28 18:01:51 +08:00
|
|
|
|
DateTime ? startTime = null;// string.IsNullOrEmpty(list[16]) ? null : Convert.ToDateTime(list[16], CultureInfo.InvariantCulture);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(list[16]))
|
|
|
|
|
|
{
|
|
|
|
|
|
startTime = Convert.ToDateTime(list[16], CultureInfo.InvariantCulture);
|
|
|
|
|
|
}
|
2021-03-30 17:15:16 +08:00
|
|
|
|
return new ReceiveMsgModel
|
|
|
|
|
|
{
|
2021-06-09 17:17:11 +08:00
|
|
|
|
RouteId = Convert.ToInt32(list[0],CultureInfo.InvariantCulture),
|
|
|
|
|
|
MemberId = Convert.ToInt32(list[1], CultureInfo.InvariantCulture),
|
|
|
|
|
|
Point = new double[] { double.Parse(list[2].Split(':')[0], CultureInfo.InvariantCulture), double.Parse(list[2].Split(':')[1], CultureInfo.InvariantCulture) },
|
2021-03-30 17:15:16 +08:00
|
|
|
|
IsCompleted = ToBoolean(list[3]),
|
|
|
|
|
|
//exit = ToBoolean(list[4]),
|
2021-06-09 17:17:11 +08:00
|
|
|
|
Speed = Convert.ToDouble(list[4], CultureInfo.InvariantCulture),
|
|
|
|
|
|
PreDistance = Convert.ToDouble(list[5], CultureInfo.InvariantCulture),
|
|
|
|
|
|
EndDistance = Convert.ToDouble(list[6], CultureInfo.InvariantCulture),
|
|
|
|
|
|
WeightKg = Convert.ToDouble(list[7], CultureInfo.InvariantCulture),
|
|
|
|
|
|
Competitionid = Convert.ToInt32(list[8], CultureInfo.InvariantCulture),
|
2021-07-23 09:04:56 +08:00
|
|
|
|
Saved = ToBoolean(list[9]),
|
|
|
|
|
|
Power = Convert.ToDouble(list[10], CultureInfo.InvariantCulture),
|
|
|
|
|
|
HeartRate = Convert.ToDouble(list[11], CultureInfo.InvariantCulture),
|
|
|
|
|
|
Cadence = Convert.ToDouble(list[12], CultureInfo.InvariantCulture),
|
|
|
|
|
|
TotoalTicks = Convert.ToInt32(list[13], CultureInfo.InvariantCulture),
|
2021-03-30 17:15:16 +08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
2022-04-28 18:01:51 +08:00
|
|
|
|
catch(Exception e)
|
2021-03-30 17:15:16 +08:00
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static bool ToBoolean(string str)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Convert.ToBoolean(int.Parse(str));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class OnlineUser
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用户Id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 在地图中的ID
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string InMapId
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (IsVirtual)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return "Online-Virtual-" + this.Id;
|
|
|
|
|
|
//}
|
|
|
|
|
|
return "Online-" + this.Id;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public int Sex { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
|
public bool IsVirtual { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 虚拟人物名称
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public double Weight { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 头像地址
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string HeadImage { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 路线Id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int RouteId { get; set; }
|
2021-12-15 13:24:26 +08:00
|
|
|
|
public string RouteName { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// FTP
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int FTP { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 点位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double[] Point { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 需要展示的属性
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
//public List<KeyPaire> Show { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 需要隐藏的属性
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public List<KeyPaire> Hide { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否骑行完毕
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsCompleted { get; set; }
|
|
|
|
|
|
|
2021-07-06 18:24:15 +08:00
|
|
|
|
public bool IsWatcher { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public List<int> WatcherList { get; set; }
|
|
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
public double PreDistance { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 最后距离
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double EndDistance { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 是否退出
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//public bool exit { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 速度(km/h)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double Speed { get; set; }
|
2021-07-23 09:04:56 +08:00
|
|
|
|
public double Power { get; set; }
|
|
|
|
|
|
public double HeartRate { get; set; }
|
|
|
|
|
|
public double Cadence { get; set; }
|
|
|
|
|
|
public int TotalTicks { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 圆形头像
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//public string CircHeadImg
|
|
|
|
|
|
//{
|
|
|
|
|
|
// get; set;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsSelf
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2021-04-12 17:35:56 +08:00
|
|
|
|
return Id == App.CurrentUser.Id;
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public double WeightKg { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int CompetitionId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 已保存的
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool Saved { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public DateTime LastActiveTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsLost
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (DateTime.Now - LastActiveTime).TotalSeconds > 3;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-04-22 19:29:59 +08:00
|
|
|
|
|
|
|
|
|
|
public string Country { get; set; }
|
2021-08-10 16:36:13 +08:00
|
|
|
|
|
|
|
|
|
|
public DateTime CreateTime { get; set; }
|
2022-04-20 17:32:27 +08:00
|
|
|
|
|
2022-05-13 09:28:58 +08:00
|
|
|
|
public int FrameRate { get; set; }
|
2022-04-29 19:03:18 +08:00
|
|
|
|
|
2022-05-10 19:24:07 +08:00
|
|
|
|
public int RoomId { get; set; }
|
|
|
|
|
|
|
2022-04-29 19:03:18 +08:00
|
|
|
|
public RoomModel Room { get; set; }
|
|
|
|
|
|
|
2022-04-28 18:01:51 +08:00
|
|
|
|
public RoomDetailModel RoomDetail { get; set; }
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class KeyPaire
|
|
|
|
|
|
{
|
|
|
|
|
|
public object Key { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public object Value { get; set; }
|
|
|
|
|
|
public KeyPaire(object key, object value)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Key = key;
|
|
|
|
|
|
this.Value = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|