| File | Language | Author(s) | Copyright |
|---|---|---|---|
| services/dice/DiceService.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023 Brick Mill Games, LLC, All rights reserved. |
| services/dice/InfoService.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023 Brick Mill Games, LLC, All rights reserved. |
| contracts/dice/DiceServiceContract.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023, Brick Mill Games, LLC, all rights reserved. |
| contracts/dice/InfoServiceContract.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023, Brick Mill Games, LLC, all rights reserved. |
| lib/dice/DiceManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/dice/DiceManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides an API for Brick Mill Games' dice server.
quickroll → Hash
rolldice → Hash
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| services/dice/DiceService.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023 Brick Mill Games, LLC, All rights reserved. |
This module is responsible for defining the DiceService API to the outside world.
new(crux_env)
This class constructor simply calls the CoreService constructor to set up logging and other common service routines.bbr(ipaddr, input) → Hash <crux-service>
This method is used to generate a Britannia Battle Resolver request.Javascript Example (via crux.js module):
crux.loadRegistry({
…
bbr: { url: '/t/dice/bbr', params: [ 'rid','mode','turn','territory','stoppage','atk_nation','atk_armies','atk_cavalry_armies','atk_leader','atk_mixed','def_nation','def_armies','def_cavalry_armies','def_leader','def_mixed','def_fort','description','subject','recipients' ] },
})
…
crux.call('bbr', rid, mode, turn, territory, stoppage, atk_nation, atk_armies, atk_cavalry_armies, atk_leader, atk_mixed, def_nation, def_armies, def_cavalry_armies, def_leader, def_mixed, def_fort, description, subject, recipients, (jr) => {
// jr is the return Hash as a JS Object
})
getlog(ipaddr, input) → Hash <crux-service>
This method is used to generate a single Dice Service Log message.Javascript Example (via crux.js module):
crux.loadRegistry({
…
getlog: { url: '/t/dice/getlog', params: [ 'lid' ] },
})
…
crux.call('getlog', lid, (jr) => {
// jr is the return Hash as a JS Object
})
loglist(ipaddr, input) → Hash <crux-service>
This method is used to generate a list of Dice Service Log messages.Javascript Example (via crux.js module):
crux.loadRegistry({
…
loglist: { url: '/t/dice/loglist', params: [ 'within' ] },
})
…
crux.call('loglist', within, (jr) => {
// jr is the return Hash as a JS Object
})
quickroll(ipaddr, input) → Hash <crux-service>
This method is used to generate a single dice roll for display to the web page.Javascript Example (via crux.js module):
crux.loadRegistry({
…
quickroll: { url: '/t/dice/quickroll', params: [ 'rid','sides','ndice' ] },
})
…
crux.call('quickroll', rid, sides, ndice, (jr) => {
// jr is the return Hash as a JS Object
})
rolldice(ipaddr, input) → Hash <crux-service>
This method is used to generate a one or more dice rolls for display to the web page and for transmission via email.Javascript Example (via crux.js module):
crux.loadRegistry({
…
rolldice: { url: '/t/dice/rolldice', params: [ 'rid','sides','ndice','nrolls','mods','description','subject','recipients' ] },
})
…
crux.call('rolldice', rid, sides, ndice, nrolls, mods, description, subject, recipients, (jr) => {
// jr is the return Hash as a JS Object
})
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| contracts/dice/DiceServiceContract.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023, Brick Mill Games, LLC, all rights reserved. |
SERVICE_CONTRACT <read-only>
The SERVICE_CONTRACT is a Hash whose keys are the method names of the service. The values of each key is a HASH of data parameters and their associated expected types and constraints.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| services/dice/InfoService.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023 Brick Mill Games, LLC, All rights reserved. |
This module is responsible for defining the InfoService API to the outside world.
new(crux_env)
This class constructor simply calls the CoreService constructor to set up logging and other common service routines.email(ipaddr, input) → Hash <crux-service>
This method simply loads the bmg support email address for transmission to the web page.Javascript Example (via crux.js module):
crux.loadRegistry({
…
email: { url: '/t/info/email', params: [ ] },
})
…
crux.call('email', (jr) => {
// jr is the return Hash as a JS Object
})
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| contracts/dice/InfoServiceContract.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023, Brick Mill Games, LLC, all rights reserved. |
SERVICE_CONTRACT <read-only>
The SERVICE_CONTRACT is a Hash whose keys are the method names of the service. The values of each key is a HASH of data parameters and their associated expected types and constraints.