-
Notifications
You must be signed in to change notification settings - Fork 13
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
fb0a169
commit 2e7cd20
Showing
20 changed files
with
862 additions
and
866 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
#!/usr/bin/env python3 | ||
|
||
class Challenge: | ||
def __init__(self, channel_id, name): | ||
""" | ||
An object representation of an ongoing challenge. | ||
channel_id : The slack id for the associated channel | ||
name : The name of the challenge | ||
""" | ||
def __init__(self, channel_id, name): | ||
""" | ||
An object representation of an ongoing challenge. | ||
channel_id : The slack id for the associated channel | ||
name : The name of the challenge | ||
""" | ||
|
||
self.channel_id = channel_id | ||
self.name = name | ||
self.players = [] | ||
self.is_solved = False | ||
self.solver = None | ||
self.channel_id = channel_id | ||
self.name = name | ||
self.players = [] | ||
self.is_solved = False | ||
self.solver = None | ||
|
||
def mark_as_solved(self, solver_list): | ||
""" | ||
Mark a challenge as solved. | ||
solver_list : List of usernames, that solved the challenge. | ||
""" | ||
self.is_solved = True | ||
self.solver = solver_list | ||
def mark_as_solved(self, solver_list): | ||
""" | ||
Mark a challenge as solved. | ||
solver_list : List of usernames, that solved the challenge. | ||
""" | ||
self.is_solved = True | ||
self.solver = solver_list | ||
|
||
def unmark_as_solved(self): | ||
""" | ||
Unmark a challenge as solved. | ||
""" | ||
self.is_solved = False | ||
self.solver = None | ||
def unmark_as_solved(self): | ||
""" | ||
Unmark a challenge as solved. | ||
""" | ||
self.is_solved = False | ||
self.solver = None | ||
|
||
def add_player(self, player): | ||
""" | ||
Add a player to the list of working players | ||
""" | ||
if not any(p.user_id == player.user_id for p in self.players): | ||
self.players.append(player) | ||
def add_player(self, player): | ||
""" | ||
Add a player to the list of working players | ||
""" | ||
if not any(p.user_id == player.user_id for p in self.players): | ||
self.players.append(player) | ||
|
||
def remove_player(self, user_id): | ||
""" | ||
Remove a player from the list of working players | ||
using a given slack user ID | ||
""" | ||
self.players = [player for player in self.players if player.user_id != user_id] | ||
def remove_player(self, user_id): | ||
""" | ||
Remove a player from the list of working players | ||
using a given slack user ID | ||
""" | ||
self.players = [player for player in self.players if player.user_id != user_id] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
class CommandDesc(): | ||
def __init__(self, command, description, args, optArgs): | ||
self.command = command | ||
self.description = description | ||
self.arguments = args | ||
self.optionalArgs = optArgs | ||
def __init__(self, command, description, args, optArgs): | ||
self.command = command | ||
self.description = description | ||
self.arguments = args | ||
self.optionalArgs = optArgs |
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,21 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
class CTF: | ||
def __init__(self, channel_id, name): | ||
""" | ||
An object representation of an ongoing CTF. | ||
channel_id : The slack id for the associated channel | ||
name : The name of the CTF | ||
""" | ||
def __init__(self, channel_id, name): | ||
""" | ||
An object representation of an ongoing CTF. | ||
channel_id : The slack id for the associated channel | ||
name : The name of the CTF | ||
""" | ||
|
||
self.channel_id = channel_id | ||
self.name = name | ||
self.challenges = [] | ||
self.channel_id = channel_id | ||
self.name = name | ||
self.challenges = [] | ||
|
||
def add_challenge(self, challenge): | ||
""" | ||
Add a challenge object to the list of challenges belonging | ||
to this CTF. | ||
challenge : A challenge object | ||
""" | ||
self.challenges.append(challenge) | ||
def add_challenge(self, challenge): | ||
""" | ||
Add a challenge object to the list of challenges belonging | ||
to this CTF. | ||
challenge : A challenge object | ||
""" | ||
self.challenges.append(challenge) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
class Player: | ||
""" | ||
An object representation of a CTF player | ||
""" | ||
|
||
def __init__(self, user_id): | ||
""" | ||
user_id : The slack ID of a user | ||
An object representation of a CTF player | ||
""" | ||
self.user_id = user_id | ||
|
||
|
||
def __init__(self, user_id): | ||
""" | ||
user_id : The slack ID of a user | ||
""" | ||
self.user_id = user_id |
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,5 +1,5 @@ | ||
__all__ = [ | ||
"challenge_handler", | ||
"syscalls_handler", | ||
"bot_handler" | ||
] | ||
"challenge_handler", | ||
"syscalls_handler", | ||
"bot_handler" | ||
] |
Oops, something went wrong.