#include <tnlClientPuzzle.h>
Public Types | |
| enum | ErrorCode |
| Error codes that can be returned by checkSolution. | |
| enum | { PuzzleRefreshTime = 30000, InitialPuzzleDifficulty = 17, MaxPuzzleDifficulty = 26, MaxSolutionComputeFragment = 30, SolutionFragmentIterations = 50000 } |
| Difficulty levels of puzzles. More... | |
Public Methods | |
| void | tick (U32 currentTime) |
| Checks to see if a new nonce needs to be created, and if so generates one and tosses out the current list of accepted nonces. | |
| ErrorCode | checkSolution (U32 solution, Nonce &clientNonce, Nonce &serverNonce, U32 puzzleDifficulty, U32 clientIdentity) |
| Checks a puzzle solution submitted by a client to see if it is a valid solution for the current or previous puzzle nonces. | |
| Nonce | getCurrentNonce () |
| Returns the current server nonce. | |
| U32 | getCurrentDifficulty () |
| Returns the current client puzzle difficulty. | |
Static Public Methods | |
| bool | solvePuzzle (U32 *solution, Nonce &clientNonce, Nonce &serverNonce, U32 puzzleDifficulty, U32 clientIdentity) |
| Computes a puzzle solution value for the given puzzle difficulty and server nonce. | |
Definition at line 42 of file tnlClientPuzzle.h.
|
|
Difficulty levels of puzzles.
Definition at line 108 of file tnlClientPuzzle.h. |
|
||||||||||||||||||||||||
|
Computes a puzzle solution value for the given puzzle difficulty and server nonce. If the execution time of this function exceeds MaxSolutionComputeFragment milliseconds, it will return the current trail solution in the solution variable and a return value of false.
Definition at line 152 of file clientPuzzle.cpp. References MaxSolutionComputeFragment, SolutionFragmentIterations, and TNL::U32. |
1.2.18