reapi_rechecker.inc
Original include source with line numbers.
| 1 | #if defined _reapi_rechecker_included |
| 2 | #endinput |
| 3 | #endif |
| 4 | #define _reapi_rechecker_included |
| 5 | |
| 6 | enum ResourceType |
| 7 | { |
| 8 | RES_TYPE_NONE = 0, |
| 9 | RES_TYPE_EXISTS, // to comparison with the specified hash value |
| 10 | RES_TYPE_MISSING, // check it missing file on client |
| 11 | RES_TYPE_IGNORE, // ignore the specified hash value |
| 12 | RES_TYPE_HASH_ANY, // any file with any the hash value |
| 13 | }; |
| 14 | |
| 15 | enum ReCheckerFunc |
| 16 | { |
| 17 | /* |
| 18 | * Description: - |
| 19 | * Params: (const client, const filename[], const cmd[], const ResourceType:type, const responseHash, bool:isBreak) |
| 20 | */ |
| 21 | RC_FileConsistencyProcess = BEGIN_FUNC_REGION(rechecker), |
| 22 | |
| 23 | /* |
| 24 | * Description: - |
| 25 | * Params: (const client) |
| 26 | */ |
| 27 | RC_FileConsistencyFinal, |
| 28 | |
| 29 | /* |
| 30 | * Description: - |
| 31 | * Params: (const client, const filename[], const cmd[], const responseHash) |
| 32 | */ |
| 33 | RC_CmdExec, |
| 34 | |
| 35 | // [...] |
| 36 | }; |
| 37 | |
| 38 | /* |
| 39 | * Send request the file for the client to get hash |
| 40 | * |
| 41 | * @param file The file (Can contain a relative path to the file) |
| 42 | * @param function The forward to call |
| 43 | * @param type The request type, can be only RES_TYPE_EXISTS, RES_TYPE_MISSING or RES_TYPE_HASH_ANY |
| 44 | * @param hash Hash of file to request. |
| 45 | * |
| 46 | * @return Returns a hook handle. Use UnRegisterQueryFile to remove the forward |
| 47 | */ |
| 48 | native QueryFileHook:RegisterQueryFile(const file[], const function[], const ResourceType:type, const hash = -1); |
| 49 | |
| 50 | /* |
| 51 | * Unregister the forward. |
| 52 | * Use the return value from RegisterQueryFile as the parameter here! |
| 53 | * |
| 54 | * @param hook The hook to remove |
| 55 | * |
| 56 | * @return Returns true if the hook is successfully removed, otherwise false |
| 57 | */ |
| 58 | native bool:UnRegisterQueryFile(QueryFileHook:hook); |
| 59 | |