X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fserverlist.h;h=aa3f1d6104f6d31a2bcc7a78580cf82245b17958;hb=e5b4748bb44a12fd09a92f7d36986b4bda86e6bf;hp=a040d53e30ce1f5c1367d9fcf740e39d78e561d9;hpb=bcc0ca93d463ec7bdf6ff1ef621f7777014c404a;p=oweals%2Fminetest.git diff --git a/src/serverlist.h b/src/serverlist.h index a040d53e3..aa3f1d610 100644 --- a/src/serverlist.h +++ b/src/serverlist.h @@ -1,6 +1,6 @@ /* -Minetest-c55 -Copyright (C) 2011 celeron55, Perttu Ahola +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola 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,28 +19,31 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #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 { std::vector getLocal(); - #if USE_CURL std::vector getOnline(); + bool deleteEntry(const ServerListSpec &server); + bool insert(const ServerListSpec &server); + std::vector deSerialize(const std::string &liststring); + const std::string serialize(const std::vector &serverlist); + std::vector deSerializeJson(const std::string &liststring); + const std::string serializeJson(const std::vector &serverlist); + #if USE_CURL + void sendAnnounce(const std::string &action, + const std::vector &clients_names = std::vector(), + const double uptime = 0, const u32 game_time = 0, + const float lag = 0, const std::string &gameid = "", + const std::vector &mods = std::vector()); #endif - bool deleteEntry(ServerListSpec server); - bool insert(ServerListSpec server); - std::vector deSerialize(std::string liststring); - std::string serialize(std::vector); -} //ServerList namespace +} // ServerList namespace #endif