diff --git a/Server/NLog.config b/Server/NLog.config index aabf35e..a4dd140 100644 --- a/Server/NLog.config +++ b/Server/NLog.config @@ -21,6 +21,6 @@ - + diff --git a/Server/Program.cs b/Server/Program.cs index 964765e..ab5d358 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -3,12 +3,6 @@ using Server.System; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); -//α -#if DEBUG -NLog.GlobalDiagnosticsContext.Set("logLevel", "Trace"); -#elif LIVE -NLog.GlobalDiagnosticsContext.Set("logLevel", "Info"); -#endif // ʱȭ ProtocolProcessor.Init(); // ʱȭ diff --git a/Server/Service/DeckChange.cs b/Server/Service/DeckChange.cs index 702b344..719d310 100644 --- a/Server/Service/DeckChange.cs +++ b/Server/Service/DeckChange.cs @@ -25,7 +25,7 @@ namespace Server.Service if (req.deck_unit[n] == 0) continue; 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); } @@ -44,25 +44,35 @@ namespace Server.Service if(deckindex == -1) 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; - changeDeck.deck_type = deckInfo[deckindex].deck_type; - 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); + Statics.deckInfoSQL.Update(deckInfo[deckindex]); + return makeResp(deckInfo[deckindex]); } public override Protocol ProtocolValue() => Protocol.DeckChange;