From 9e621cca11ae3cf1d54356a8910d9205fadbf0ee Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 13 Feb 2025 04:05:18 +0000 Subject: Add the new JSON-RPC module to compliment the XMLRPC one. --- docs/RPC/RPC | 30 ++++++++++++++++++++++++++++++ docs/RPC/XMLRPC | 29 ----------------------------- 2 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 docs/RPC/RPC delete mode 100644 docs/RPC/XMLRPC (limited to 'docs/RPC') diff --git a/docs/RPC/RPC b/docs/RPC/RPC new file mode 100644 index 000000000..a93d61af8 --- /dev/null +++ b/docs/RPC/RPC @@ -0,0 +1,30 @@ +RPC using JSON-RPC and XML-RPC (using PECL's xmlrpc_encode_request and xmlrpc_decode functions) is supported. + +This allows external applications, such as websites, to execute remote procedure calls to Anope in real time. + +Currently there are 5 supported RPC calls, provided by rpc_main: + +checkAuthentication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password + is correct for the account name, useful for making login pages on websites. + +command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command + to execute. This will execute the given command to Anope using the given service name. If the user given is online, the + command reply will go to them, if not it is returned by RPC. + +stats - Takes no parameters, returns miscellaneous stats that can be found in the /operserv stats command. + +channel - Takes one parameter, a channel name, and returns real time information regarding that channel, such as users, modes + (ban lists and such), topic etc. + +user - Takes one parameter, a user name, and returns real time information regarding that user. + +opers - Takes no parameters, returns opertypes, their privileges and commands. + +notice - Takes three parameters, source user, target user, and message. Sends a message to the user. + +RPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL +database, such as accounts and registered channel information. It is instead used for pulling realtime data such +as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/RPC. + +Also note that when using XMLRPC the parameter named "id" is reserved for query ID. If you pass a query to Anope containing a value for id. it will +be stored by Anope and the same id will be passed back in the result. diff --git a/docs/RPC/XMLRPC b/docs/RPC/XMLRPC deleted file mode 100644 index ac3f1059b..000000000 --- a/docs/RPC/XMLRPC +++ /dev/null @@ -1,29 +0,0 @@ -XMLRPC using PHP's xmlrpc_encode_request and xmlrpc_decode functions is supported. -This allows external applications, such as websites, to execute remote procedure calls to Anope in real time. - -Currently there are 5 supported XMLRPC calls, provided by rpc_main: - -checkAuthentication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password - is correct for the account name, useful for making login pages on websites. - -command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command - to execute. This will execute the given command to Anope using the given service name. If the user given is online, the - command reply will go to them, if not it is returned by XMLRPC. - -stats - Takes no parameters, returns miscellaneous stats that can be found in the /operserv stats command. - -channel - Takes one parameter, a channel name, and returns real time information regarding that channel, such as users, modes - (ban lists and such), topic etc. - -user - Takes one parameter, a user name, and returns real time information regarding that user. - -opers - Takes no parameters, returns opertypes, their privileges and commands. - -notice - Takes three parameters, source user, target user, and message. Sends a message to the user. - -XMLRPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL -database, such as accounts and registered channel information. It is instead used for pulling realtime data such -as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/XMLRPC. - -Also note that the parameter named "id" is reserved for query ID. If you pass a query to Anope containing a value for id. it will -be stored by Anope and the same id will be passed back in the result. -- cgit