Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update encoding section, fix credits.
  • Loading branch information
nekitdev committed Jul 5, 2022
commit 8db6fb65c6aec5a50d7b2cad0916a8934da401b9
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

indent_style = space
indent_size = 4

charset = utf-8

[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2
61 changes: 0 additions & 61 deletions docs/endpoints/delete_message.md

This file was deleted.

66 changes: 0 additions & 66 deletions docs/endpoints/download_level.md

This file was deleted.

62 changes: 62 additions & 0 deletions docs/endpoints/levels/download_level.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Download Level

*Downloads a level and related information.*

## Parameters

| name | description |
|------------------|---------------------------------------------------------------------------------------|
| `levelID` | The ID of the level to download. See [special level IDs][special_level_ids] for more. |
| `secret` | The [common secret][secrets]. |
| `gameVersion`? | The current [game version][versions]. |
| `binaryVersion`? | The current [binary version][versions]. |
| `gdw`? | Whether the level is in *Geometry Dash World*. |
| `accountID`? | The account ID of the user downloading the level. |
| `gjp`? | The [encoded password][passwords] of the user downloading the level. |
| `udid`? | The [UDID][udid] of the user who is downloading the level. |
| `uuid`? | The [UUID][uuid] of the downloading the level. |
| `inc`? | Unknown functionality. Set to `1`. |
| `extras`? | Unknown functionality. Set to `0`. |
| `rs`? | Random string. See [here][random_string]. |
| `chk`? | Check. See [here][download_level]. |

## Response

Returns a [level][levels].

## Example

### Code

```python
import requests

# with this code we are getting the level Test by DevExit

data = {
"levelID": 62687277, # level ID
"secret": "Wmfd2893gb7", # common secret
}

response = requests.post("http://boomlings.com/database/downloadGJLevel22.php", data=data)

print(response.text)
```

### Output

```console
1:62687277:2:Test:3:QSB0ZXN0IGxldmVsIGZvciB0aGUgR0QgRG9jcyE=:4:H4sIAAAAAAAAC6WQwQ3DIAxFF3IlfxsIUU6ZIQP8AbJChy_GPSZqpF7-A4yfDOfhXcCiNMIqnVYrgYQl8rDwBTZCVbkQRI3oVHbiDU6F2jMF_lesl4q4kw2PJMbovxLBQxTpM3-I6q0oHmXjzx7N0240cu5w0UBNtESRkble8uSLHjh8nTubmYJZ2MvMrEITEN0gEJMxlLiMZ28frmj:5:1:6:3935672:8:0:9:0:10:1:12:0:13:21:14:0:17::43:0:25::18:0:19:0:42:0:45:1:15:0:30:55610687:31:0:28:1 hour:29:1 hour:35:546561:36::37:0:38:0:39:50:46::47::40::27:AQcHBwEL#1bae6491cc87c72326abcbc0a7afaee139aa7088#f17c5a61f4ba1c7512081132459ddfaaa7c6f716
```

[special_level_ids]: /resources/server/special_level_ids
[secrets]: /resources/server/secrets
[versions]: /resources/server/versions
[passwords]: /resources/server/passwords

[levels]: /resources/server/levels

[udid]: /topics/encoding/ids#udid
[uuid]: /topics/encoding/ids#uuid
[random_string]: /topics/encoding/ids#random-string
[download_level]: /topics/encoding/checks#download-level
57 changes: 57 additions & 0 deletions docs/endpoints/messages/delete_message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Delete Message

*Deletes a message between two users.*

## Endpoint

| method | endpoint |
|--------|--------------------------|
| `POST` | `deleteGJMessages20.php` |

## Parameters

| name | description |
|------------------|---------------------------------------------------------------------|
| `accountID` | The account ID of the user who is deleting the message. |
| `gjp` | The [encoded password][passwords] of the user deleting the message. |
| `messageID` | The ID of the message being deleted. |
| `secret` | The [common secret][secrets]. |
| `isSender`? | Whether the user is the sender. |
| `gameVersion`? | The current [game version][versions]. |
| `binaryVersion`? | The current [binary version][versions]. |
| `gdw`? | Whether the message is in *Geometry Dash World*. |

## Response

Always returns `1`, regardless of whether the message was deleted or not.

## Example

### Code

```python
import requests

# with this code, DevExit is deleting one of her recievied messages

data = {
"accountID": 173831, # DevExit's account ID
"gjp": "********", # this would be DevExit's encoded password
"messageID": 3141592, # message ID
"secret": "Wmfd2893gb7", # common secret
}

response = requests.post("http://boomlings.com/database/deleteGJMessages20.php", data=data)

print(response.text)
```

### Output

```console
1
```

[passwords]: /resources/server/passwords
[secrets]: /resources/server/secrets
[versions]: /resources/server/versions
1 change: 1 addition & 0 deletions docs/topics/encoding/aes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# AES
79 changes: 77 additions & 2 deletions docs/topics/encoding/base64.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,85 @@
# Base64

[Base64][Base64] encoding is widely used amongst different endpoints in Geometry Dash.
[Base64][base64] encoding is widely used amongst different endpoints in Geometry Dash.

It is used to encode fields like level data, level descriptions, comments, etc.

GD uses *URL-safe* Base64 encoding, which uses `[A-Z]` and `[a-z]` letters
along with `_` and `-` as special characters.

[Base64]: https://en.wikipedia.org/wiki/Base64
## Code

```python
# taken from gd.py

from base64 import b64decode as standard_decode_base64
from base64 import b64encode as standard_encode_base64
from base64 import urlsafe_b64decode as standard_decode_base64_url_safe
from base64 import urlsafe_b64encode as standard_encode_base64_url_safe

# encoding

DEFAULT_ENCODING = "utf-8"
DEFAULT_ERRORS = "strict"

# padding

BASE64_PAD = 4
BASE64_INVALID_TO_PAD = 1
BASE64_PADDING = b"="


def enforce_valid_base64(data: bytes) -> bytes:
required = len(data) % BASE64_PAD

if required:
if required == BASE64_INVALID_TO_PAD:
data = data[:LAST]

else:
data += BASE64_PADDING * (BASE64_PAD - required)

return data


def decode_base64(data: bytes) -> bytes:
return standard_decode_base64(enforce_valid_base64(data))


def encode_base64(data: bytes) -> bytes:
return standard_encode_base64(data)


def decode_base64_url_safe(data: bytes) -> bytes:
return standard_decode_base64_url_safe(enforce_valid_base64(data))


def encode_base64_url_safe(data: bytes) -> bytes:
return standard_encode_base64_url_safe(data)


def decode_base64_string(
string: str, encoding: str = DEFAULT_ENCODING, errors: str = DEFAULT_ERRORS
) -> str:
return decode_base64(string.encode(encoding, errors)).decode(encoding, errors)


def encode_base64_string(
string: str, encoding: str = DEFAULT_ENCODING, errors: str = DEFAULT_ERRORS
) -> str:
return encode_base64(string.encode(encoding, errors)).decode(encoding, errors)


def decode_base64_string_url_safe(
string: str, encoding: str = DEFAULT_ENCODING, errors: str = DEFAULT_ERRORS
) -> str:
return decode_base64_url_safe(string.encode(encoding, errors)).decode(encoding, errors)


def encode_base64_string_url_safe(
string: str, encoding: str = DEFAULT_ENCODING, errors: str = DEFAULT_ERRORS
) -> str:
return encode_base64_url_safe(string.encode(encoding, errors)).decode(encoding, errors)
```

[base64]: https://en.wikipedia.org/wiki/Base64
Loading