You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.0 KiB
112 lines
3.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
namespace Realmlist
|
|
{
|
|
public class GameGateInfo
|
|
{
|
|
public int index;
|
|
public string url; //连接地址
|
|
public uint gatesvrId; //连接地址
|
|
public int online;//在线,就是网络连接
|
|
}
|
|
|
|
public class RealmInfo
|
|
{
|
|
public int realmId;
|
|
public int worldId;
|
|
public int logicWorldId;
|
|
public string ip;
|
|
|
|
public RealmConfigOne config;
|
|
|
|
// 运行时的状态
|
|
public uint runtimeState;
|
|
|
|
// 开服时间的unix time, 程序自动换算, 已包含timezone
|
|
public long openTimeSec;
|
|
public long visibleTimeSec;
|
|
|
|
//public int online;
|
|
}
|
|
|
|
// 根据对外可见时间分组
|
|
public class RealmGroup
|
|
{
|
|
public long visibleTime;
|
|
public List<RealmInfo> realmList = new List<RealmInfo>();
|
|
|
|
//public int minOnline;
|
|
//public int minRealmId;
|
|
public RealmInfo minOnline;
|
|
|
|
public RealmInfo maxOnline;
|
|
|
|
//public int maxOnline;
|
|
//public int maxRealmId;
|
|
|
|
public int avgOnline;
|
|
public int groupOnline;
|
|
|
|
// 最少在线人数跟平均在线人数的差值
|
|
public int avgOnlineDiff;
|
|
|
|
// 顺序推荐的idx
|
|
public int orderIdxForNewUser;
|
|
public int orderIdxForOldUser;
|
|
}
|
|
|
|
// 客户端用来分页显示
|
|
public class RealmPage
|
|
{
|
|
public int page;
|
|
public List<RealmInfo> realms;
|
|
}
|
|
|
|
public class WorldInfo
|
|
{
|
|
public string areaName;
|
|
public int worldId;
|
|
public List<GameGateInfo> gameGates = new List<GameGateInfo>();
|
|
public List<GameGateInfo> chatGates = new List<GameGateInfo>();
|
|
|
|
public SortedList<int, RealmInfo> worldRealms = new SortedList<int, RealmInfo>();
|
|
}
|
|
|
|
class RealmGroupComparer : IComparer<long>
|
|
{
|
|
public int Compare(long x, long y)
|
|
{
|
|
return y.CompareTo(x);
|
|
}
|
|
}
|
|
|
|
public class AreaRealm
|
|
{
|
|
public string areaName;
|
|
public int timezone;
|
|
|
|
public string visibleOnlyCliVersion;
|
|
public int visibleOnlyWhiteList;
|
|
|
|
public bool maintenanceMode;
|
|
|
|
//共享显示的Area
|
|
public string shareShowAreaRealmList;
|
|
public AreaRealm shareShowAreaRealm;
|
|
|
|
public string invisibleAreaForNewUser;
|
|
public List<AreaRealm> invisibleAreaForNewUserList = new List<AreaRealm>();
|
|
|
|
// worldId -> gate list
|
|
public Dictionary<int, WorldInfo> areaWorldDict = new Dictionary<int, WorldInfo>();
|
|
|
|
// 开服时间 -> realmGroup, 根据当前时间查询对应的服务器信息
|
|
public SortedList<long, RealmGroup> visibleRealmGroup = new SortedList<long, RealmGroup>(new RealmGroupComparer());
|
|
|
|
// realmId -> realmInfo, 根据realmId查询realmInfo
|
|
public Dictionary<int, int> realmIndex = new Dictionary<int, int>();
|
|
public List<RealmInfo> sortedRealms = new List<RealmInfo>();
|
|
}
|
|
}
|
|
|