Codechange: [Script] use nlohmann for Squirrel <-> JSON conversion (#11251)

This commit is contained in:
Patric Stout
2023-09-06 13:14:12 +02:00
committed by GitHub
parent 6e8d7964ed
commit 5f9b8aaa95
7 changed files with 131 additions and 266 deletions

View File

@@ -557,11 +557,6 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendConsole(const std::string
*/
NetworkRecvStatus ServerNetworkAdminSocketHandler::SendGameScript(const std::string_view json)
{
/* At the moment we cannot transmit anything larger than MTU. So we limit
* the maximum amount of json data that can be sent. Account also for
* the trailing \0 of the string */
if (json.size() + 1 >= NETWORK_GAMESCRIPT_JSON_LENGTH) return NETWORK_RECV_STATUS_OKAY;
Packet *p = new Packet(ADMIN_PACKET_SERVER_GAMESCRIPT);
p->Send_string(json);