diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-19 05:29:15 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-19 05:29:15 +0000 |
commit | bb1b08b0354620fad367c79471c99d7a836dc6e9 (patch) | |
tree | 5104836b8575f30d6a94220b03f335f237c08c8e /src | |
parent | 3eed8d802172a3488a6c4b6dc4de0601cd857207 (diff) |
Improved compatibility with the JSON-RPC specification; beware, major overhauls are afoot.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7742 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_rpc_json.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/modules/m_rpc_json.cpp b/src/modules/m_rpc_json.cpp index 0502c7cbd..c0e4e14d9 100644 --- a/src/modules/m_rpc_json.cpp +++ b/src/modules/m_rpc_json.cpp @@ -32,7 +32,8 @@ class ModuleRpcJson : public Module { void MthModuleVersion (HTTPRequest *http, json::Value &request, json::Value &response) { - std::string result = "GetVersion().ToString()"; + Version v = this->GetVersion(); + std::string result = ConvToStr(v.Major) + "." + ConvToStr(v.Minor) + "." + ConvToStr(v.Revision) + "." + ConvToStr(v.Build); response["result"] = result; } @@ -2079,9 +2080,14 @@ namespace json Value response (objectValue); Reader r; Writer w; - + + response["error"] = Value(nullValue); + response["result"] = Value(nullValue); + parse_success = r.parse (request_text, request_text + strlen (request_text), request); - + + response["id"] = request["id"]; + service (http, request, response); text = w.write (response); |