Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coins to teams and user add/remove route #12

Merged
merged 18 commits into from
Jan 10, 2024

Conversation

mradigen
Copy link
Member

This PR adds:

  • Field coins to each team, defaulting to 0 on creation.
  • Everytime a hint is requested, an amount is deducted from the team's coins. (amount can be set in config.hint_penalty)
  • Team will not be allowed to view hints if they do not have the enough coins to do so.
  • /api/team/add route creates a user and adds them to a given team. Returns 403 if user already exists in another team.
  • /api/team/remove route removes a user from a team. Returns 403, if user is not a part of the selected team.

@mradigen
Copy link
Member Author

@Meetesh-Saini How will we be incrementing the coins? Does solving the CTF reward the team with coins as well as leaderboard points?

@WizzyGeek
Copy link
Contributor

WizzyGeek commented Dec 23, 2023

@Meetesh-Saini How will we be incrementing the coins? Does solving the CTF reward the team with coins as well as leaderboard points?

In the 1 week period, it rewards them with just coins for solving challenges

@mradigen
Copy link
Member Author

@Meetesh-Saini How will we be incrementing the coins? Does solving the CTF reward the team with coins as well as leaderboard points?

In the 1 week period, it rewards them with just coins for solving challenges

Got it. I'll implement an optional field called coins to Problem. The field can be set for the first week challenges, while the challenges on the event day would have a coin reward of 0.

Copy link
Contributor

@WizzyGeek WizzyGeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the team's add and remove route needs to check the amount of Users in the team and other stuff, but I am not clear on the business logic for that functionality right now to specify the details myself

@WizzyGeek
Copy link
Contributor

WizzyGeek commented Dec 27, 2023

@mradigen get this merged asap, contact @Meetesh-Saini to merge it for you.

@WizzyGeek WizzyGeek self-requested a review January 7, 2024 15:25
src/pwncore/models/ctf.py Outdated Show resolved Hide resolved
@mradigen
Copy link
Member Author

mradigen commented Jan 9, 2024

The recent few commits add the following changes:

  • Pre-event routes under /api/ctf/pre/ which replicates /api/ctf/
  • Splits event problem and pre-event problem models under Problem and PreEventProblem that inherit BaseProblem
  • Problem_Pydantic has been changed to BaseProblem_Pydantic
  • Normalizes User.tag using .strip().casefold()
  • Coins under PreEventProblem is named as points (since it inherits from BaseProblem)
  • Added /api/leaderboard

@WizzyGeek
Copy link
Contributor

@mradigen ready to merge?

@Meetesh-Saini Meetesh-Saini merged commit 015556b into lugvitc:master Jan 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants