Compare commits
No commits in common. "e1a750cbe331eb97137a7ef14f3771e9c457a8e7" and "8a138b52d6c6d4f8a38728f70bbb4cc656c6e8d8" have entirely different histories.
e1a750cbe3
...
8a138b52d6
2 changed files with 7 additions and 11 deletions
|
@ -62,13 +62,12 @@ public class Completion{
|
|||
return tries;
|
||||
}
|
||||
|
||||
public void addTry(Puzzle currentPuzzle, byte[] response){
|
||||
public void addTry(Puzzle currentPuzzle, byte[] response) {
|
||||
if (score <= 0){
|
||||
tries++;
|
||||
if (response != null && Arrays.equals(currentPuzzle.getSoluce(), response)){
|
||||
if (response != null && Arrays.equals(currentPuzzle.getSoluce(), response)) {
|
||||
if (tries > 1) { // Loose 5% each try with a minimum of 1 for score
|
||||
// score = (int) Math.ceil(currentPuzzle.getScoreMax() * (1 - ((tries - 1) / 20.)));
|
||||
score = currentPuzzle.getScoreMax();
|
||||
score = (int) Math.ceil(currentPuzzle.getScoreMax() * (1 - ((tries - 1) / 20.)));
|
||||
if (score < 1)
|
||||
score = 1;
|
||||
} else
|
||||
|
|
|
@ -2,8 +2,9 @@ package dev.peerat.backend.routes.admins;
|
|||
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import org.jose4j.json.internal.json_simple.JSONObject;
|
||||
|
||||
import dev.peerat.backend.bonus.extract.RouteDoc;
|
||||
import dev.peerat.backend.model.Group;
|
||||
import dev.peerat.backend.model.PeerAtUser;
|
||||
import dev.peerat.backend.repository.DatabaseRepository;
|
||||
import dev.peerat.framework.Context;
|
||||
|
@ -28,13 +29,9 @@ public class DynamicLogs implements Response{
|
|||
@RouteDoc(path = "/admin/logs", responseCode = 200, responseDescription = "L'utilisateur peux voir les logs en directe")
|
||||
@RouteDoc(responseCode = 401, responseDescription = "L'utilisateur n'a pas accès à cette ressource")
|
||||
|
||||
@Route(path = "^/admin/logs$", needLogin = true, websocket = true)
|
||||
@Route(path = "^/admin/logs$", websocket = true)
|
||||
public void exec(Matcher matcher, Context context, HttpReader reader, HttpWriter writer) throws Exception {
|
||||
Group group = this.repo.getPlayerGroup(context.<PeerAtUser>getUser().getId(), 1);
|
||||
if(!group.getName().equalsIgnoreCase("Quarter-Master - Battles PAC x CEI")){
|
||||
context.response(423);
|
||||
return;
|
||||
}
|
||||
//check if admin
|
||||
|
||||
Key key = new Key();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue