Project

General

Profile

Idea-rpc » History » Version 2

David Demelier, 01/08/2019 10:11 AM

1 1 David Demelier
h1. Idea: RPC
2
3
* *Impact* : plugins and irccdctl
4
* *Status* : draft
5
* *Target version* : 3.1.0
6
7
h1. Background
8
9
Irccd plugins are currently fully standalone and can not interact with each other. Also, user is not able to control a plugin except by doing reload.
10
11
h1. Synopsis
12
13
The purpose of this project is to add a functionality in plugins to be able for the user to execute special commands.
14
15
Example: a hangman plugin is running, user wants to specify an explicit word for the next game. It can call irccdctl to set the next word.
16
17
h1. Proposed irccdctl usage
18
19
<pre>
20
$ irccdctl plugin-exec plugin command arg1 arg2 arg3 ... argn
21
</pre>
22
23
For hangman:
24
25
<pre>
26 2 David Demelier
$ irccdctl plugin-exec hangman set-next-word example "#hangman" "joke"
27 1 David Demelier
</pre>
28
29
h1. Proposed network command
30
31
<pre><code class="json">
32
{
33
    "command": "plugin-exec",
34
    "plugin": "hangman"
35
    "function": "set-next-word"
36 2 David Demelier
    "args": [ "joke", "example", "#hangman" ]
37 1 David Demelier
}
38
</code></pre>
39 2 David Demelier
40
h1. Standard plugin function additions
41
42
h2. Auth
43
44
* authenticate: force authentication on a given server
45
46
h2. Hangman
47
48
* set-next-word: set the next word for the given server/channel
49
* get-response: get the current word response
50
51
h2. History
52
53
* rehash: force storage of all server/channel/nicks timestamps
54
* seen: similar to !history seen
55
* said: similar to !history said