*** VERSION 5.2.0 ***
[NeonServV5.git] / src / cmd_neonserv_netinfo.c
index c8fd1b643d87ecaa4fea62678e2e0ca9912c8765..5f2d306885ecf5c94480950fcc3164729cf7c4f0 100644 (file)
@@ -1,3 +1,19 @@
+/* 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
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License 
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. 
+ */
 
 #include "cmd_neonserv.h"
 
@@ -45,29 +61,24 @@ CMD_BIND(neonserv_cmd_netinfo) {
     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 * %lu B = %.2f kB)", channel_count, channel_memory / 1024, channel_count, sizeof(struct ChanNode), channel_memory / 1024);
+    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 * %lu B = %.2f kB)", channel_ban_count, channel_ban_memory / 1024, channel_ban_count, sizeof(struct BanNode), channel_ban_memory / 1024);
+    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 * %lu B = %.2f kB)", user_count, user_memory / 1024, user_count, sizeof(struct UserNode), user_memory / 1024);
+    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 * %lu B = %.2f kB)", chanuser_count, chanuser_memory / 1024, chanuser_count, sizeof(struct ChanUser), chanuser_memory / 1024);
+    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);
     
@@ -134,9 +145,9 @@ CMD_BIND(neonserv_cmd_netinfo) {
     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);