SHARE
TWEET

Untitled

a guest Feb 11th, 2017 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // create
  2.     Json::Value server;
  3.     server["action"] = "start";
  4.     server["port"] = port;
  5.     if (g_settings->exists("server_address")) {
  6.         server["address"] = g_settings->get("server_address");
  7.     }
  8.     bool strict_checking = g_settings->getBool("strict_protocol_version_checking");
  9.         server["name"]         = g_settings->get("server_name");
  10.         server["description"]  = g_settings->get("server_description");
  11.         server["version"]      = g_version_string;
  12.         server["proto_min"]    = strict_checking ? LATEST_PROTOCOL_VERSION : SERVER_PROTOCOL_VERSION_MIN;
  13.         server["proto_max"]    = strict_checking ? LATEST_PROTOCOL_VERSION : SERVER_PROTOCOL_VERSION_MAX;
  14.         server["url"]          = g_settings->get("server_url");
  15.         server["creative"]     = g_settings->getBool("creative_mode");
  16.         server["damage"]       = g_settings->getBool("enable_damage");
  17.         server["password"]     = g_settings->getBool("disallow_empty_password");
  18.         server["pvp"]          = g_settings->getBool("enable_pvp");
  19.         server["uptime"]       = (int) uptime;
  20.         server["game_time"]    = game_time;
  21.         server["clients"]      = (int) clients_names.size();
  22.         server["clients_max"]  = g_settings->getU16("max_users");
  23.         server["clients_list"] = Json::Value(Json::arrayValue);
  24.         for (std::vector<std::string>::const_iterator it = clients_names.begin();
  25.                 it != clients_names.end();
  26.                 ++it) {
  27.             server["clients_list"].append(*it);
  28.         }
  29.         if (gameid != "") server["gameid"] = gameid;
  30. // Update
  31.     Json::Value server;
  32.     server["action"] = "update";
  33.     server["port"] = port;
  34.     if (g_settings->exists("server_address")) {
  35.         server["address"] = g_settings->get("server_address");
  36.     }
  37.     bool strict_checking = g_settings->getBool("strict_protocol_version_checking");
  38.         server["name"]         = g_settings->get("server_name");
  39.         server["description"]  = g_settings->get("server_description");
  40.         server["version"]      = g_version_string;
  41.         server["proto_min"]    = strict_checking ? LATEST_PROTOCOL_VERSION : SERVER_PROTOCOL_VERSION_MIN;
  42.         server["proto_max"]    = strict_checking ? LATEST_PROTOCOL_VERSION : SERVER_PROTOCOL_VERSION_MAX;
  43.         server["url"]          = g_settings->get("server_url");
  44.         server["creative"]     = g_settings->getBool("creative_mode");
  45.         server["damage"]       = g_settings->getBool("enable_damage");
  46.         server["password"]     = g_settings->getBool("disallow_empty_password");
  47.         server["pvp"]          = g_settings->getBool("enable_pvp");
  48.         server["uptime"]       = (int) uptime;
  49.         server["game_time"]    = game_time;
  50.         server["clients"]      = (int) clients_names.size();
  51.         server["clients_max"]  = g_settings->getU16("max_users");
  52.         server["clients_list"] = Json::Value(Json::arrayValue);
  53.         for (std::vector<std::string>::const_iterator it = clients_names.begin();
  54.                 it != clients_names.end();
  55.                 ++it) {
  56.             server["clients_list"].append(*it);
  57.         }
  58.         if (gameid != "") server["gameid"] = gameid;
  59.         server["lag"] = lag;
  60. //delete
  61.     Json::Value server;
  62.     server["action"] = "delete";
  63.     server["port"] = port;
  64.     if (g_settings->exists("server_address")) {
  65.         server["address"] = g_settings->get("server_address");
  66.     }
  67.     server["lag"] = lag;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top