This commit is contained in:
lishuo committed 2022-05-10 19:23:32 +08:00
1 parent 81409dca9e
commit d77ed1bad1
13 files changed
+817 -47

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
using System.Collections.Generic;
namespace OnlineUserPool.Model
{
public class CustomList<T>
{
private List<T> List = new List<T>();
public object lockObj = new object();
public void Add(T o)
{
lock (lockObj)
{
List.Add(o);
}
}
public void Remove(T o)
{
lock (lockObj)
{
List.Remove(o);
}
}
public List<T> ToList()
{
return List;
}
public int Count()
{
return List.Count;
}
}
}
+30
View File
@@ -121,5 +121,35 @@ namespace OnlineUserPool.Model
SetProperty(ref _IsWatch, value);
}
}
private string _Request;
public string Request
{
get { return _Request; }
set
{
SetProperty(ref _Request, value);
}
}
private string _Model;
public string Model
{
get { return _Model; }
set
{
SetProperty(ref _Model, value);
}
}
private int _RoomId;
public int RoomId
{
get { return _RoomId; }
set
{
SetProperty(ref _RoomId, value);
}
}
}
}
+8 -1
View File
@@ -42,13 +42,20 @@ namespace OnlineUserPool.Model
//public bool ShowVirtual { get; set; }
public int FrameRate { get; set; }
public int RoomId { get; set; }
public DateTime? StartTime { get; set; }
public string Request { get; set; }
public string Model { get; set; }
public string ToString(int v)
{
if (v == 2)
{
return $"{ RouteId },{ MemberId },{ string.Join(":", Point) },{ Convert.ToInt32(IsCompleted) },{ Speed },{ PreDistance },{ EndDistance },{ WeightKg },{ Competitionid },{ Convert.ToInt32(Saved)},{ Power} ,{ HeartRate},{ Cadence},{ TotalTicks}";
return $"{ RouteId },{ MemberId },{ string.Join(":", Point) },{ Convert.ToInt32(IsCompleted) },{ Speed },{ PreDistance },{ EndDistance },{ WeightKg },{ Competitionid },{ Convert.ToInt32(Saved)},{ Power} ,{ HeartRate},{ Cadence},{ TotalTicks},{ FrameRate},{RoomId},{StartTime}";
}
return $"{ RouteId },{ MemberId },{ string.Join(":", Point) },{ Convert.ToInt32(IsCompleted) },{ Speed },{ PreDistance },{ EndDistance },{ WeightKg },{ Competitionid },{ Convert.ToInt32(Saved)}";
}
+88
View File
@@ -15,6 +15,94 @@ namespace OnlineUserPool.Model
/// 能处理的消息格式的版本号
/// </summary>
public int V { get; set; }
/// <summary>
/// 子命令类型
/// </summary>
public byte SubType { get; set; }
}
public class SetModelCommand : ReceiveModel
{
public string Model { get; set; }
}
public class QueryGameRoomListCommand : ReceiveModel
{
public string Name { get; set; }
public int UserId { get; set; }
public int PageIndex { get; set; }
public int PageSize { get; set; }
}
public class CreateGameRoomCommand : ReceiveModel
{
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; }
}
public class JoinGameRoomCommand : ReceiveModel
{
public int RoomId { get; set; }
public int UserId { get; set; }
public DateTime JoinAt { get; set; }
}
public class GameRoomReadyCommand : ReceiveModel
{
public int RoomId { get; set; }
public int UserId { get; set; }
public int Status { get; set; }
}
public class GameRoomStartCommand : ReceiveModel
{
public int RoomId { get; set; }
public int UserId { get; set; }
public DateTime StartTime { get; set; }
}
public class GameRoomKickCommand : ReceiveModel
{
public int RoomId { get; set; }
public int UserId { get; set; }//被踢的人
public int OnwerId { get; set; }//房主
}
public class GameRoomProcessCommand : ReceiveModel
{
public int RoomId { get; set; }
public int UserId { get; set; }
public double Process { get; set; }
}
public class SetClientCommand : ReceiveModel
+69
View File
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OnlineUserPool.Model
{
public class RoomModel
{
public int Id { get; set; }
public int RoomId { get; set; }
public string Name { get; set; }
public int UserId { get; set; }//房主
public int Status { get; set; }//房间状态 0 :准备状态 1:开始loading
public DateTime StatusChangedTime { get; set; }
public DateTime CreateTime { get; set; }//创建时间
public DateTime? StartTime { get; set; }//开始时间
public int CloseTime { get; set; }
public int MaxMembers { get; set; }
public int MapRouteId { 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 Password { get; set; }
public string FileName { get; set; }
public string FileUrl { get; set; }
public string AltitudeGraph { get; set; }
public bool Saved { get; set; }
public List<RoomDetailModel> List { get; set; }
public override string ToString()
{
return $"{RoomId},{UserId},{Name},{CloseTime},{MaxMembers},{MapRouteId},{MapRouteName},{Distance},{TotalClimb},{AverageGrade},{Enable3D},{EnableAR},{IsLock},{Password},{FileName},{FileUrl},{AltitudeGraph},{Status},{StartTime}";
}
}
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 bool Saved { get; set; }
public DateTime LastActiveTime { get; set; }
public override string ToString()
{
return $"{RoomId},{UserId},{JoinAt},{Status},{Process},{IsOwner}";
}
}
//附件信息
public class ExtendPropertiesModel
{
//AR骑行的视频帧数
public int FrameRate { get; set; }
public override string ToString()
{
return $"{FrameRate}";
}
}
}
+5 -1
View File
@@ -24,6 +24,10 @@ namespace OnlineUserPool.Model
/// </summary>
public double _Lon = 0d;
public double _Bearing = 0d;
/// <summary>
/// 帧数
/// </summary>
public int? _FrameRate = 0;
public TargetData Clone()
{
@@ -32,7 +36,7 @@ namespace OnlineUserPool.Model
public override string ToString()
{
return string.Format($"Ticks:{Ticks} Power:{_Power} Speed:{_Speed} Distance:{_Distance} Cadence:{_Cadence} HeartRate:{_HeartRate} Lat:{_Lat} Lon:{_Lon}");
return string.Format($"Ticks:{Ticks} Power:{_Power} Speed:{_Speed} Distance:{_Distance} Cadence:{_Cadence} HeartRate:{_HeartRate} Lat:{_Lat} Lon:{_Lon} FrameRate:{_FrameRate}");
}
public string Write()