-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ffbf93
commit b371cca
Showing
9 changed files
with
97 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 47 additions & 47 deletions
94
server/src/main/kotlin/delta/codecharacter/server/schedulers/SchedulingService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
package delta.codecharacter.server.schedulers | ||
|
||
import delta.codecharacter.server.code.code_revision.CodeRevisionService | ||
import delta.codecharacter.server.code.latest_code.LatestCodeService | ||
import delta.codecharacter.server.code.locked_code.LockedCodeService | ||
import delta.codecharacter.server.game_map.latest_map.LatestMapService | ||
import delta.codecharacter.server.game_map.locked_map.LockedMapService | ||
import delta.codecharacter.server.game_map.map_revision.MapRevisionService | ||
import delta.codecharacter.server.match.MatchService | ||
import delta.codecharacter.server.user.public_user.PublicUserService | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.scheduling.annotation.Scheduled | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class SchedulingService( | ||
@Autowired private val publicUserService: PublicUserService, | ||
@Autowired private val matchService: MatchService, | ||
@Autowired private val codeRevisionService: CodeRevisionService, | ||
@Autowired private val latestCodeService: LatestCodeService, | ||
@Autowired private val lockedCodeService: LockedCodeService, | ||
@Autowired private val latestMapService: LatestMapService, | ||
@Autowired private val lockedMapService: LockedMapService, | ||
@Autowired private val mapRevisionService: MapRevisionService | ||
) { | ||
private val logger: Logger = LoggerFactory.getLogger(SchedulingService::class.java) | ||
|
||
@Scheduled(cron = "\${environment.registration-time}", zone = "GMT+5:30") | ||
fun updateTempLeaderboard() { | ||
logger.info("Practice phase ended!!") | ||
publicUserService.resetRatingsAfterPracticePhase() | ||
codeRevisionService.resetCodeRevisionAfterPracticePhase() | ||
latestCodeService.resetLatestCodeAfterPracticePhase() | ||
lockedCodeService.resetLockedCodeAfterPracticePhase() | ||
latestMapService.resetLatestMapAfterPracticePhase() | ||
lockedMapService.resetLockedMapAfterPracticePhase() | ||
mapRevisionService.resetMapRevisionAfterPracticePhase() | ||
publicUserService.updateLeaderboardAfterPracticePhase() | ||
} | ||
|
||
@Scheduled(cron = "\${environment.promote-demote-time}", zone = "GMT+5:30") | ||
fun createAutoMatch() { | ||
matchService.createAutoMatch() | ||
} | ||
} | ||
// package delta.codecharacter.server.schedulers | ||
// | ||
// import delta.codecharacter.server.code.code_revision.CodeRevisionService | ||
// import delta.codecharacter.server.code.latest_code.LatestCodeService | ||
// import delta.codecharacter.server.code.locked_code.LockedCodeService | ||
// import delta.codecharacter.server.game_map.latest_map.LatestMapService | ||
// import delta.codecharacter.server.game_map.locked_map.LockedMapService | ||
// import delta.codecharacter.server.game_map.map_revision.MapRevisionService | ||
// import delta.codecharacter.server.match.MatchService | ||
// import delta.codecharacter.server.user.public_user.PublicUserService | ||
// import org.slf4j.Logger | ||
// import org.slf4j.LoggerFactory | ||
// import org.springframework.beans.factory.annotation.Autowired | ||
// import org.springframework.scheduling.annotation.Scheduled | ||
// import org.springframework.stereotype.Service | ||
// | ||
// @Service | ||
// class SchedulingService( | ||
// @Autowired private val publicUserService: PublicUserService, | ||
// @Autowired private val matchService: MatchService, | ||
// @Autowired private val codeRevisionService: CodeRevisionService, | ||
// @Autowired private val latestCodeService: LatestCodeService, | ||
// @Autowired private val lockedCodeService: LockedCodeService, | ||
// @Autowired private val latestMapService: LatestMapService, | ||
// @Autowired private val lockedMapService: LockedMapService, | ||
// @Autowired private val mapRevisionService: MapRevisionService | ||
// ) { | ||
// private val logger: Logger = LoggerFactory.getLogger(SchedulingService::class.java) | ||
// | ||
// @Scheduled(cron = "\${environment.registration-time}", zone = "GMT+5:30") | ||
// fun updateTempLeaderboard() { | ||
// logger.info("Practice phase ended!!") | ||
// publicUserService.resetRatingsAfterPracticePhase() | ||
// codeRevisionService.resetCodeRevisionAfterPracticePhase() | ||
// latestCodeService.resetLatestCodeAfterPracticePhase() | ||
// lockedCodeService.resetLockedCodeAfterPracticePhase() | ||
// latestMapService.resetLatestMapAfterPracticePhase() | ||
// lockedMapService.resetLockedMapAfterPracticePhase() | ||
// mapRevisionService.resetMapRevisionAfterPracticePhase() | ||
// publicUserService.updateLeaderboardAfterPracticePhase() | ||
// } | ||
// | ||
// @Scheduled(cron = "\${environment.promote-demote-time}", zone = "GMT+5:30") | ||
// fun createAutoMatch() { | ||
// matchService.createAutoMatch() | ||
// } | ||
// } |
3 changes: 2 additions & 1 deletion
3
server/src/main/kotlin/delta/codecharacter/server/stats/PublicStatEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package delta.codecharacter.server.stats | ||
|
||
import delta.codecharacter.server.user.public_user.DailyChallengeHistory | ||
import org.springframework.data.annotation.Id | ||
import org.springframework.data.mongodb.core.mapping.Document | ||
import java.util.* | ||
|
||
@Document(collection="stats") | ||
data class PublicStatEntity( | ||
@Id val userId: UUID, | ||
val stats : List<StatEntity> | ||
var stats: HashMap<Int, StatEntity> | ||
) |
10 changes: 5 additions & 5 deletions
10
server/src/main/kotlin/delta/codecharacter/server/stats/StatEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package delta.codecharacter.server.stats | ||
|
||
import delta.codecharacter.server.match.MatchModeEnum | ||
import java.time.Instant | ||
|
||
data class StatEntity ( | ||
val maxAtk :Double, | ||
val minAtk : Double, | ||
val avgAtk : Double, | ||
val dc_wins : Int, | ||
val dc_losses : Int, | ||
val dc_destruction: Int, | ||
val coins : Int | ||
val coins : Int, | ||
val createdAt: Instant, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters