초기 커밋.
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
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 오브젝트테이블;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user