probity
v1.2.10
Published
Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.
Downloads
924
Maintainers
Readme
probity
Reliable and ultra-fast generator of compbinations for slot games.
The basics
All operations are synchrous.
For high-loaded projects it's recommended to run several probity modules simultaneously.
The module should allways be loaded, and process requests from cliens as they arrive.
You may setup simple HTTP server for that, for example.
Overview
Probity is a high-performance slot combination generator.
See how it works here.
System requirements
- linux or windows operation system
- intel/amd x64 processor
API
The module exports two methods:
load ( options )
Loads module.
There is optional parameter to initialize module.
See set_options action below.
action ( request )
Executes the action.request is expected to be JSON.
Return value is JSON as well.
Actions
General rule is:
Request is always has the following structure:
{ "action": "action_name"
... some other parameters ...
}Reply is always looks like this:
{ "request": {
... request json ...
},
"success": true
... some other data ...
}or
{ "error": 3
}See possible error codes below.
set_options
{ "action": "set_options",
"log": {
"file": "/path/to/file.log",
"stdout": true
}
}log.file is file for log storage. Specify null or skip it if log should not be stored.log.stdout is true to print error messages to stdout.
expected reply:
{ "success": true
}set_game_definition
{ "action": "set_options",
"game_id": "",
"definition": "",
"context": ""
}game_id is unique game id stringdefinition is game definition stringcontext is game context string saved during previous probity session.
It's important to keep and restore game context string, as the module use it to generate combinations.
expected reply:
{ "success": true
}select_game
{ "action": "select_game",
"game_id": "",
"session_id": "",
"session_data": ""
}game_id is game id stringsession_id some unique string used to distinguish player sessionssession_data player session data string
It's important to save and restore player session data between sessions.
Some games use it to keep context of the game. For example, bonus game
may begin in one session, and continue in another one.
expected reply:
{ "success": true
"combination": {
...
}
}combination is the combination player got in previous session.
get_game_context
{ "action": "get_game_context",
"game_id": ""
}expected reply:
{ "success": true
"context": "player_session_context_string"
}game_id is game id string
get_combination
{ "action": "get_combination",
"session_id": "",
"bet_sum": 9.95
}session_id is player session idbet_sum is bet sumtest optional reels array to be used instead of generating them.
Test reels are used for in game developmend to generate different game situations.
It's your responsitility to take care about not using this in production mode.
{ "success": true,
"combination": {
"reels": [
...
],
"win": [
{ ... },
{ ... },
{ ... }
...
],
"total": {
"bet": 9.95,
"win": 15.50,
}
}
}combination is the combination generates with all the winning results (if any).reels are the reels randomly generated.win is array of objects, where every object is game event occured.total.bet is actual bet sum that must be deducted from player balance.total.win is actual win sum that must be added to player balance.
get_session_data
{ "action": "get_session_data",
"session_id": ""
}session_id is player session id
This requests player session data.
It's recommended to request and store it after every bet.
expected reply:
{ "success": true,
"session_data": "session data string"
}get_game_list
{ "action": "get_session_data"
}This returns list of available games.
expected reply:
{ "success": true,
"game_list": [
"first_game_id",
"second_game_id",
"and so on"
]
}Possible use case
Possible and recommended scenario of using probity:
load module
send
set_optionsto initialize itsend
set_game_definitionseveral times to load gameswait for player request(s)
player selects the game with
select_gameplayer generates the combinations with
get_combinationplayer session is stored using
get_session_datagoto 4
Steps 1-3 are executed only once at the beginning.
Steps 4-8 are repeated many times for every player.
Error codes
1: unexpected (unknown) error
2: json is broken
3: incorrect action
4: wrong request, incorrect parameter
5: api key is incorrect
6: game definition is incorrect
7: game context is incorrect
8: player session id not found or incorrect
9: player session data is incorrect
10: unknown game
11: error generating combination
API key
Probity module works without API key.
In this case there is the only restriction: only 8 player sessions are allowed per hour.
Please contact the author if you have any questions.
