Can I create more than one private tournaments in a daily basis?
I think there is a limit which is more than one.
@Toadofsky I think the number is 8 tournaments per day,right?
@risky-chess I think the limit is github.com/ornicar/lila/blob/9873817f021d1a49ee998e1acdafc4dd33a5f0df/app/controllers/Tournament.scala#L200-L247 :
private val CreateLimitPerUser = new lila.memo.RateLimit[lila.user.User.ID](
credits = 12,
duration = 24 hour,
name = "tournament per user",
key = "tournament.user"
)
private val CreateLimitPerIP = new lila.memo.RateLimit[lila.common.IpAddress](
credits = 16,
duration = 24 hour,
name = "tournament per IP",
key = "tournament.ip"
)
private val rateLimited = ornicar.scalalib.Zero.instance[Fu[Result]] {
fuccess(Redirect(routes.Tournament.home(1)))
}
def create = AuthBody { implicit ctx => me =>
NoLameOrBot {
teamsIBelongTo(me) flatMap { teams =>
implicit val req = ctx.body
negotiate(
html = env.forms(me).bindFromRequest.fold(
err => BadRequest(html.tournament.form(err, env.forms, me, teams)).fuccess,
setup => {
val cost = if (me.hasTitle ||
Env.streamer.liveStreamApi.isStreaming(me.id) ||
isGranted(_.ManageTournament)) 1 else 4
CreateLimitPerUser(me.id, cost = cost) {
CreateLimitPerIP(HTTPRequest lastRemoteAddress ctx.req, cost = cost) {
env.api.createTournament(setup, me, teams, getUserTeamIds) flatMap { tour =>
fuccess(Redirect(routes.Tournament.show(tour.id)))
}
}(rateLimited)
}(rateLimited)
}
),
api = _ => doApiCreate(me)
)
}
}
}
def apiCreate = ScopedBody() { implicit req => me =>
if (me.isBot || me.lame) notFoundJson("This account cannot create tournaments")
else doApiCreate(me)
}
So it's based upon the number of credits collected per user and/or IP address, unless the user is a BOT in which case the request is denied, or unless the user is a titled or otherwise trusted player, except when there's a blue moon on a Thursday.
Separately the API documentation states you can create two tournaments per day, but that doesn't necessarily mean that the limit is 2:
lichess.org/api#operation/apiTournamentPost
private val CreateLimitPerUser = new lila.memo.RateLimit[lila.user.User.ID](
credits = 12,
duration = 24 hour,
name = "tournament per user",
key = "tournament.user"
)
private val CreateLimitPerIP = new lila.memo.RateLimit[lila.common.IpAddress](
credits = 16,
duration = 24 hour,
name = "tournament per IP",
key = "tournament.ip"
)
private val rateLimited = ornicar.scalalib.Zero.instance[Fu[Result]] {
fuccess(Redirect(routes.Tournament.home(1)))
}
def create = AuthBody { implicit ctx => me =>
NoLameOrBot {
teamsIBelongTo(me) flatMap { teams =>
implicit val req = ctx.body
negotiate(
html = env.forms(me).bindFromRequest.fold(
err => BadRequest(html.tournament.form(err, env.forms, me, teams)).fuccess,
setup => {
val cost = if (me.hasTitle ||
Env.streamer.liveStreamApi.isStreaming(me.id) ||
isGranted(_.ManageTournament)) 1 else 4
CreateLimitPerUser(me.id, cost = cost) {
CreateLimitPerIP(HTTPRequest lastRemoteAddress ctx.req, cost = cost) {
env.api.createTournament(setup, me, teams, getUserTeamIds) flatMap { tour =>
fuccess(Redirect(routes.Tournament.show(tour.id)))
}
}(rateLimited)
}(rateLimited)
}
),
api = _ => doApiCreate(me)
)
}
}
}
def apiCreate = ScopedBody() { implicit req => me =>
if (me.isBot || me.lame) notFoundJson("This account cannot create tournaments")
else doApiCreate(me)
}
So it's based upon the number of credits collected per user and/or IP address, unless the user is a BOT in which case the request is denied, or unless the user is a titled or otherwise trusted player, except when there's a blue moon on a Thursday.
Separately the API documentation states you can create two tournaments per day, but that doesn't necessarily mean that the limit is 2:
lichess.org/api#operation/apiTournamentPost
Number of credits?? What is this?
@mirlife "Credits" is the system used for all rate-limited features on Lichess. For each rate-limited feature you have X credits to use (in a certain timespan) and taking the action 'costs' Y credits. The value of Y often depends on some circumstances, that's why credits are used rather than "everyone can use this feature Z many times per day".
This topic has been archived and can no longer be replied to.