Browse Source

Expanded player list output and fixed bug

pull/6/head
Sarah Evans 6 years ago
parent
commit
e945134135
  1. 22
      RenX.ServerList/RenX_ServerList.cpp

22
RenX.ServerList/RenX_ServerList.cpp

@ -450,7 +450,7 @@ void RenX_ServerListPlugin::addServerToServerList(RenX::Server &server)
// append to server_list_json // append to server_list_json
if (RenX_ServerListPlugin::server_list_json.isEmpty()) if (RenX_ServerListPlugin::server_list_json.size() <= 2)
{ {
RenX_ServerListPlugin::server_list_json = '['; RenX_ServerListPlugin::server_list_json = '[';
RenX_ServerListPlugin::server_list_json += server_as_json(server); RenX_ServerListPlugin::server_list_json += server_as_json(server);
@ -533,17 +533,15 @@ void RenX_ServerListPlugin::addServerToServerList(RenX::Server &server)
auto node = server.players.begin(); auto node = server.players.begin();
while (node != server.players.end()) if (node != server.players.end())
{
if (node->isBot == false)
{ {
server_json_block += "{\"Name\":\""_jrs; server_json_block += "{\"Name\":\""_jrs;
server_json_block += jsonify(node->name); server_json_block += jsonify(node->name);
server_json_block += "\"}"_jrs; server_json_block += "\", \"isBot\":"_jrs;
server_json_block += json_bool_as_cstring(node->isBot);
++node; server_json_block += ", \"Team\":"_jrs;
break; server_json_block.aformat("%d", static_cast<int>(node->team));
} server_json_block += "}"_jrs;
++node; ++node;
} }
@ -552,7 +550,11 @@ void RenX_ServerListPlugin::addServerToServerList(RenX::Server &server)
{ {
server_json_block += ",{\"Name\":\""_jrs; server_json_block += ",{\"Name\":\""_jrs;
server_json_block += jsonify(node->name); server_json_block += jsonify(node->name);
server_json_block += "\"}"_jrs; server_json_block += "\", \"isBot\":"_jrs;
server_json_block += json_bool_as_cstring(node->isBot);
server_json_block += ", \"Team\":"_jrs;
server_json_block.aformat("%d", static_cast<int>(node->team));
server_json_block += "}"_jrs;
++node; ++node;
} }

Loading…
Cancel
Save