增加模拟用户功能

This commit is contained in:
suntao committed 2021-06-24 09:20:01 +08:00
1 parent 0e931a3ac9
commit b9bb485a2d
7 files changed
+107 -28

No files matched your search

+18 -5
View File
@@ -12,11 +12,12 @@ namespace OnlineUserPool.Hander
{
public class MultiUserHandle : IHandle
{
private int _index = -1;
private int _index = 0; //3600*3;
private MultiUserModel model;
private TurfHelper _turfHelper;
private int _routeId = 4297; //1660;
private int _size = 200;
private int _routeId = 1255; //5593; //1660;
private int _size = 50;
private int _competitionid = 0;//35;
public MultiUserHandle()
{
Init();
@@ -24,11 +25,23 @@ namespace OnlineUserPool.Hander
public async void Init()
{
#region 环台湾
//_routeId = 5593;
//_competitionid = 35;
//_index = 3600 * 3;
#endregion
#region sis
//_routeId = 5710;
//_competitionid = 37;
#endregion
model = await BaseApi.GetAsync<MultiUserModel>($"/Map/sss?routeId={ _routeId }&size={ _size }");
double i = 0;
foreach (var item in model.users)
{
i += 0.0005;
i += 0.0002;
item.Distance = i;
}
_turfHelper = new TurfHelper(model.route.List.Select(d => d.Point));
@@ -68,7 +81,7 @@ namespace OnlineUserPool.Hander
Speed = item.Speed,
WeightKg = 0,
PreDistance = preDistance,
Competitionid = 30
Competitionid = _competitionid
};
msgModels.Add(info);
}