]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/serverlist.h
make formspec textarea wordwrap
[dragonfireclient.git] / src / serverlist.h
index a040d53e30ce1f5c1367d9fcf740e39d78e561d9..915e8482f039fe5d8ded0df33657ed12900b5d7f 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,17 +19,13 @@ 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
 #define SERVERLIST_HEADER
 
-struct ServerListSpec
-{
-       std::string name;
-       std::string address;
-       std::string port;
-       std::string description;
-};
+typedef Json::Value ServerListSpec;
 
 namespace ServerList
 {
@@ -41,6 +37,13 @@ namespace ServerList
        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>);
+       #if USE_CURL
+       void sendAnnounce(std::string action = "", const std::vector<std::string> & clients_names = std::vector<std::string>(), 
+                               double uptime = 0, u32 game_time = 0, float lag = 0, std::string gameid = "", 
+                               std::vector<ModSpec> mods = std::vector<ModSpec>());
+       #endif
 } //ServerList namespace
 
 #endif