mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 10:58:20 +00:00
TCP cleanup, added basis of web interface
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#include "web_interface_eqw.h"
|
||||
#include "web_interface.h"
|
||||
#include "world_config.h"
|
||||
#include "login_server_list.h"
|
||||
|
||||
extern LoginServerList loginserverlist;
|
||||
|
||||
void EQW__IsLocked(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
||||
Json::Value ret = WorldConfig::get()->Locked;
|
||||
i->SendResponse(id, ret);
|
||||
}
|
||||
|
||||
void EQW__Lock(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
||||
WorldConfig::LockWorld();
|
||||
if (loginserverlist.Connected()) {
|
||||
loginserverlist.SendStatus();
|
||||
}
|
||||
|
||||
Json::Value ret;
|
||||
ret["status"] = "complete";
|
||||
i->SendResponse(id, ret);
|
||||
}
|
||||
|
||||
void EQW__Unlock(WebInterface *i, const std::string& method, const std::string& id, const Json::Value& params) {
|
||||
WorldConfig::UnlockWorld();
|
||||
if (loginserverlist.Connected()) {
|
||||
loginserverlist.SendStatus();
|
||||
}
|
||||
|
||||
Json::Value ret;
|
||||
ret["status"] = "complete";
|
||||
i->SendResponse(id, ret);
|
||||
}
|
||||
|
||||
void RegisterEQW(WebInterface *i)
|
||||
{
|
||||
i->AddCall("IsLocked", std::bind(EQW__IsLocked, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
|
||||
i->AddCall("Lock", std::bind(EQW__Lock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
|
||||
i->AddCall("Unlock", std::bind(EQW__Unlock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
|
||||
}
|
||||
Reference in New Issue
Block a user