Files
lol_coder/lck_cl_data_solution/LolDataRequestLib/ResponseData/있는데이터/오브젝트킬전체.cs
2026-04-01 20:20:09 +09:00

145 lines
5.0 KiB
C#

using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
class : IResponseData
{
internal (bool recvIsPostGameData)
{
this.isPostGame = recvIsPostGameData;
}
bool isPostGame = false;
public DataTable ()
{
DataTable = new DataTable("오브젝트리스트");
.Columns.Add("오브젝트타입");
.Columns.Add("드래곤종류");
.Columns.Add("잡은팀");
.Columns.Add("킬시간");
.Columns.Add("킬분");
.Columns.Add("킬초");
//오브젝트테이블.Columns.Add("리젠분");
//오브젝트테이블.Columns.Add("리젠초");
if (DataManager.getInstance(). != null)
{
BsonDocument dd = DataManager.getInstance()..DeepClone().AsBsonDocument;
dd.Remove("sequenceIndex");
List<BsonElement> = dd.ToList().OrderBy(e => e.Value.AsBsonDocument["gameTime"].ToInt32()).ToList();
bool is크로노 = false;
int Index크로노 = 0;
int nowSequenceIndex = 0;
//크로노브레이크를 대비해야 sequenceIndex 가 역변하는 순간이 존재하는지 확인하는 절차
for (int i = 0; i < .Count(); i++)
{
BsonValue item = [i].ToBsonDocument().AsBsonValue;
int sequenceIndex = item["Value"]["sequenceIndex"].ToInt32();
if (sequenceIndex > nowSequenceIndex) nowSequenceIndex = sequenceIndex;
else
{
is크로노 = true;
nowSequenceIndex = sequenceIndex;
Index크로노 = i;
break;
}
}
for (int i = 0; i < .Count(); i++)
{
BsonValue item = [i].ToBsonDocument().AsBsonValue;
int sequenceIndex = item["Value"]["sequenceIndex"].ToInt32();
DataRow bufRow = .NewRow();
if (is크로노)
{
if (sequenceIndex >= nowSequenceIndex)
{
if (i < Index크로노)
{
continue;
}
}
}
if (item["Value"]["killerTeamID"].ToInt32() == 300)
{
continue;
}
bufRow["잡은팀"] = (DBDefine.)item["Value"]["killerTeamID"].ToInt32();
bufRow["오브젝트타입"] = item["Value"]["monsterType"].ToString();
int = item["Value"]["gameTime"].ToInt32();
int = / 1000 / 60;
int = / 1000 - ( * 60);
bufRow["킬시간"] = ;
bufRow["킬분"] = ;
bufRow["킬초"] = ;
if (item["Value"]["monsterType"].AsString == "dragon")
{
//20210615 용이 상단에 딜레이보다 미리 들어가는 현상이 보여서 처리
if ( > DataManager.getInstance(). * 1000 && !isPostGame)
{
continue;
}
bufRow["드래곤종류"] = item["Value"]["dragonType"];
}
.Rows.Add(bufRow);
}
}
if (.Rows.Count > 0)
{
DataTable = .AsEnumerable().OrderBy(r => Convert.ToInt32(r.Field<string>("킬시간"))).CopyToDataTable();
.TableName = DBDefine...ToString();
return ;
}
else
{
.TableName = DBDefine...ToString();
return ;
}
}
}
}