Giter VIP home page Giter VIP logo

bcdice-api's Introduction

BCDice-API

BCDiceを提供するWebAPIサーバー

Action Status Docker repository

Public servers

有志によって運営されている公開サーバーの一覧

https://api-status.bcdice.org/

What is BCDice

BCDiceは日本のTRPGセッションツールにおいて、デファクトスタンダードとも言えるダイスロールエンジンです。 初めは、Faceless氏によってPerlを用いて作成されました。後に、たいたい竹流氏によってRubyへの移植され、現在までメンテナンスされています。

BCDiceはどどんとふをはじめとして、TRPGオンラインセッションSNSOnset!においてダイスロールエンジンとして使われています。

Setup

$ git clone https://github.com/bcdice/bcdice-api.git
$ cd bcdice-api
$ git checkout `git describe --abbrev=0` #直近のリリースに移動
$ git submodule init
$ git submodule update
$ bundle install

Run

Development

$ bundle exec rackup

Production

$ APP_ENV=production bundle exec rackup -E deployment

実際に運用する場合には、Pumaの利用をお勧めします。

公開サーバーとして運用する場合、 /v2/admin の情報を設定するようにしてください。

API

/v2

Method Description
/v2/version BCDiceとAPIサーバーのバージョン
/v2/admin APIサーバ提供者の名前と連絡先
/v2/game_system ゲームシステムの一覧
/v2/game_system/{id} ゲームシステムの情報
/v2/game_system/{id}/roll ダイスロール
/v2/original_table オリジナル表の実行

Plugin

plugins/ ディレクトリにダイスボットのコードを入れておくと、サーバー起動時にロードし、使うことができます。 既存のダイスボットを上書きすることもできます。

Documents

Cases

Donate

The Auther

酒田 シンジ (@ysakasin)

bcdice-api's People

Contributors

blhsrwznrghfzpr avatar daicyan avatar dependabot[bot] avatar h-mikisato avatar koi-chan avatar kumakaba avatar nkmr6194 avatar ochaochaocha3 avatar ysakasin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bcdice-api's Issues

不正なコマンドを受け取った際のエラーハンドリング

どどんとふ公式鯖で受け取っているDiceBotのかなりの数が、Command=部分に普通のチャットメッセージ等が挿入されていて、その際に「NoMethodError - undefined method `gsub' for nil:NilClass:」や「CommandError - CommandError:」のExceptionのログが大量に吐かれてしまいます。
API的には400を返して終わりなので利用者や開発者側から気がつくことなくサーバー側にかなりの量のログが溜まってしまうので、この部分のエラーをTRAPするようにする等はできないでしょうか?

Setupの方法について、Readmeの更新提案

はじめまして。初issueゆえ拙い部分があると思われますが、ご指摘頂けると助かります。
まとめると、Readmeの
$ bundle exec rackup

$ bundle exec rackup -o 0.0.0.0
に差し替える提案についてです。

自宅のCentos7サーバにLAN内のWindows10マシンから遠隔で配置を試みまして、Setupの最後の部分で詰まっていました。
$ bundle exec rackup
この通りにコマンドを入力するとLAN内外問わず接続ができない状態でした。このとき他のサービスは通常通り使えています。
調べましたところ、このようなページがヒットしました。
sinatraでrackupからの起動でlocalhost以外からの接続を許可しようとしたらハマった件
このページの通りに先程のコマンドを
$ bundle exec rackup -o 0.0.0.0
と置き換えて実行したところ、無事LAN内外問わず動作していることを確認できました。
今はサービス化まで済ませています。
よろしくおねがいします。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.