Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vp817 authored May 16, 2024
1 parent 52543a1 commit d515f76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,27 +231,27 @@ This packet is the response to an open connection request two packet.
| requiresEncryption | bit | N/A | Whether the connection requires encryption or not |
| encryptionKey | uint8[128] | N/A | The encryption key of the client - it is only written or read if the `requiresEncryption` field is set to true. |

**Calculating ConnectionState**:
**Calculating ConnectionOutcome**:
- Find the client associated with the provided `clientAddress`.
- If the client is not currently connected, set the local variable `state` to 1.
- Otherwise, set it to 2.
- If the `clientGuid` provided in the request is already associated with a client that has a different `clientAddress`, set the connection state to 3.
- If the `clientAddress` is already associated with a different `clientGuid`, set the connection state to 4, as someone else may have the same internet as the current client trying to connect.
- Otherwise, set the state to 0.

> Once you have calculated the `ConnectionState`, You will need to check if it is equal to 1 then send the `OpenConnectionReplyTwo` packet.
> Once you have calculated the `ConnectionOutcome`, You will need to check if it is equal to 1 then send the `OpenConnectionReplyTwo` packet.
> If the `ConnectionState` is not 0, send the `AlreadyConnected` packet.
> If the `ConnectionOutcome` is not 0, send the `AlreadyConnected` packet.
### ConnectionRequest

This packet is used to establish a connection between a client and a server with security enabled.
This packet is used to establish a connection between a client and a server with security enabled or disabled.

| Field | Type | Endianness | Note |
| ----- | ---- | ----------| ----- |
| id | uint8 | N/A | Unique identifier for the request |
| clientGuid | uint64 | Big Endian | Unique identifier for the client |
| serverSendTime | uint64 | Big Endian | Timestamp for the server |
| clientSendTime | uint64 | Big Endian | Timestamp of the client when it requested to be connected |
| doSecurity | bool | N/A | Whether the connection requires security or not |
| clientProof | uint8[32] | N/A | Proof of client authentication |
| doIdentity | bool | N/A | Whether the packet requires an identity proof |
Expand Down

0 comments on commit d515f76

Please sign in to comment.