Skip to content

Commit

Permalink
Added game id field in status.xml output
Browse files Browse the repository at this point in the history
Example:
...
		<Users>
		<Number>1</Number>
		<user><name>HarpyWar</name><clienttag>SEXP</clienttag><version>1.16.1.1</version></user>
<gameid>32</gameid></user>
		</Users>
		<Games>
		<Number>1</Number>
		<game><id>32</id><name>test</name><clienttag>SEXP</clienttag></game>
		</Games>
...
  • Loading branch information
HarpyWar committed Apr 16, 2012
1 parent 69976fe commit b989d26
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pvpgn/src/bnetd/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static int _glist_cb_xml(t_game *game, void *data)
{
char clienttag_str[5];

std::fprintf((std::FILE*)data,"\t\t<game><name>%s</name><clienttag>%s</clienttag></game>\n",game_get_name(game),tag_uint_to_str(clienttag_str,game_get_clienttag(game)));
std::fprintf((std::FILE*)data,"\t\t<game><id>%u</id><name>%s</name><clienttag>%s</clienttag></game>\n",game_get_id(game),game_get_name(game),tag_uint_to_str(clienttag_str,game_get_clienttag(game)));

return 0;
}
Expand Down Expand Up @@ -127,8 +127,12 @@ int output_standard_writer(std::FILE * fp)
{
conn = (t_connection*)elem_get_data(curr);
if (conn_get_account(conn))
std::fprintf(fp,"\t\t<user><name>%s</name><clienttag>%s</clienttag><version>%s</version></user>\n",conn_get_username(conn),tag_uint_to_str(clienttag_str,conn_get_clienttag(conn)),conn_get_clientver(conn));
}
std::fprintf(fp,"\t\t<user><name>%s</name><clienttag>%s</clienttag><version>%s</version>",conn_get_username(conn),tag_uint_to_str(clienttag_str,conn_get_clienttag(conn)),conn_get_clientver(conn));

if ((game = conn_get_game(conn)))
std::fprintf(fp,"<gameid>%u</gameid>", game_get_id(game));
fprintf(fp,"</user>\n");
}

std::fprintf(fp,"\t\t</Users>\n");
std::fprintf(fp,"\t\t<Games>\n");
Expand Down

0 comments on commit b989d26

Please sign in to comment.