Skip to content

Commit

Permalink
discontinue cheat list
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Dec 3, 2018
1 parent cfa70e2 commit 4fa0749
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 30 deletions.
8 changes: 3 additions & 5 deletions app/controllers/Analyse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ object Analyse extends LilaController {
Round.getWatcherChat(pov.game) zip
Env.game.crosstableApi.withMatchup(pov.game) zip
Env.bookmark.api.exists(pov.game, ctx.me) zip
Env.api.pgnDump(pov.game, initialFen, analysis = none, PgnDump.WithFlags(clocks = false)) zip
isGranted(_.Hunter).??(Env.mod.cheatList.get(pov.game).map(some)) flatMap {
case analysis ~ analysisInProgress ~ simul ~ chat ~ crosstable ~ bookmarked ~ pgn ~ onCheatList =>
Env.api.pgnDump(pov.game, initialFen, analysis = none, PgnDump.WithFlags(clocks = false)) flatMap {
case analysis ~ analysisInProgress ~ simul ~ chat ~ crosstable ~ bookmarked ~ pgn =>
Env.api.roundApi.review(pov, lila.api.Mobile.Api.currentVersion,
tv = userTv.map { u => lila.round.OnUserTv(u.id) },
analysis,
Expand All @@ -62,8 +61,7 @@ object Analyse extends LilaController {
crosstable,
userTv,
chat,
bookmarked = bookmarked,
onCheatList = onCheatList
bookmarked = bookmarked
))
}
}
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/Mod.scala
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,6 @@ object Mod extends LilaController {
fuccess(().some)
}(ctx => me => _ => Redirect(routes.Mod.chatPanic).fuccess)

def cheatList(gameId: String) = SecureBody(_.Hunter) { implicit ctx => me =>
OptionFuOk(lila.game.GameRepo game gameId) { game =>
Env.mod.cheatList.set(game, getBool("v"), lila.report.Mod(me))
}
}

def eventStream = OAuthSecure(_.Admin) { req => me =>
Ok.chunked(Env.mod.stream.enumerator).fuccess
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/analyse/replay.scala.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@(pov: Pov, data: play.api.libs.json.JsObject, initialFen: Option[chess.format.FEN], pgn: String, analysis: Option[lila.analyse.Analysis], analysisStarted: Boolean, simul: Option[lila.simul.Simul], cross: Option[lila.game.Crosstable.WithMatchup], userTv: Option[User], chatOption: Option[lila.chat.UserChat.Mine], bookmarked: Boolean, onCheatList: Option[Boolean])(implicit ctx: Context)
@(pov: Pov, data: play.api.libs.json.JsObject, initialFen: Option[chess.format.FEN], pgn: String, analysis: Option[lila.analyse.Analysis], analysisStarted: Boolean, simul: Option[lila.simul.Simul], cross: Option[lila.game.Crosstable.WithMatchup], userTv: Option[User], chatOption: Option[lila.chat.UserChat.Mine], bookmarked: Boolean)(implicit ctx: Context)

@import pov._

Expand Down
6 changes: 0 additions & 6 deletions app/views/round/cheatFlag.scala.html

This file was deleted.

1 change: 0 additions & 1 deletion conf/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ mod {
player_assessment = player_assessment
boosting = boosting
gaming_history = mod_gaming_history
cheat_list = cheat_list
}
boosting.nb_games_to_mark = 5
boosting.ratio_games_to_mark = 0.01
Expand Down
2 changes: 0 additions & 2 deletions conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,6 @@ GET /mod/public-chat controllers.Mod.publicChat
GET /mod/email-confirm controllers.Mod.emailConfirm
GET /mod/chat-panic controllers.Mod.chatPanic
POST /mod/chat-panic controllers.Mod.chatPanicPost
POST /mod/cheat-list/$gameId<\w{8}> controllers.Mod.cheatList(gameId: String)
GET /mod/chat-panic controllers.Mod.chatPanic
GET /api/stream/mod controllers.Mod.eventStream

# Irwin
Expand Down
3 changes: 0 additions & 3 deletions modules/mod/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ final class Env(
val CollectionBoosting = config getString "collection.boosting"
val CollectionModlog = config getString "collection.modlog"
val CollectionGamingHistory = config getString "collection.gaming_history"
val CollectionCheatList = config getString "collection.cheat_list"
val ActorName = config getString "actor.name"
val NbGamesToMark = config getInt "boosting.nb_games_to_mark"
val RatioGamesToMark = config getDouble "boosting.ratio_games_to_mark"
Expand Down Expand Up @@ -99,8 +98,6 @@ final class Env(

lazy val inquiryApi = new InquiryApi(reportApi, noteApi, logApi)

lazy val cheatList = new CheatList(db(CollectionCheatList))

lazy val stream = new ModStream(system)

// api actor
Expand Down
6 changes: 0 additions & 6 deletions ui/analyse/src/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ module.exports = function(element, cfg) {
));
});
lichess.topMenuIntent();
$('button.cheat_list').on('click', function() {
$.post({
url: $(this).data('src') + '?v=' + !$(this).hasClass('active')
});
$(this).toggleClass('active');
});
if (lichess.isMS) setTimeout(function() {
var prop = 'backgroundImage';
$('.cg-board').css(prop, $('.cg-board').css(prop).replace(')','?1)'));
Expand Down

0 comments on commit 4fa0749

Please sign in to comment.