Files
Main/Assets/Plugins/References/FuncellUpdate/UpdateModel/xml/DataModel.cs
2025-01-25 04:38:09 +08:00

80 lines
2.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace Thousandto.Update.Xml
{
/// <summary>
/// 数据模型,
/// </summary>
public class DataModel
{
//老凡仙用的服务器ip用于返回玩家本地ip
public string ServerIp { get; set; }
public string ServerPort { get; set; }
//LSIP
public string LoginIp { get; set; }
public string LoginPort { get; set; }
//执行端下载地址
public string ClientUrl { get; set; }
//基础资源列表
public List<VersionModel> VersionModelBaseList { get; set; }
//补丁资源列表
public List<VersionModel> VersionModelPatchList { get; set; }
//语言
public string Language { get; set; }
//最新的执行端版本
public string AppVersion { get; set; }
//大版本号
public string BigAppVersion { get; set; }
//小版本号
public string SmallAppVersion { get; set; }
//执行端大小
public string AppSize { get; set; }
//服务器列表,原来的设计,现在不用了
public string ServerList { get; set; }
//最新的补丁版本
public string PatchVersion { get; set; }
//是否使用强制更新默认为true
public bool EnableForceUpdate { get; set; }
//最新版本的补丁
private VersionModel _LastVersionPatch;
public VersionModel LastVersionPatch
{
get
{
if (_LastVersionPatch == null && VersionModelPatchList.Count > 0)
{
_LastVersionPatch = VersionModelPatchList[VersionModelPatchList.Count - 1];
}
return _LastVersionPatch;
}
}
public DataModel()
{
EnableForceUpdate = true;
VersionModelBaseList = new List<VersionModel>();
VersionModelPatchList = new List<VersionModel>();
}
//基础资源按照段号排序,从小到大
public void SortBaseVersion()
{
VersionModelPatchList.Sort(compare);
VersionModelBaseList.Sort(compare);
}
private int compare(VersionModel t1, VersionModel t2)
{
return (t1.ToVersion.CompareTo(t2.ToVersion));
}
}
}