From d753d3e2d07b102a25170186d6fe527eef1268a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=84=9C?= Date: Mon, 1 Apr 2024 17:56:32 +0900 Subject: [PATCH] =?UTF-8?q?=EB=88=84=EB=9D=BD=EB=90=9C=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=9E=AC=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/Service/UpdateStory.cs | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Server/Service/UpdateStory.cs b/Server/Service/UpdateStory.cs index 75c15db..2d79d3e 100644 --- a/Server/Service/UpdateStory.cs +++ b/Server/Service/UpdateStory.cs @@ -29,23 +29,25 @@ namespace Server.Service if (req.is_clear) { - if (req.chapter_id == 1) + if(story == null || story.chapter_data_id < req.chapter_id) { - story = new StoryProgress(); - story.user_id = user.id; - story.story_data_id = req.story_id; - story.chapter_data_id = req.chapter_id; - Statics.storyProgressSQL.Insert(story); + if (req.chapter_id == 1) + { + story = new StoryProgress(); + story.user_id = user.id; + story.story_data_id = req.story_id; + story.chapter_data_id = req.chapter_id; + Statics.storyProgressSQL.Insert(story); + } + else + { + story.chapter_data_id++; + chapter = story.chapter_data_id; + Statics.storyProgressSQL.Update(story); + } + //보상 지급 추가할것. } - else - { - story.chapter_data_id++; - chapter = story.chapter_data_id; - Statics.storyProgressSQL.Update(story); - } - - - //보상 지급 추가할것. + //클리어 성공 로그용, 기본보상 지급할것 } else {