* Request the content list for the given type. * @param type The content type to request the list for. */
| 173 | * @param type The content type to request the list for. |
| 174 | */ |
| 175 | void ClientNetworkContentSocketHandler::RequestContentList(ContentType type) |
| 176 | { |
| 177 | if (type == CONTENT_TYPE_END) { |
| 178 | this->RequestContentList(CONTENT_TYPE_BASE_GRAPHICS); |
| 179 | this->RequestContentList(CONTENT_TYPE_BASE_MUSIC); |
| 180 | this->RequestContentList(CONTENT_TYPE_BASE_SOUNDS); |
| 181 | this->RequestContentList(CONTENT_TYPE_SCENARIO); |
| 182 | this->RequestContentList(CONTENT_TYPE_HEIGHTMAP); |
| 183 | this->RequestContentList(CONTENT_TYPE_AI); |
| 184 | this->RequestContentList(CONTENT_TYPE_AI_LIBRARY); |
| 185 | this->RequestContentList(CONTENT_TYPE_GAME); |
| 186 | this->RequestContentList(CONTENT_TYPE_GAME_LIBRARY); |
| 187 | this->RequestContentList(CONTENT_TYPE_NEWGRF); |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | this->Connect(); |
| 192 | |
| 193 | auto p = std::make_unique<Packet>(this, PACKET_CONTENT_CLIENT_INFO_LIST); |
| 194 | p->Send_uint8 ((uint8_t)type); |
| 195 | p->Send_uint32(0xffffffff); |
| 196 | p->Send_uint8 (1); |
| 197 | p->Send_string("vanilla"); |
| 198 | p->Send_string(_openttd_content_version); |
| 199 | |
| 200 | /* Patchpacks can extend the list with one. In BaNaNaS metadata you can |
| 201 | * add a branch in the 'compatibility' list, to filter on this. If you want |
| 202 | * your patchpack to be mentioned in the BaNaNaS web-interface, create an |
| 203 | * issue on https://github.com/OpenTTD/bananas-api asking for this. |
| 204 | |
| 205 | p->Send_string("patchpack"); // Or what-ever the name of your patchpack is. |
| 206 | p->Send_string(_openttd_content_version_patchpack); |
| 207 | |
| 208 | */ |
| 209 | |
| 210 | this->SendPacket(std::move(p)); |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * Request the content list for a given number of content IDs. |
no test coverage detected