-/* cmd_neonserv_netinfo.c - NeonServ v5.0
+/* cmd_neonserv_netinfo.c - NeonServ v5.2
* Copyright (C) 2011 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
int chanuser_count = getChanUserCount();
float chanuser_memory = chanuser_count * sizeof(struct ChanUser);
float total_memory = channel_memory + channel_ban_memory + user_memory + chanuser_memory;
-
content[0] = get_language_string(user, "NS_NETINFO_CACHE");
sprintf(tmp, "%.2f kB (%.2f MB)", total_memory / 1024, total_memory / 1024 / 1024);
content[1] = tmp;
table_add(table, content);
-
content[0] = get_language_string(user, "NS_NETINFO_CHANNEL");
sprintf(tmp, "%d %.2f kB (%d * %u B = %.2f kB)", channel_count, channel_memory / 1024, channel_count, (unsigned int) sizeof(struct ChanNode), channel_memory / 1024);
content[1] = tmp;
table_add(table, content);
-
content[0] = get_language_string(user, "NS_NETINFO_CHANNEL_BAN");
sprintf(tmp, "%d %.2f kB (%d * %u B = %.2f kB)", channel_ban_count, channel_ban_memory / 1024, channel_ban_count, (unsigned int) sizeof(struct BanNode), channel_ban_memory / 1024);
content[1] = tmp;
table_add(table, content);
-
content[0] = get_language_string(user, "NS_NETINFO_USER");
sprintf(tmp, "%d %.2f kB (%d * %u B = %.2f kB)", user_count, user_memory / 1024, user_count, (unsigned int) sizeof(struct UserNode), user_memory / 1024);
content[1] = tmp;
table_add(table, content);
-
content[0] = get_language_string(user, "NS_NETINFO_CHANUSER");
sprintf(tmp, "%d %.2f kB (%d * %u B = %.2f kB)", chanuser_count, chanuser_memory / 1024, chanuser_count, (unsigned int) sizeof(struct ChanUser), chanuser_memory / 1024);
content[1] = tmp;
table_add(table, content);
if(strcmp(revision, ""))
- sprintf(tmp, "%s (%s)", NEONSERV_VERSION, revision);
+ sprintf(tmp, "%s.%d (%s)", NEONSERV_VERSION, patchlevel, revision);
else
- strcpy(tmp, NEONSERV_VERSION);
+ sprintf(tmp, "%s.%d", NEONSERV_VERSION, patchlevel);
content[0] = get_language_string(user, "NS_NETINFO_VERSION");
content[1] = tmp;
table_add(table, content);