2021-01-18 20:24:19 +08:00
|
|
|
|
using OnlineUserPool.Services;
|
|
|
|
|
|
using Prism.Mvvm;
|
2020-10-13 08:54:24 +08:00
|
|
|
|
using System;
|
2020-09-17 10:23:26 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Net;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace OnlineUserPool.Model
|
|
|
|
|
|
{
|
2020-10-13 08:54:24 +08:00
|
|
|
|
public class HostModel : BindableBase
|
2020-09-17 10:23:26 +08:00
|
|
|
|
{
|
|
|
|
|
|
public IPEndPoint IPEndPoint { get; set; }
|
|
|
|
|
|
|
2020-10-13 08:54:24 +08:00
|
|
|
|
private DateTime _LastActiveTime;
|
|
|
|
|
|
public DateTime LastActiveTime {
|
|
|
|
|
|
get {
|
|
|
|
|
|
return _LastActiveTime;
|
|
|
|
|
|
}
|
|
|
|
|
|
set {
|
|
|
|
|
|
SetProperty(ref _LastActiveTime, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-07-07 09:49:36 +08:00
|
|
|
|
private int _RouteId = 0;
|
2020-09-17 10:23:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 地图编号
|
|
|
|
|
|
/// </summary>
|
2021-07-07 09:49:36 +08:00
|
|
|
|
public int RouteId {
|
|
|
|
|
|
get {
|
|
|
|
|
|
return _RouteId;
|
|
|
|
|
|
}
|
|
|
|
|
|
set {
|
|
|
|
|
|
SetProperty(ref _RouteId, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int _MemberId;
|
2020-09-17 10:23:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用户Id
|
|
|
|
|
|
/// </summary>
|
2021-07-07 09:49:36 +08:00
|
|
|
|
public int MemberId {
|
|
|
|
|
|
get {
|
|
|
|
|
|
return _MemberId;
|
|
|
|
|
|
}
|
|
|
|
|
|
set {
|
|
|
|
|
|
SetProperty(ref _MemberId, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-09-17 10:23:26 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 客户端过期
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool Expire
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2020-10-27 10:20:47 +08:00
|
|
|
|
return DateTime.Now.Subtract(LastActiveTime).TotalSeconds > 60;
|
2020-09-17 10:23:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Equals(IPEndPoint obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
//return base.Equals(obj);
|
|
|
|
|
|
|
|
|
|
|
|
return obj.Address.ToString() == IPEndPoint.Address.ToString() && obj.Port == IPEndPoint.Port;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 需要展示的路书Id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public List<int> ShowRouteId { get; set; }
|
|
|
|
|
|
|
2021-07-07 09:49:36 +08:00
|
|
|
|
private int _Competitionid = 0;
|
|
|
|
|
|
public int Competitionid {
|
|
|
|
|
|
get {
|
|
|
|
|
|
return _Competitionid;
|
|
|
|
|
|
} set {
|
|
|
|
|
|
SetProperty(ref _Competitionid, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-01-18 20:24:19 +08:00
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 是否展示在线的人
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//public bool ShowVirtual { get; set; }
|
|
|
|
|
|
|
2021-07-07 09:49:36 +08:00
|
|
|
|
public string Encoding { get; set; }
|
|
|
|
|
|
public string Client { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
private int _V = 0;
|
2020-09-17 10:23:26 +08:00
|
|
|
|
/// <summary>
|
2021-01-18 20:24:19 +08:00
|
|
|
|
/// 客户端支持的消息格式的版本号
|
2020-09-17 10:23:26 +08:00
|
|
|
|
/// </summary>
|
2021-07-07 09:49:36 +08:00
|
|
|
|
public int V {
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _V;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
SetProperty(ref _V, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-01-18 20:24:19 +08:00
|
|
|
|
|
|
|
|
|
|
[Newtonsoft.Json.JsonIgnore]
|
|
|
|
|
|
public IService Service { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String ServiceName
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Service.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-07-07 09:49:36 +08:00
|
|
|
|
|
|
|
|
|
|
private bool _IsWatch;
|
|
|
|
|
|
public bool IsWatch
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _IsWatch; }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
SetProperty(ref _IsWatch, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-09-17 10:23:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|