X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fserverlist.h;h=4a0bd5efacef66b524cbd38b7f967dd174a20d58;hb=d82d18bfb1a51e0f2f0a89999474e98890addf7e;hp=52549e97a78e527f9dc3ca1ca5e9c2f1080e079b;hpb=f9a8efb99235c86eb61b6deb2bc034d5618e45ea;p=minetest.git diff --git a/src/serverlist.h b/src/serverlist.h index 52549e97a..4a0bd5efa 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,21 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include "config.h" -#include "json/json.h" +#include "content/mods.h" +#include -#ifndef SERVERLIST_HEADER -#define SERVERLIST_HEADER - -typedef Json::Value ServerListSpec; +#pragma once namespace ServerList { - std::vector getLocal(); - #if USE_CURL - std::vector getOnline(); - #endif - bool deleteEntry(ServerListSpec server); - bool insert(ServerListSpec server); - std::vector deSerialize(std::string liststring); - std::string serialize(std::vector); - std::vector deSerializeJson(std::string liststring); - std::string serializeJson(std::vector); - #if USE_CURL - void sendAnnounce(std::string action = "", u16 clients = 0); - #endif -} //ServerList namespace - +#if USE_CURL +enum AnnounceAction {AA_START, AA_UPDATE, AA_DELETE}; +void sendAnnounce(AnnounceAction, u16 port, + const std::vector &clients_names = std::vector(), + double uptime = 0, u32 game_time = 0, float lag = 0, + const std::string &gameid = "", const std::string &mg_name = "", + const std::vector &mods = std::vector(), + bool dedicated = false); #endif + +} // namespace ServerList