0
This repository has been archived on 2022-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
mc-protocol/src/docs/packets_serverside.rst

79 lines
2.2 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

От Сервера к Клиенту
====================
STATUS
------
StatusServerResponse
^^^^^^^^^^^^^^^^^^^^
Информация о Сервере.
+-------------+--------+-------------------------------------+
| Поле | Тип | Коментарий |
+=============+========+=====================================+
| Server info | String | Информация о сервере в JSON формате |
+-------------+--------+-------------------------------------+
В поле *Server info* находится JSON объект следующего вида:
.. code-block:: json
{
"version": {
"name": "1.8.7",
"protocol": 47
},
"players": {
"max": 20,
"online": 5,
"sample": [
{
"name": "Notch",
"id": "00000000-0000-0000-0000-000000000000"
}
]
},
"description": {
"text": "Hello world"
},
"favicon": "data:image/png;base64,<data>"
}
Подробнее: :download:`JSON Schema <_static/server_info.schema.json>`
.. _serverside_pingpacket:
PingPacket
^^^^^^^^^^
Пакет для обмена "пингом".
+---------+------+-------------+
| Поле | Тип | Коментарий |
+=========+======+=============+
| Payload | Long | Любое число |
+---------+------+-------------+
.. note::
| "Ванильный" сервер в *Payload* указывает текущее время в формате unixstamp.
| Но по факту в данное поле можно указать любое число: клиент всё равно обязан вернуть данный пакет "как есть".
LOGIN
-----
.. _serverside_disconnectpacket:
DisconnectPacket
^^^^^^^^^^^^^^^^
Отключение клиента сервером с указанием причины.
+--------+------+----------------------------------+
| Поле | Тип | Коментарий |
+========+======+==================================+
| Reason | Text | Причина отключения. Опционально. |
+--------+------+----------------------------------+