]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/serverlist.h
Fix for commit 87dcee6 It uses the wrong variable and only covers some use cases...
[dragonfireclient.git] / src / serverlist.h
index 52549e97a78e527f9dc3ca1ca5e9c2f1080e079b..8ffea44cc70e579f69f678fc6e0742aa2fd8b4c1 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include <iostream>
 #include "config.h"
+#include "mods.h"
 #include "json/json.h"
 
 #ifndef SERVERLIST_HEADER
@@ -29,18 +30,21 @@ typedef Json::Value ServerListSpec;
 namespace ServerList
 {
        std::vector<ServerListSpec> getLocal();
-       #if USE_CURL
        std::vector<ServerListSpec> getOnline();
-       #endif
-       bool deleteEntry(ServerListSpec server);
-       bool insert(ServerListSpec server);
-       std::vector<ServerListSpec> deSerialize(std::string liststring);
-       std::string serialize(std::vector<ServerListSpec>);
-       std::vector<ServerListSpec> deSerializeJson(std::string liststring);
-       std::string serializeJson(std::vector<ServerListSpec>);
+       bool deleteEntry(const ServerListSpec &server);
+       bool insert(const ServerListSpec &server);
+       std::vector<ServerListSpec> deSerialize(const std::string &liststring);
+       const std::string serialize(const std::vector<ServerListSpec> &serverlist);
+       std::vector<ServerListSpec> deSerializeJson(const std::string &liststring);
+       const std::string serializeJson(const std::vector<ServerListSpec> &serverlist);
        #if USE_CURL
-       void sendAnnounce(std::string action = "", u16 clients = 0);
+       void sendAnnounce(const std::string &action, const u16 port,
+                       const std::vector<std::string> &clients_names = std::vector<std::string>(),
+                       const double uptime = 0, const u32 game_time = 0,
+                       const float lag = 0, const std::string &gameid = "",
+                       const std::string &mg_name = "",
+                       const std::vector<ModSpec> &mods = std::vector<ModSpec>());
        #endif
-} //ServerList namespace
+} // ServerList namespace
 
 #endif