moloch-- / RootTheBox

A Game of Hackers (CTF Scoreboard & Game Manager)
http://root-the-box.com/
Apache License 2.0
908 stars 292 forks source link

Hiding Levels #563

Closed PJNorrisS1 closed 1 year ago

PJNorrisS1 commented 1 year ago

Hi,

Sorry to bring this topic up again. If I try and explain my scenario, it might make sense and you may be able to advise a better approach.

Today, we have to types of games. In the next couple of months, there will be 5 or 6 types of games.

Each "Game" will have more than one level, eg: game 1 has 7 levels, game 2 has 3 levels.

There shouldn't be any scenario where we have a session with players where they will need access to more than one 'game' and it's corresponding levels.

So at the moment, I have 10 levels, the first seven are 1.1, 1.2, 1.3 etc that represents 'game 1'; then I have 2.1, 2.2, 2.3 etc that represents 'game 2'. For Level 1.1 I have it as "unlocked". The same goes for level 2.1. All the remaining levels are on previous level progress of 100%, so we are taking them through each level as they progress.

When a player logs in, they get to see all the levels, but only 1.1 and 2.1 is playable.

To disable 2.1, we change it to locked. But it's still visible (not playable).

A suggestion was to change it to "managed" and have no users assigned, that will 'hide' it from view. But when you have so many levels to change to 'managed' and then back to 'unlocked' or game progress, it's too much to ask of the admin to do that each time.

Ideally, I would like to see a checkbox 'enabled/disabled' on the level editor, if disabled, it's not shown.

I have also experimented with Corporations, but it's just a title, no management around that at all (might be an option?)

Now that's explained in a terrible way, is there another way of doing this or could this be coded in?

Thanks! PJ

eljeffeg commented 1 year ago

It does sound like Corporations (which we could rename) may be a way to handle this as we could potentially hide all the boxes associated it. A step further would be managed Corporations, which could allow some users to play game 1 while other users play game 2 on the same system.

PJNorrisS1 commented 1 year ago

Yes love this idea! Hiding a corp be awesome to start with! πŸ€žπŸ™πŸ‘†

eljeffeg commented 1 year ago

Pushed a new branch for testing: https://github.com/moloch--/RootTheBox/tree/%23563---Hiding-Levels This provides a lock option for levels and corporations.

PJNorrisS1 commented 1 year ago

Hi! Pulled and merged the new branch. Thank you.

  1. Corporations - the 'lock' button doesn't do anything.
  2. Levels - the 'lock' button shows the interface it's locked, but as a place image and the user see's: image The level still there, but the the flags are not, which I guess is correct. If I 'unlock' the level, this is what I see: image
eljeffeg commented 1 year ago

Pushed an update

PJNorrisS1 commented 1 year ago

Ok, thank you - that is the level lock sorted, it now hides it. However the Corporations button doesn't do anything. Should it? No errors in the log.

eljeffeg commented 1 year ago

Try doing a shift+refresh. There was a change to javascript, so maybe it's cached?

PJNorrisS1 commented 1 year ago

Yup that did it! Thank you - that is PERFECT! Do you want me to close this, or are you doing more coding on it?

eljeffeg commented 1 year ago

Yeah, we can close it and will still have #545 open to fill in the remaining gaps.

PJNorrisS1 commented 1 year ago

will this be merged with master soon? Otherwise I'll update all my instances with this branch. Thank you again my friend.

eljeffeg commented 1 year ago

Merged πŸ‘