что тут написано "I'm mostly done with the user interface and filter implementation. I…
- User
что тут написано "I'm mostly done with the user interface and filter implementation. I updated the screenshots and descriptions in the comment above.
Following are my proposed changes for the server-side so the client gets all the necessary community information. Communities in info json
The following key should be added to the info json root object:
"communities" : { "ddnet" : { "name" : "DDraceNetwork", "servers-key" : "servers", "ranks-key" : "maps", "icon-sha256" : "" }, "kog" : { "name" : "King of Gores", "servers-key" : "servers-kog", "ranks-key" : "", "icon-sha256" : "" } }
The key of each entry is the "community ID". These should be short and unique. These values are used internally to identify communities and for the community filter config variable.
The ID "ddnet" is reserved and hard-coded to be used to join a tutorial server automatically. We could also make this dynamic though, by setting a boolean in the info json.
A community "None" (with ID "none") is hard-coded and always added automatically on the client-side. It should not be included in the info json.
The attribute "name" defines the name of the community that is displayed in the UI.
The attribute "servers-key" defines the name of the key in the info json root object that stores this community's servers. The idea would be to continue to current system of putting each community's servers in its own json object.
The attribute "ranks-key" defines the name of the key in the info json root object that stores this community's ranks (maps that were finished by the player name, assuming a player name was provided with the request). Should be empty string if the community does not provide ranks.
The attribute "icon-sha256" defines the SHA256 of the icon for this community. This is included so the icons will only be downloaded when necessary and not with every serverlist refresh.
Anything that does not conform to this format will result in the community entry being discarded.
For backwards-compatibility with previous clients, it would be better to duplicate the current key "servers" and then split the copy into "servers-ddnet", which only contains our own servers, and other lists for servers from other communities. That way old clients will still use the old "servers" that includes the non-DDNet servers. Community icons
The community icons should be 128x64 pixel RGBA PNG images. They should be compatible with pnglite due to the warning popup being shown otherwise.
I'm using these as placeholes images:
DDNet: ddnet KoG: kogThe following key should be added to the info json root object:
"community-icons-download-url" : ""
The individual community icons are then downloaded by the client from URLs of the format community-icons-download-url/communityId.png, by combining the download URL with the community ID.
- Assistant
В данном тексте описывается процесс завершения работы над пользовательским интерфейсом и реализацией фильтров, а также предлагаются изменения для серверной части, чтобы клиент мог получать всю необходимую информацию о сообществах (communities) в формате JSON.
Основные моменты текста:
-
Структура JSON:
- В корневом объекте JSON должны быть добавлены детали о сообществах. Каждое сообщество имеет свой уникальный идентификатор (ID) и содержит следующие атрибуты:
- name: название сообщества, отображаемое в интерфейсе.
- В корневом объекте JSON должны быть добавлены детали о сообществах. Каждое сообщество имеет свой уникальный идентификатор (ID) и содержит следующие атрибуты:
-
- User
а тут "The community information and icons come from https://info.ddnet.org/info and the URL specified in there. You can try your own communities and icons locally by adding the information in your local ddnet-info.json and adding the icon file to the communityicons folder in your config directory. For testing, you have to mark the ddnet-info.json file as read-only so it's not automatically overridden by the downloaded info. Information about the new json entries can be found in #5654 (comment).
The community icons should be 128x64 pixel RGBA PNG images. They should be compatible with pnglite due to the warning popup being shown otherwise. Please first test the icon locally to ensure that it looks good at the resolution displayed in the client and that it fits together with the other images."
- Assistant
В данном тексте приводится информация о том, как использовать данные о сообществах и иконках, предоставляемые по URL, и как протестировать собственные сообщества и иконки локально.
Основные моменты:
-
Источник информации:
- Информация о сообществах и их иконках берется с URL: https://info.ddnet.org/info и указанного в нем URL.
-
Локальное тестирование:
- Для тестирования собственных сообществ и иконок можно добавить данные в локальный файл
ddnet-info.jsonи поместить иконку в папкуcommunityiconsв директории конфигурации. - Важно сделать файл
ddnet-info.jsonрежимом 'только для чтения', чтобы он не был автоматически перезаписан загруженной информацией.
- Для тестирования собственных сообществ и иконок можно добавить данные в локальный файл
-
Иконки сообществ:
-
- User
а как создать своё сообщество
- Assistant