덱 저장 마무리
This commit is contained in:
parent
e41e3904dc
commit
6336fee8f1
|
|
@ -21,6 +21,6 @@
|
||||||
|
|
||||||
<rules>
|
<rules>
|
||||||
<logger name="*" minlevel="Trace" writeTo="logfile" />
|
<logger name="*" minlevel="Trace" writeTo="logfile" />
|
||||||
<logger name="*" minlevel="${configsetting:logLevel}" writeTo="console" />
|
<logger name="*" minlevel="Trace" writeTo="console" />
|
||||||
</rules>
|
</rules>
|
||||||
</nlog>
|
</nlog>
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,6 @@ using Server.System;
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
//로그 레벨 설정
|
|
||||||
#if DEBUG
|
|
||||||
NLog.GlobalDiagnosticsContext.Set("logLevel", "Trace");
|
|
||||||
#elif LIVE
|
|
||||||
NLog.GlobalDiagnosticsContext.Set("logLevel", "Info");
|
|
||||||
#endif
|
|
||||||
//웹서버 초기화
|
//웹서버 초기화
|
||||||
ProtocolProcessor.Init();
|
ProtocolProcessor.Init();
|
||||||
//깃 웹훅 초기화
|
//깃 웹훅 초기화
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Server.Service
|
||||||
if (req.deck_unit[n] == 0)
|
if (req.deck_unit[n] == 0)
|
||||||
continue;
|
continue;
|
||||||
long unit_id = req.deck_unit[n];
|
long unit_id = req.deck_unit[n];
|
||||||
if( deckUnitInfo.FindIndex(data => data.unit_id == unit_id) == -1)
|
if( deckUnitInfo.FindIndex(data => data.id == unit_id) == -1)
|
||||||
throw new RuntimeException("Not Unit", Error.nodata);
|
throw new RuntimeException("Not Unit", Error.nodata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,25 +44,35 @@ namespace Server.Service
|
||||||
if(deckindex == -1)
|
if(deckindex == -1)
|
||||||
throw new RuntimeException("Not Deck", Error.nodata);
|
throw new RuntimeException("Not Deck", Error.nodata);
|
||||||
|
|
||||||
|
//덱 검사
|
||||||
|
if (deckInfo[deckindex].deck_unit0_id == req.deck_unit[0] &&
|
||||||
|
deckInfo[deckindex].deck_unit1_id == req.deck_unit[1] &&
|
||||||
|
deckInfo[deckindex].deck_unit2_id == req.deck_unit[2] &&
|
||||||
|
deckInfo[deckindex].deck_unit3_id == req.deck_unit[3] &&
|
||||||
|
deckInfo[deckindex].deck_unit4_id == req.deck_unit[4] &&
|
||||||
|
deckInfo[deckindex].deck_unit5_id == req.deck_unit[5] &&
|
||||||
|
deckInfo[deckindex].deck_unit6_id == req.deck_unit[6] &&
|
||||||
|
deckInfo[deckindex].deck_unit7_id == req.deck_unit[7] &&
|
||||||
|
deckInfo[deckindex].deck_unit8_id == req.deck_unit[8])
|
||||||
|
{
|
||||||
|
//모든 정보가 같으면 업데이트 하지않음
|
||||||
|
return makeResp(deckInfo[deckindex]);
|
||||||
|
}
|
||||||
|
|
||||||
//덱 유닛 저장
|
//덱 유닛 저장
|
||||||
|
|
||||||
DeckInfo changeDeck = new DeckInfo();
|
deckInfo[deckindex].deck_unit0_id = req.deck_unit[0];
|
||||||
|
deckInfo[deckindex].deck_unit1_id = req.deck_unit[1];
|
||||||
|
deckInfo[deckindex].deck_unit2_id = req.deck_unit[2];
|
||||||
|
deckInfo[deckindex].deck_unit3_id = req.deck_unit[3];
|
||||||
|
deckInfo[deckindex].deck_unit4_id = req.deck_unit[4];
|
||||||
|
deckInfo[deckindex].deck_unit5_id = req.deck_unit[5];
|
||||||
|
deckInfo[deckindex].deck_unit6_id = req.deck_unit[6];
|
||||||
|
deckInfo[deckindex].deck_unit7_id = req.deck_unit[7];
|
||||||
|
deckInfo[deckindex].deck_unit8_id = req.deck_unit[8];
|
||||||
|
|
||||||
changeDeck.id = deckInfo[deckindex].id;
|
Statics.deckInfoSQL.Update(deckInfo[deckindex]);
|
||||||
changeDeck.deck_type = deckInfo[deckindex].deck_type;
|
return makeResp(deckInfo[deckindex]);
|
||||||
changeDeck.user_id = deckInfo[deckindex].user_id;
|
|
||||||
changeDeck.deck_unit0_id = req.deck_unit[0];
|
|
||||||
changeDeck.deck_unit1_id = req.deck_unit[1];
|
|
||||||
changeDeck.deck_unit2_id = req.deck_unit[2];
|
|
||||||
changeDeck.deck_unit3_id = req.deck_unit[3];
|
|
||||||
changeDeck.deck_unit4_id = req.deck_unit[4];
|
|
||||||
changeDeck.deck_unit5_id = req.deck_unit[5];
|
|
||||||
changeDeck.deck_unit6_id = req.deck_unit[6];
|
|
||||||
changeDeck.deck_unit7_id = req.deck_unit[7];
|
|
||||||
changeDeck.deck_unit8_id = req.deck_unit[8];
|
|
||||||
|
|
||||||
Statics.deckInfoSQL.Update(changeDeck);
|
|
||||||
return makeResp(changeDeck);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Protocol ProtocolValue() => Protocol.DeckChange;
|
public override Protocol ProtocolValue() => Protocol.DeckChange;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue