# Anti-Cheat services

## Backend-to-backend security.

In case your game has it's own backend, which receives the game scores, from the game frontend, you can use following escs endpoint for validation of the game results.

```
PUT /tournaments/:tournamentId/rounds/:roundId/game-server-confirmation
```

In case your backend considers the score and the game to be valid, send to this endpoint following body:

```
{ 
    isValid: true; 
    score: number; 
}
```

Our system will make another check, matching the score received in that body with the score that was received from the game frontend. \
\
If your backend considers the game and the score to be invalid, send the following body to the same endpoint:

```
{ 
    isValid: false; 
}
```

In case there is a mismatch between the scores or the system received "false", the game and the score will be invalidated.\
\
As you noticed, you need "tournamentId" and "roundId" to use this endpoint.

When you call startGame() in the plugin, successful call returns a response like this

```
{
   "status":"active",
   "isDeleted":false,
   "_id":"5f158727c9e95137883b8b96",
   "playerId":"5f158719c9e95137883b8b7c",
   "tournamentId":"5f0f7c60c9e95137883b55cc",
   "createdAt":"2020-07-20T11:59:35.491Z",
   "updatedAt":"2020-07-20T11:59:35.491Z",
   "__v":0
}
```

where "\_id" is your roundId and "tournamentId" is ... well, your tournamentId.

In case you send "false" to the endpoint, the score of the player for that round will be invalidated and not counted toward the results.

## Encryption

You can choose to secure communication between your client and escs backend, as well as between your backend and escs backend (see endpoint above).&#x20;

For that please click on the "Games" in the top menu, then select your game and click "Edit game information". You will see something like this:

&#x20;

![](https://3853901254-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAfYp0johoPRZW2PhVp%2F-MFBhskCGT7e1a07BOwT%2F-MFBjzh2YK1lmya7a9su%2Fimage.png?alt=media\&token=027f5c26-0552-4e4e-a581-ca1814f47c8c)

Click on "Generate secret" to secure the communication between your game's backend and escs endpoint above.

Add the generated secret to the header of the PUT request above

```
 headers
 {
        'escs-game-secret-key': GENERATED_SECRET
 }
```

Click on "Generate encryption key" to encrypt the communication between your game's client and escs backend above.

You will use the encryption key with the endGame method - please see the corresponding plugin description for the details.

We are constantly expanding our anti-cheat protection - new features will appear here.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.escs.io/anti-cheat-services.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
