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 {