| File | Language | Author(s) | Copyright |
|---|---|---|---|
| config.ru | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| crux-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
| dice-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
| tocs-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
| syslib/CoreService.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022 Brick Mill Games, LLC, All rights reserved. |
| syslib/CruxConfig.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023 Brick Mill Games, LLC, All rights reserved. |
| syslib/CruxContractManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| syslib/CruxResource.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022 Brick Mill Games, LLC, All rights reserved. |
| syslib/CruxServiceManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/BBRCombatManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/DatabaseManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/Emailer.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/InfoManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/MTRManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/MersenneTwister.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/SessionManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/StorageManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| slib/UIDManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| lib/crux/APIManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2023 Brick Mill Games, LLC, All rights reserved. |
| lib/crux/AuthManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
| lib/crux/SysUserManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2023 Brick Mill Games, LLC, All rights reserved. |
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/crux/APIManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2023 Brick Mill Games, LLC, All rights reserved. |
This module is responsible for all Crux development and administration activities.
This manager is a Crux system library used to support Crux-level administration and service development activities.
generate_service_call(paths, group, service, method, language, cvarname) → Hash
This method will generate a source code snippet in a specified language to aid in software development.get_crux_site_map → Hash
This class method returns a list of URL mappings used by this Crux installation.get_service_groups(paths) → Array<String>
This class method returns a list of service groups by reading the subfolder names in the services pathget_service_method_api(paths, group, service, method) → Hash
This class method returns the API of the specified service/method.get_service_method_list(paths, group, service) → Array<String>
This class method returns a list of methods provided by the specified service.get_services_list(paths, group) → Array<String>
This class method returns a list of services in the specified groupget_services_manifest(client, paths) → Hash<Hash>
This class method returns a keyed hash of services that the Crux framework will find and try to load. There is no registration service. It simply scans the appropriate subfolder for files named xxxService.rb. Be wary of placing half-baked, untested ideas in there.make(paths, group) → Hash
This class method builds the service & contract boilerplate code from the specification(s)restart_server(paths) → Array<Hash>
This class method restarts the Rack server| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/crux/AuthManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides an API for Crux User authentication.
authenticate(client, ipaddr, app, username, password, force) → Hash
logout(client, jwt) → Boolean
reconnect(client, ipaddr, jwt) → Hash
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| crux-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
Crux System Auth Services Handler
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| crux-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
Crux System IMDE Services Handler
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| crux-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
Brick Mill Games' Crux Administration Handler
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/BBRCombatManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides an API for the Brick Mill Games Britannia Battle Resolver.
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| dice-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
Brick Mill Games' Dice Services Handler
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| syslib/CoreService.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022 Brick Mill Games, LLC, All rights reserved. |
This class is responsible for handling common service functionality, such as storing the environment information and associated logging
new(svc_env)
This class constructor initializes the common functionality used by all services which derive from this classnew(db_info)
This class constructor initializes the common functionality used by all services which derive from this classgenerate_sql_safe_json(properties) → String
This method escapes single-quotes from the JSON string for inclusion within a SQL command string.connect_to_db
delete(table, criteria)
This method constructs a simple SQL DELETE statement and submits it for a client query.entity_create(table, context, etype, eattribute, eid, properties)
This method prepares the inputs for the SQL insert statement with which to store a specific entity based on its etype/eattribute/eidentity_delete(table, context, etype, eattribute, eid)
This method prepares the inputs for the SQL delete statement with which to delete a specific entity based on its etype/eattribute/eidentity_fetch(table, context, etype, eattribute, eid, filter) → Hash
This method prepares the inputs for the SQL select statement with which to fetch one or more entities based on its eid or filtered property valuesentity_get(table, context, etype, eattribute, eid, filter, properties) → Hash
This method prepares the inputs for the SQL select statement with which to get one or more entities based on its eid or filtered property valuesentity_update(table, context, etype, eattribute, eid, filter, updates)
This method prepares the inputs for the SQL update statement with which to update one or more entities based on its eid or filtered property valuesinsert(table, data)
This method constructs a simple SQL INSERT statement and submits it for a client query.select(table, columns, criteria, xref) → Array<Hash>
This method constructs a simple SQL SELECT statement and submits it for a client query.update(table, criteria, updates)
This method constructs a simple SQL DELETE statement and submits it for a client query.write_log(mesg) <private>
This method writes a log message to a created log file.write_service_log(method_name, input, output, filter)
This method is a common logging method used to mark a service method's completion.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| syslib/CruxConfig.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2023 Brick Mill Games, LLC, All rights reserved. |
This module provides database access credentials and an API for mySQL database connections.
site_db_info(is_development) → Hash
This method returns the connection credentials for connections to the SQL database server hosted at DreamHost.site_map → Hash
This method returns the site application mapping to URLs and services.site_url_info → Hash
This method returns the Rack URLMap used to run the installed Crux applicationssite_url_map → Hash
This method returns URL map with the manifest class names converted to class objects This Hash is Rack::URLMap ready.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| syslib/CruxContractManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
CruxContractManager is the service contract validator, using each service's contract module for its input
get_method_api(method_name) → Hash
This method is usually used by a Service API handler.get_method_list → Array<String>
This method is usually used by a Service API handler.validate_contract
Each service contract object requires a Hash constant named SERVICE_CONTRACT which contains a registry of the service class's methods and expected input parameters and the parameter's data formats.verify_contract(method, data)
This method verifies the incoming service request's method and data to ensure that the client has honored the service site's working conditions. This is where data sanitization and bad requests (whether accidental or intentional) can be captured. Service request inputs for each service and method are defined within each service's contract class. This code uses advanced Ruby voodoo (introspection) to do its work. Handle with care.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| syslib/CruxResource.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022 Brick Mill Games, LLC, All rights reserved. |
This class is responsible for processing resource types.
new(type, mime, item, size)
each
to_s → String
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| syslib/CruxServiceManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
CruxServiceManager is the services dispatcher, loading Ruby service modules on demand.
new
error(mesg)
find_service(name) → Hash
This method is used to get the specified service's instantiated classes in order for Crux to its work. Services which haven't been loaded yet are loaded.handle_service_request(service, method, input, ipaddr)
This method is the services dispatcher, loading services on demand and verifying inputs against the individual service contracts. Results are packaged as JSON payloads for transmission back to the client, via ok, error or syserror methods. This method uses some fairly advanced Ruby voodoo (bind and introspection routines) to do its work. Don't futz around in here if you're not careful. This is the beating heart of the Crux framework.load_service(name)
This method loads the Crux service handler and its associated service contract based on the supplied fully-qualified name. Fully-qualified means that while the client has asked for the "Dice" service, the name has been expanded to "DiceService" by this time.ok(result)
syserror(mesg)
write_log(mesg, extension) <private>
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/DatabaseManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022 Brick Mill Games, LLC, All rights reserved. |
The DatabaseManager is used to get database information for Crux admin/IDE user.
get_table_info(client, table_name) → Hash
get_table_paged_rows(client, table_name, page_key, page_size, nth_page) → Hash
get_table_pagination_info(client, table_name, page_key, page_size, nth_page) → Hash
get_tables_list(client) → Hash
get_tables_manifest(client) → Hash
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/Emailer.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class is used by the Dice Services page to send e-mail notifications of successful activities, if requested.
send_email(recipients, subject, message, sent_by) → String
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/InfoManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides an API for Brick Mill Games' information generation
email → Hash
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/MTRManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides random number access to other classes and provides an API front-end to the MersenneTwister class.
get_dice_rolls(client, slot)
get_dwords(client, slot, amt) → Array<Integer>
get_qwords(client, slot, amt) → Array<Integer>
prepare(client, slot, timeout) <private>
shuffle(client, slot, entries) → Array<Any>
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/MersenneTwister.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides a pure Ruby implementation of the Mersenne Twister pseudo random number generator.
In addition to providing the random number generation algorithm implementation, this class also manages a random number pipeline array appended by an index which contains the next available number in the pipeline.
When the array is exhausted, the last number is used to seed the generator to refill the array.
Coupled with persistent storage, such as a database of pipelines, this implementation provides the backbone for a random number pipeline capable of infinite duration.
new(seed, type)
do_recursion <private>
gen_dword → Integer
gen_dwords(n) → Array<Integer>
gen_qword → Integer
gen_qwords(n) → Array<Integer>
gen_rand_all <private>
get_state(state)
get_state → ByteString
lshift128 <private>
prime(seed)
rshift128 <private>
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/SessionManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides online session management for TOCS users.
expire(client, jwt) → Boolean
ipaddr_to_hex(ipaddrv4) → String <private>
ipv4_to_hex(ipv4) → String <private>
ipv6_to_hex(ipv6) → String <private>
is_ipaddr_registered?(client, ipaddr) → Boolean
is_ipv4?(ipaddr) → Boolean <private>
is_ipv6?(ipaddr) → Boolean <private>
is_sid_registered?(client, sid) → Boolean
is_uid_registered?(client, uid, app) → Boolean
jwt_decode(jwt) → Hash <private>
jwt_encode(payload) → String <private>
register(client, ipaddr, force, app, uid, username, realname, email, roles, ndays) → String
validate(client, ipaddr, jwt) → Boolean
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/StorageManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides an API for accessing files in the app-specific storage folder on the server.
The storage folder on the server is used to contain non-database files. These can be flat files, XML files, YAML files, INI files, JSON files, etc.
new
dir_version_list(path) → Array<String>
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/crux/SysUserManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2023 Brick Mill Games, LLC, All rights reserved. |
This module is responsible for all Crux System User Services
This manager is a Crux library devoted to system-wide user-level activities.
add_new_user(client, uid, username, realname, email, password) → String
This class method adds a new user to the Crux system.build_reverse_roles_lut(client, app) → Hash <private>
This class method generates an rlut, indexed on the privilege string, per the specified app.build_reverse_roles_lut(client, app) → Hash <private>
This class method generates an rlut, indexed on the privilege string, per the specified app.build_roles_list(rlut, rvalue) → Array<String> <private>
This class method generates a list of roles based on the specified rlut and rvalue.build_roles_lut(client, app) → Hash <private>
This class method generates an rlut, indexed on the bitfield value, per the specified app.build_roles_manifest(client, app, sorted) → Hash <private>
This class method generates full app + privileges manifest.get_app_access_privilege(client) → Hash
This class method returns the base access privilege of all of the apps.get_app_privileges_manifest(client) → Hash
This class method returns a manifest of all of the apps and their associated privileges.get_app_user_list(client, app) → Array<Hash>
This class method returns a list of Crux application users.get_app_user_privileges(client, uid, app) → Array<String>
This class method returns the list of privileges for the given user for the specified app.get_user_list(client) → Array<Hash>
This class method returns a list of Crux system users.get_user_manifest(client) → Array<Hash>
This class method returns a manifest of Crux system users.remove_app_user_privileges(client, uid, app) → String
This class method removes the privileges for the given user for a given app.remove_user(client, uid) → String
This class method removes a user from the Crux system.restore_app_user_privileges(client, uid, app) → String
This class method restores the privileges for the given user for a given app.restore_user_privileges(client, uid) → String
This class method restores the privileges for the given user system-wide.set_app_user_privileges(client, uid, app, privileges, create) → String
This class method sets the privileges for the given user for the specified app.suspend_app_user_privileges(client, uid, app) → String
This class method suspends the privileges for the given user for a given app.suspend_user_privileges(client, uid) → String
This class method suspends the privileges for the given user system-wide.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| tocs-server.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022, Brick Mill Games, LLC, all rights reserved. |
Brick Mill Games' TOCS Services Handler for TOCS Games
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slib/UIDManager.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This class provides a random UID API for Crux services
get_32bit_key(client, table, field, slot) → String
This class method returns a unique 8-byte hex id and making sure the database table we'll be inserting it into doesn't already have it.get_64bit_key(client, table, field, slot) → String
This class method returns a unique 16-byte hex id and making sure the database table we'll be inserting it into doesn't already have it.get_dword(client, slot) → Array<Integer>
get_qword(client, slot) → Array<Integer>
prepare(client, slot, timeout) <private>
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| config.ru | Ruby | Kenneth F. Guerin | Copyright © 2018-2022 Brick Mill Games, LLC, All rights reserved. |
This is the TOCS Web Services app launcher.
config.ru is the entry point for Rack applications.