MCPcopy Create free account
hub / github.com/F12FLASH/CTF / unlockHint

Method unlockHint

4.Stackless Stack/server/storage.ts:387–408  ·  view source on GitHub ↗
(sessionId: string, challengeId: string, hintId: string)

Source from the content-addressed store, hash-verified

385 }
386
387 async unlockHint(sessionId: string, challengeId: string, hintId: string): Promise<void> {
388 const allHints = await this.getHintsByChallenge(challengeId);
389 const hint = allHints.find(h => h.id === hintId);
390
391 if (!hint) {
392 throw new Error("Hint not found for this challenge");
393 }
394
395 if (hint.challengeId !== challengeId) {
396 throw new Error("Hint does not belong to this challenge");
397 }
398
399 const key = `${sessionId}:${challengeId}`;
400 let unlocked = this.unlockedHints.get(key);
401
402 if (!unlocked) {
403 unlocked = new Set();
404 this.unlockedHints.set(key, unlocked);
405 }
406
407 unlocked.add(hintId);
408 }
409}
410
411export const storage = new MemStorage();

Callers

nothing calls this directly

Calls 1

getHintsByChallengeMethod · 0.95

Tested by

no test coverage detected