-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:cre-ne-jp/rgrb into trpg_kancolle
- Loading branch information
Showing
24 changed files
with
709 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Invite プラグインの設定 | ||
Invite: | ||
# JOIN 時に発言するメッセージ | ||
JoinMessage: | ||
- "ご招待いただきありがとう☆" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Atheme-Services 用サーバーリレー監視プラグインの設定 | ||
ServerConnectionReport::AthemeServices: | ||
# NOTICE を行うチャンネルの一覧 | ||
ChannelsToSend: | ||
- '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Charybdis 用サーバーリレー監視プラグインの設定 | ||
ServerConnectionReport::Charybdis: | ||
# NOTICE を行うチャンネルの一覧 | ||
ChannelsToSend: | ||
- '' | ||
|
||
# 反応すべきメッセージの送信者の一覧 | ||
AllowedSenders: | ||
- irc.cre.jp | ||
- irc.r-roman.net | ||
- services.cre.jp | ||
- irc.egotex.net | ||
- t-net.xyz | ||
- irc.sougetu.net | ||
- irc.kazagakure.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ngIRCd 用サーバーリレー監視プラグインの設定 | ||
ServerConnectionReport::Ngircd: | ||
# NOTICE を行うチャンネルの一覧 | ||
ChannelsToSend: | ||
- '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Invite | ||
====== | ||
|
||
RGRB が INVITE (招待)されたとき、そのチャンネルに JOIN するプラグインです。JOIN 時に特定のメッセージを発言することができます。 | ||
|
||
コマンド | ||
-------- | ||
|
||
コマンドはありません。INVITE されたとき、自動的に動作します。 | ||
|
||
設定 | ||
---- | ||
|
||
設定ファイルに以下を追加して、プラグインの設定を行います。 | ||
|
||
```yaml | ||
# Invite プラグインの設定 | ||
Invite: | ||
# INVITE された時、JOIN 時に発言するメッセージ | ||
JoinMessage: | ||
- "ご招待いただきありがとう☆" | ||
``` | ||
|
||
JoinMessage は、発言1行を1つの要素として、配列形式で記述してください。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,74 @@ | ||
ServerConnectionReport | ||
====================== | ||
|
||
IRC サーバの接続状態の変化を報告するプラグインです。 | ||
|
||
接続先の「&SERVER」チャンネルに書き込まれるメッセージを監視して IRC サーバの接続状態の変化を検知しています。 | ||
IRC サーバの接続状態の変化を報告するプラグインです。お使いの IRC デーモンに合わせて有効化するものを選択してください。 | ||
|
||
設定 | ||
---- | ||
|
||
設定ファイルのプラグインリストに、以下のいずれかを追加します。 | ||
|
||
```yaml | ||
Plugins: | ||
- ServerConnectionReport::Ngircd | ||
- ServerConnectionReport::Charybdis | ||
- ServerConnectionReport::AthemeServices | ||
``` | ||
|
||
以下で説明する、サーバの接続状態を報告するチャンネル(設定項目 `ChannelsToSend` で設定します)に JOIN しておかなければ、IRC サーバに発言が拒否されてプラグインが動作しないことがあります。 | ||
|
||
|
||
```yaml | ||
IRCBot: | ||
#### 省略 #### | ||
# JOIN するチャンネルの一覧 | ||
Channels: | ||
- '#cre' | ||
``` | ||
|
||
報告先チャンネルのモードに +n(チャンネルに入っていないクライアントからの発言を拒否する)を設定しないことでも動作可能となりますが、スパムメッセージを許すことにつながりかねないため、推奨されません。 | ||
|
||
IRC デーモンごとの動作・設定 | ||
---------------------------- | ||
|
||
### ngIRCd | ||
|
||
接続先の「&SERVER」チャンネルに書き込まれるメッセージを監視して IRC サーバの接続状態の変化を検知しています。 | ||
|
||
設定ファイルに以下を追加して、プラグインの設定を行います。 | ||
|
||
```yaml | ||
# サーバーリレー監視プラグインの設定 | ||
ServerConnectionReport: | ||
ServerConnectionReport::Ngircd: | ||
# NOTICE を行なうチャンネルの一覧 | ||
ChannelsToSend: | ||
- '#cre' | ||
``` | ||
|
||
### Charybdis | ||
|
||
charybdis は、初期設定では IRC サーバーオペレータ権(Oper)を持っている人に、サーバーメッセージで接続・切断などのステータスを送信するようになっています。このサーバーメッセージを検知します。 | ||
|
||
設定ファイルに以下を追加して、プラグインの設定を行います。 | ||
|
||
```yaml | ||
# Charybdis 用サーバーリレー監視プラグインの設定 | ||
ServerConnectionReport::Charybdis: | ||
# NOTICE を行うチャンネルの一覧 | ||
ChannelsToSend: | ||
- '#cre' | ||
``` | ||
|
||
### Atheme-Services | ||
|
||
Atheme-Services を利用している環境であれば、IRC デーモンの種類を問わずこのプラグインでサーバーの接続状態を検知できます。初期設定では「#services」チャンネルに情報が出力されます。RGRB がこのチャンネルに参加している必要があります。 | ||
|
||
設定ファイルに以下を追加して、プラグインの設定を行います。 | ||
|
||
```yaml | ||
# Atheme-Services 用サーバーリレー監視プラグインの設定 | ||
ServerConnectionReport::AthemeServices: | ||
# NOTICE を行うチャンネルの一覧 | ||
ChannelsToSend: | ||
- '#cre' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# vim: fileencoding=utf-8 | ||
|
||
require 'cinch' | ||
require 'rgrb/plugin/configurable_adapter' | ||
|
||
module RGRB | ||
module Plugin | ||
# INVITE されたとき、そのチャンネルに JOIN するプラグイン | ||
module Invite | ||
# Invite の IRC アダプター | ||
class IrcAdapter | ||
include Cinch::Plugin | ||
include ConfigurableAdapter | ||
|
||
set(plugin_name: 'Invite') | ||
listen_to(:invite, method: :invite) | ||
|
||
def initialize(*args) | ||
super | ||
|
||
config_data = config[:plugin] || {} | ||
@join_message = | ||
config_data['JoinMessage'] || [ 'ご招待いただきありがとう' ] | ||
end | ||
|
||
# 自分が INVITE されたら自動的にそのチャンネルに入る | ||
# @param [Cinch::Message] m 送信されたメッセージ | ||
# @return [void] | ||
def invite(m) | ||
Channel(m.channel).join | ||
@join_message.each do |message| | ||
m.target.send(message, true) | ||
log("<JOIN on #{m.channel}> #{message}", :outgoing, :info) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.