초기 커밋.

This commit is contained in:
2026-04-01 20:20:09 +09:00
parent c286f362e5
commit fd1a2cba32
172 changed files with 43588 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
internal class : AResponseData
{
protected override DataTable buildDataForResponse(BsonDocument recvDocument)
{
BsonValue bufGameEndData = null;
if (recvDocument != null)
{
bufGameEndData = recvDocument["eventDocument"];
}
DataTable gameEndData = new DataTable();
try
{
gameEndData.TableName = DBDefine...ToString();
gameEndData.Columns.Add("승리팀");
gameEndData.Columns.Add("경기시간");
DataRow bufRow = gameEndData.NewRow();
bufRow["승리팀"] = (DBDefine.)bufGameEndData["winningTeam"].ToInt32();
bufRow["경기시간"] = bufGameEndData["gameTime"].ToInt32() / 1000;
gameEndData.Rows.Add(bufRow);
}
catch(Exception ex) { }
return gameEndData;
}
protected override BsonDocument getDataFromMongo()
{
//var filter = Builders<BsonDocument>.Filter.Eq("RequestGameID", DataManager.getInstance().mPlatformGameID);
var projection = Builders<BsonDocument>.Projection
.Exclude("_id")
.Include("eventDocument");
List<BsonDocument> documents = mEventDataBase.GetCollection<BsonDocument>("game_end")
.Find(new BsonDocument()) //.Find(filter)
.SortByDescending(x => x["sequenceIndex"])
.Project(projection)
.Limit(1)
.ToList();
return documents.Last();
}
}
}

View File

@@ -0,0 +1,155 @@
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
internal class : AResponseData
{
protected override DataTable buildDataForResponse(BsonDocument recvDocument)
{
List<BsonElement> bufPlayerDataList = null;
if (recvDocument != null)
{
bufPlayerDataList = recvDocument.Elements.ToList();
}
DataTable goldData = new DataTable();
goldData.TableName = DBDefine...ToString();
goldData.Columns.Add("블루팀골드량");
goldData.Columns.Add("레드팀골드량");
goldData.Columns.Add("골드차");
goldData.Columns.Add("골드차블루최대");
goldData.Columns.Add("골드차레드최대");
goldData.Columns.Add("초");
int = 0;
int = 0;
foreach (BsonElement item in bufPlayerDataList)
{
DataRow bufRow = goldData.NewRow();
BsonArray itemValue = item.Value.ToBsonDocument()["teams"].AsBsonArray;
int = 0;
int = 0;
foreach (BsonValue itemTeam in itemValue)
{
if (itemTeam["teamID"].ToInt32() == (int)DBDefine..)
{
= itemTeam["totalGold"].ToInt32();
}
else
{
= itemTeam["totalGold"].ToInt32();
}
}
bufRow["블루팀골드량"] = ;
bufRow["레드팀골드량"] = ;
bufRow["골드차"] = - ;
if ( < ( - ))
{
= ( - );
}
if ( < ( - ))
{
= ( - );
}
bufRow["골드차블루최대"] = ;
bufRow["골드차레드최대"] = * -1;
bufRow["초"] = item.Value["gameTime"].ToInt32() / 1000;
goldData.Rows.Add(bufRow);
}
return goldData;
}
protected override BsonDocument getDataFromMongo()
{
// 필요한 필드만 포함하는 필터 문서를 생성합니다.
var subFilter = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>("{'eventDocument.playbackID' : 1, 'eventDocument.teams.totalGold' : 1, 'eventDocument.teams.teamID' : 1, 'eventDocument.sequenceIndex' : 1, " +
"'eventDocument.gameTime' : 1, 'eventDocument.parentGameID': 1, 'eventDocument.repeater_timestamp': 1}");
//var subFilter = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>("{'eventDocument.playbackID' : 1, 'eventDocument.teams.totalGold' : 1, 'eventDocument.teams.teamID' : 1,'eventDocument.sequenceIndex' : 1, 'eventDocument.gameTime' : 1}");
// MongoDB 컬렉션 "stats_update"에서 전체 문서를 가져오고 필요한 필드만 Projection합니다.
List<BsonDocument> documents = mEventDataBase.GetCollection<BsonDocument>("stats_update")
.Find(new BsonDocument())
.Project(subFilter)
.ToList();
//documents = documents.OrderBy(r => r["eventDocument"]["sequenceIndex"].ToInt32()).ToList();
documents = documents.OrderBy(r => DateTime.Parse(r["eventDocument"]["repeater_timestamp"].AsString)).ToList();
BsonDocument rtnValue = new BsonDocument();
// 이전 이벤트의 RequestGameID를 저장할 변수입니다.
string previousRequestGameID = null;
foreach (BsonDocument item in documents)
{
try
{
// 현재 이벤트의 RequestGameID 값을 추출합니다.
string currentRequestGameID = item["eventDocument"]["parentGameID"].ToString();
// 롤백 상황 감지:
// 이전 이벤트의 RequestGameID가 존재하고, 현재 이벤트의 값과 다르다면
// 이는 롤백 후 새로운 게임 데이터가 들어왔음을 의미합니다.
if (previousRequestGameID != null && !currentRequestGameID.Equals(previousRequestGameID))
{
// 현재 이벤트의 gameTime을 롤백 기준으로 설정합니다.
int rollbackThreshold = item["eventDocument"]["gameTime"].ToInt32();
// 지금까지 모아둔 데이터(rtnValue) 중 gameTime이 rollbackThreshold 미만인 이벤트만 유지합니다.
List<BsonElement> filteredElements = rtnValue.ToList()
.Where(d => d.Value["gameTime"].ToInt32() < rollbackThreshold)
.ToList();
rtnValue = new BsonDocument(filteredElements);
}
// 현재 이벤트 정보를 새 BsonDocument로 준비합니다.
BsonDocument bufDocument = new BsonDocument();
bufDocument.Add("gameTime", item["eventDocument"]["gameTime"].ToInt32());
bufDocument.Add("teams", item["eventDocument"]["teams"].AsBsonArray);
bufDocument.Add("playback", item["eventDocument"]["playbackID"].ToString());
bufDocument.Add("parentGameID", item["eventDocument"]["parentGameID"]);
// sequenceIndex 값을 Key로 하여 해당 이벤트를 rtnValue에 추가합니다.
rtnValue.Add(item["eventDocument"]["sequenceIndex"].ToString(), bufDocument);
// 다음 반복을 위해 이전 RequestGameID를 업데이트합니다.
previousRequestGameID = currentRequestGameID;
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
return rtnValue;
}
}
}

View File

@@ -0,0 +1,133 @@
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
internal class : AResponseData
{
protected override DataTable buildDataForResponse(BsonDocument recvDocument)
{
BsonArray bufPlayerDataList = null;
DataTable = new DataTable();
.TableName = DBDefine...ToString();
.Columns.Add("팀");
.Columns.Add("선수이름");
.Columns.Add("챔피언이름");
.Columns.Add("메인룬스타일");
.Columns.Add("메인룬이름");
.Columns.Add("서브룬스타일");
.Columns.Add("서브룬이름");
.Columns.Add("룬1");
.Columns.Add("룬2");
.Columns.Add("룬3");
.Columns.Add("룬4");
.Columns.Add("룬5");
.Columns.Add("룬6");
.Columns.Add("룬7");
.Columns.Add("룬8");
.Columns.Add("룬9");
.Columns.Add("룬10");
.Columns.Add("룬배열");
if (recvDocument == null)
{
return ;
}
bufPlayerDataList = recvDocument["eventDocument"]["participants"].AsBsonArray;
foreach (BsonValue item in bufPlayerDataList)
{
DataRow bufRow = .NewRow();
bufRow["팀"] = (DBDefine.)item["teamID"].ToInt32();
bufRow["선수이름"] = item["summonerName"].ToString();
bufRow["챔피언이름"] = item["championName"].ToString();
if (!item.AsBsonDocument.Contains("perks"))
{
continue;
}
int = item["perks"][0]["perkStyle"].ToInt32();
bufRow["메인룬스타일"] = ;
if (DataManager.getInstance().mRuneTable.ContainsKey())
{
bufRow["메인룬이름"] = DataManager.getInstance().mRuneTable[];
}
int = item["perks"][0]["perkSubStyle"].ToInt32();
bufRow["서브룬스타일"] = ;
if (DataManager.getInstance().mRuneTable.ContainsKey())
{
bufRow["서브룬이름"] = DataManager.getInstance().mRuneTable[];
}
bufRow["룬배열"] = item["perks"][0]["perkIds"].ToString();
BsonArray runeArray = item["perks"][0]["perkIds"].AsBsonArray;
if (runeArray.Count != 0)
{
for (int i = 1; i < runeArray.Count + 1; i++)
{
int runeID = runeArray[i - 1].ToInt32();
if (DataManager.getInstance().mRuneTable.ContainsKey(runeID))
{
bufRow["룬" + i] = DataManager.getInstance().mRuneTable[runeID];
}
}
}
.Rows.Add(bufRow);
}
return ;
}
protected override BsonDocument getDataFromMongo()
{
//var filter = Builders<BsonDocument>.Filter.Eq("RequestGameID", DataManager.getInstance().mPlatformGameID);
var projection = Builders<BsonDocument>.Projection
.Exclude("_id")
.Include("eventDocument");
List<BsonDocument> documents = mEventDataBase.GetCollection<BsonDocument>("game_info")
.Find(new BsonDocument()) //.Find(filter)
.SortByDescending(x => x["sequenceIndex"])
.Project(projection)
.Limit(1)
.ToList();
if (documents.Count == 0)
{
return null;
}
return documents.Last();
}
}
}

View File

@@ -0,0 +1,400 @@
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
internal class : AResponseData
{
private int nullToZero(string value)
{
try
{
return Convert.ToInt32(value);
}
catch(Exception e)
{
return 0;
}
}
private double nullToZeroD(string value)
{
try
{
return Convert.ToDouble(value);
}
catch (Exception e)
{
return 0;
}
}
protected override DataTable buildDataForResponse(BsonDocument recvDocument)
{
DataTable = new DataTable();
.TableName = DBDefine...ToString();
//선수관련
.Columns.Add("게임시간");
.Columns.Add("누적된분");
.Columns.Add("팀구분");
.Columns.Add("선수아이디");
.Columns.Add("챔피언");
//KDA
.Columns.Add("킬");
.Columns.Add("데스");
.Columns.Add("어시스트");
//데미지관련
.Columns.Add("가한데미지");
.Columns.Add("받은데미지");
.Columns.Add("팀원에게준힐량");
.Columns.Add("팀원의데미지를막아낸실드량");
//분당데미지관련
.Columns.Add("분당가한데미지");
.Columns.Add("분당받은데미지");
.Columns.Add("분당팀원에게준힐량");
.Columns.Add("분당팀원의데미지를막아낸실드량");
///스코어관련
.Columns.Add("크립스코어");
.Columns.Add("경험치");
.Columns.Add("분당크립스코어");
.Columns.Add("비전스코어");
.Columns.Add("설치한와드수");
.Columns.Add("부순와드수");
.Columns.Add("골드획득량");
.Columns.Add("분당골드획득량");
//CC
.Columns.Add("군중제어점수");
.Columns.Add("다른챔피언에CC기를건시간");
//추가
.Columns.Add("킬관여율");
.Columns.Add("골드당데미지");
.Columns.Add("팀내데미지비중");
//2022 데이터 추가 중립크립스코어
.Columns.Add("라인크립스코어");
.Columns.Add("정글크립스코어");
//2022 데이터 추가 현상금
.Columns.Add("현재현상금");
if (m팟지데이터들.Count == 0 || m팀데이터들.Count == 0)
{
return ;
}
Dictionary<int, int> _킬_수 = new Dictionary<int, int>();
Dictionary<int, int> _킬_수 = new Dictionary<int, int>();
foreach (BsonDocument item in m팀데이터들)
{
BsonArray bufTeamArray = item.Values.Last().AsBsonArray;
foreach (BsonValue itemTeam in bufTeamArray)
{
if (itemTeam["teamID"].ToInt32() == (int)DBDefine..)
{
_킬_수.Add(Convert.ToInt32(item.Names.Last()), nullToZero(itemTeam["championsKills"].ToString()));
}
else
{
_킬_수.Add(Convert.ToInt32(item.Names.Last()), nullToZero(itemTeam["championsKills"].ToString()));
}
}
}
Dictionary<int, double> _데미지_합 = new Dictionary<int, double>();
Dictionary<int, double> _데미지_합 = new Dictionary<int, double>();
foreach (BsonDocument item in m팟지데이터들)
{
int gameTime = Convert.ToInt32(item.Names.Last());
double gameTimeMin = Convert.ToDouble(gameTime) / 60.0;
BsonArray bufPlayersData = item.Values.Last().AsBsonArray;
foreach (var itemPlayer in bufPlayersData)
{
DataRow bufRow = .NewRow();
bufRow["게임시간"] = gameTime;
bufRow["누적된분"] = gameTimeMin;
bufRow["팀구분"] = (DBDefine.)itemPlayer["teamID"].ToInt32();
bufRow["선수아이디"] = itemPlayer["playerName"].ToString();
bufRow["챔피언"] = itemPlayer["championName"].ToString();
//스텟이 아닌 선수정보에 있는 것들
bufRow["경험치"] = itemPlayer["XP"].ToInt32();
bufRow["골드획득량"] = itemPlayer["totalGold"].ToInt32();
bufRow["분당골드획득량"] = itemPlayer["totalGold"].ToDouble() / (gameTimeMin);
bufRow["현재현상금"] = itemPlayer["shutdownValue"].ToInt32();
BsonArray bufStats = itemPlayer["stats"].AsBsonArray;
foreach (BsonValue itemStats in bufStats)
{
switch (itemStats["name"].ToString())
{
case "CHAMPIONS_KILLED":
try { bufRow["킬"] = itemStats["value"].ToString(); }
catch (Exception ex) { bufRow["킬"] = "0"; }
break;
case "NUM_DEATHS":
try { bufRow["데스"] = itemStats["value"].ToString(); }
catch (Exception ex) { bufRow["데스"] = "0"; }
break;
case "ASSISTS":
try { bufRow["어시스트"] = itemStats["value"].ToString(); }
catch (Exception ex) { bufRow["어시스트"] = "0"; }
break;
//데미지관련
case "TOTAL_DAMAGE_DEALT_TO_CHAMPIONS":
bufRow["가한데미지"] = itemStats["value"].ToInt32();
bufRow["분당가한데미지"] = itemStats["value"].ToDouble() / (gameTimeMin);
bufRow["골드당데미지"] = itemStats["value"].ToDouble() / itemPlayer["totalGold"].ToDouble();
if ((DBDefine.)itemPlayer["teamID"].ToInt32() == DBDefine..)
{
if (!_데미지_합.ContainsKey(Convert.ToInt32(bufRow["게임시간"])))
{
_데미지_합.Add(Convert.ToInt32(bufRow["게임시간"]), itemStats["value"].ToInt32());
}
else
{
_데미지_합[Convert.ToInt32(bufRow["게임시간"])] += itemStats["value"].ToInt32();
}
}
else
{
if (!_데미지_합.ContainsKey(Convert.ToInt32(bufRow["게임시간"])))
{
_데미지_합.Add(Convert.ToInt32(bufRow["게임시간"]), itemStats["value"].ToInt32());
}
else
{
_데미지_합[Convert.ToInt32(bufRow["게임시간"])] += itemStats["value"].ToInt32();
}
}
break;
case "TOTAL_DAMAGE_TAKEN":
bufRow["받은데미지"] = itemStats["value"].ToInt32();
bufRow["분당받은데미지"] = itemStats["value"].ToDouble() / (gameTimeMin);
break;
case "TOTAL_HEAL_ON_TEAMMATES":
bufRow["팀원에게준힐량"] = itemStats["value"].ToInt32();
bufRow["분당팀원에게준힐량"] = itemStats["value"].ToDouble() / (gameTimeMin);
break;
case "TOTAL_DAMAGE_SHIELDED_ON_TEAMMATES":
bufRow["팀원의데미지를막아낸실드량"] = itemStats["value"].ToInt32();
bufRow["분당팀원의데미지를막아낸실드량"] = itemStats["value"].ToDouble() / (gameTimeMin);
break;
///스코어관련
case "MINIONS_KILLED":
bufRow["라인크립스코어"] = nullToZero(itemStats["value"].ToString());
//bufRow["분당크립스코어수급량"] = itemStats["value"].ToDouble()/(gameTimeMin);
break;
case "NEUTRAL_MINIONS_KILLED":
bufRow["정글크립스코어"] = itemStats["value"].ToInt32();
break;
case "VISION_SCORE":
bufRow["비전스코어"] = itemStats["value"].ToInt32();
break;
case "WARD_PLACED":
bufRow["설치한와드수"] = itemStats["value"].ToString();
break;
case "WARD_KILLED":
bufRow["부순와드수"] = itemStats["value"].ToString();
break;
case "TOTAL_TIME_CROWD_CONTROL_DEALT":
bufRow["군중제어점수"] = itemStats["value"].ToString();
break;
case "TIME_CCING_OTHERS":
bufRow["다른챔피언에CC기를건시간"] = itemStats["value"].ToString();
break;
}
}
//bufRow["크립스코어"] = Convert.ToInt32(bufRow["라인크립스코어"]) + Convert.ToInt32(bufRow["정글크립스코어"]);
//bufRow["분당크립스코어"] = Convert.ToDouble(bufRow["크립스코어"]) / (gameTimeMin);
bufRow["크립스코어"] = nullToZero(bufRow["라인크립스코어"].ToString()) + nullToZero(bufRow["정글크립스코어"].ToString());
bufRow["분당크립스코어"] = nullToZeroD(bufRow["크립스코어"].ToString()) / (gameTimeMin);
.Rows.Add(bufRow);
}
}
foreach (DataRow bufRow in .Rows)
{
if (bufRow["팀구분"].ToString() == "블루")
{
try
{
bufRow["팀내데미지비중"] = Convert.ToDouble(bufRow["가한데미지"]) / _데미지_합[Convert.ToInt32(bufRow["게임시간"])] * 100.0;
}
catch(Exception ex)
{
bufRow["팀내데미지비중"] = "Err";
}
try
{
bufRow["킬관여율"] = (nullToZeroD(bufRow["킬"].ToString()) + nullToZeroD(bufRow["어시스트"].ToString())) / _킬_수[Convert.ToInt32(bufRow["게임시간"])] * 100.0;
}
catch(Exception ex)
{
bufRow["킬관여율"] = "Err";
}
}
else
{
try
{
bufRow["팀내데미지비중"] = Convert.ToDouble(bufRow["가한데미지"]) / _데미지_합[Convert.ToInt32(bufRow["게임시간"])] * 100.0;
}
catch(Exception ex)
{
bufRow["팀내데미지비중"] = "Err";
}
try
{
bufRow["킬관여율"] = (nullToZeroD(bufRow["킬"].ToString()) + nullToZeroD(bufRow["어시스트"].ToString())) / _킬_수[Convert.ToInt32(bufRow["게임시간"])] * 100.0;
}
catch(Exception ex)
{
bufRow["킬관여율"] = "Err";
}
}
}
.Columns.Remove("게임시간");
return ;
}
List<BsonDocument> m팟지데이터들 = new List<BsonDocument>();
List<BsonDocument> m팀데이터들 = new List<BsonDocument>();
protected override BsonDocument getDataFromMongo()
{
//팟지데이터는 5분단위로 누적.
//ex ~5 ~10 ~15 ~20 ~25 ~30... 마지막데이터는 0
//맨 처음 전체데이터로 경기시간을 구한다음 시간으로 나눈다?
if (DataManager.getInstance(). == null)
{
return null;
}
int = DataManager.getInstance().["gameTime"].ToInt32() / 1000;
int = 0;
m팟지데이터들 = new List<BsonDocument>();
m팀데이터들 = new List<BsonDocument>();
while ( - > 0)
{
+= 5 * 60;
BsonDocument rtnValue = new BsonDocument();
//var subfilter1 = Builders<BsonDocument>.Filter.Eq("RequestGameID", DataManager.getInstance().mPlatformGameID);
var subFilter2 = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>("{'eventDocument.gameTime' : {$lt : " + * 1000 + " }}");
var filter1 = Builders<BsonDocument>.Filter.And(subFilter2); //var filter1 = Builders<BsonDocument>.Filter.And(subfilter1, subFilter2);
var projectionFilter = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>("{'eventDocument.participants' : 1, 'eventDocument.teams' : 1}");
List<BsonDocument> documents = mEventDataBase.GetCollection<BsonDocument>("stats_update")
.Find(filter1)
.SortByDescending(x => x["sequenceIndex"])
.Limit(1)
.ToList();
///경기의 마지막정보는 경기시간으로 리턴.
if ( > )
{
rtnValue.Add(.ToString(), documents.Last()["eventDocument"]["participants"].AsBsonArray);
}
else
{
rtnValue.Add(.ToString(), documents.Last()["eventDocument"]["participants"].AsBsonArray);
}
m팟지데이터들.Add(rtnValue);
rtnValue = new BsonDocument();
if ( > )
{
rtnValue.Add(.ToString(), documents.Last()["eventDocument"]["teams"].AsBsonArray);
}
else
{
rtnValue.Add(.ToString(), documents.Last()["eventDocument"]["teams"].AsBsonArray);
}
m팀데이터들.Add(rtnValue);
}
//구조를 위해 리턴은 하지만 이 상속클래스는 BsonDocument를 멤버변수 kv페어로 관리한다.
return new BsonDocument();
}
}
}

View File

@@ -0,0 +1,145 @@
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LolDataRequestLib.ResponseData
{
internal class : AResponseData
{
int = 0;
int = 0;
internal (int , int )
{
= ;
= ;
}
protected override DataTable buildDataForResponse(BsonDocument recvDocument)
{
DataTable = new DataTable();
.TableName = DBDefine...ToString();
//선수관련
.Columns.Add("팀구분");
.Columns.Add("선수아이디");
.Columns.Add("챔피언");
//데미지관련
.Columns.Add("데미지차이");
.Columns.Add("시작데미지량");
.Columns.Add("종료데미지량");
.Columns.Add("딜량백분율");
if (m시작데이터.Count() == 0 || m종료데이터.Count() == 0)
{
return ;
}
BsonArray = m시작데이터["participants"].AsBsonArray;
foreach (BsonDocument itemPlayer in )
{
DataRow bufRow = .NewRow();
bufRow["팀구분"] = (DBDefine.)itemPlayer["teamID"].ToInt32();
bufRow["선수아이디"] = itemPlayer["playerName"].ToString();
bufRow["챔피언"] = itemPlayer["championName"].ToString();
bufRow["시작데미지량"] = itemPlayer["stats"].AsBsonArray.ToList().Where(v => v["name"] == "TOTAL_DAMAGE_DEALT_TO_CHAMPIONS").ToList()[0]["value"];
.Rows.Add(bufRow);
}
BsonArray = m종료데이터["participants"].AsBsonArray;
foreach (BsonDocument itemPlayer in )
{
DataRow bufPlayerRow = .AsEnumerable().Where(r => r.Field<String>("선수아이디") == itemPlayer["playerName"].ToString()).Last();
bufPlayerRow["종료데미지량"] = itemPlayer["stats"].AsBsonArray.ToList().Where(v => v["name"] == "TOTAL_DAMAGE_DEALT_TO_CHAMPIONS").ToList()[0]["value"];
bufPlayerRow["데미지차이"] = Convert.ToDouble(bufPlayerRow["종료데미지량"]) - Convert.ToDouble(bufPlayerRow["시작데미지량"]);
}
double = Convert.ToDouble(.AsEnumerable().OrderByDescending(r => Convert.ToDouble(r.Field<string>("데미지차이"))).First()["데미지차이"]);
foreach (DataRow item in .Rows)
{
double = Convert.ToDouble(item["데미지차이"]);
if ( != 0)
{
item["딜량백분율"] = / * 100.0;
}
else
{
item["딜량백분율"] = 0.0;
}
}
return ;
}
BsonDocument m시작데이터 = new BsonDocument();
BsonDocument m종료데이터 = new BsonDocument();
protected override BsonDocument getDataFromMongo()
{
//var subfilter1 = Builders<BsonDocument>.Filter.Eq("RequestGameID", DataManager.getInstance().mPlatformGameID);
var subFilter2 = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>("{'eventDocument.gameTime' : {$lt : " + * 1000 + " }}");
var filter1 = Builders<BsonDocument>.Filter.And(subFilter2); //var filter1 = Builders<BsonDocument>.Filter.And(subfilter1, subFilter2);
var projectionFilter = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>("{'eventDocument.participants' : 1 , 'eventDocument.gameTime' : 1 }");
List<BsonDocument> documents = mEventDataBase.GetCollection<BsonDocument>("stats_update")
.Find(filter1)
.Project(projectionFilter)
.SortByDescending(x => x["sequenceIndex"])
.Limit(1)
.ToList();
m시작데이터 = documents.Last()["eventDocument"].AsBsonDocument;
subFilter2 = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>("{'eventDocument.gameTime' : {$lt : " + * 1000 + " }}");
filter1 = Builders<BsonDocument>.Filter.And(subFilter2); //filter1 = Builders<BsonDocument>.Filter.And(subfilter1, subFilter2);
List<BsonDocument> documents2 = mEventDataBase.GetCollection<BsonDocument>("stats_update")
.Find(filter1)
.SortByDescending(x => x["sequenceIndex"])
.Project(projectionFilter)
.Limit(1)
.ToList();
m종료데이터 = documents2.Last()["eventDocument"].AsBsonDocument;
//구조를 위해 리턴은 하지만 이 상속클래스는 BsonDocument를 멤버변수 kv페어로 관리한다.
return new BsonDocument();
}
}
}