BWP Architecture
From Grigbertz
Contents |
Comm Module
This script listens on the Set Channel and relays incoming commands as Link Messages.
The command string looks the same sent by chat, link or e-mail.
BWP Communications Protocol
<command> = BWP::<relay info>::<set name>::<receiver>::<sender>::<action>
<action> = <action name>[|id=<key>][|<arg1>|<arg2>...|<argN>]
<receiver> = <sender> = <name>[|id=<key>][|num=<number>][|<arg1>|<arg2>...|<argN>]
Fields
- BWP The Magic Word
- <relay info> Values:
- 0 - handled by any receiver
- 1 - handled by Comm module only. Ignored by others.
- 2 - ignored by Comm module.
- set name Common name of all objects using the set channel
- receiver An identifier telling the receiving end this is the action for me
- num Optional. Script number for initial filtering of link messages. Sent as the num argument in the link message.
- id Optional. Is this useful?
- sender Identifies the original source of the command
- num Optional. Sent as the sender_num argument in the link message.
- id Optional. Is this useful?
- action The info handled by the receiver.
The Relayed Link Message
- sender_num = sender->num (default: 0)
- num = receiver->num (default: 0)
- msg = the command string
- id = original chat message id (default: NULL_KEY)
To Do
- How best to specify sender and recever?
- Fields for handling of e-mail info
- Adapt this for efficient handling of menus
Example
(take this from Techno Cuffs 'chains' script)
Main Comm module
- All Comm modules listen to Basic Channel (set class specific) and Set Channel (set instance specific)
- The Main Comm module handles requests on the Basic Channel for Set Channel number, if set owner matches.
- The Main Comm module broadcasts Set Channel number on the Basic Channel when rezzed.
- Other Comm modules request Set Channel number on the Basic Channel when rezzed.
Status Module
Handles Item status and Set status.
Any change in status is relayed to other Status Modules of the set through the set channel.
(Anti-loop exeption: A status change from a set channel message is not relayed again).
A status update is also sent to the link set.
Status should be properly applied on re-log.
Examples of status (Magic Cuffs)
Set Constants
- Set name
- Basic Channel
- Basic key channel
- Dialog strings
Set Properties
- Owner id
- Owner name
- Owner initials
- Set Channel
- Operators Anybody / Just me / Operator list
- Operator list list of names (or Groups (level 2))
- Item color: Steel / Gold / Iron / etc....
- Sparkles: Sparkles On / Sparkles Off
- Sparkle color: White / Green / etc...
Set State
- Key state: Key Activated / Key Not Activated
- Cuffed state: Not Cuffed/ Cuffed
- Cufflocked state: Not Cufflocked / Cufflocked
- Locked state Unlocked / Locked
- Freedom state: Free (Not Cufflocked and Unlocked )/ Locked Free (Not Cuffed and Locked) / Not Free ((Cuffed and Locked) or Cufflocked)
- Derived State
- Free: All menu choices available.
- Locked Free: You can make some menu choices like "Leash..." or "Poses..."
- Not Free: Severely restricted menu choices
- Sit state Sitting / Not Sitting
- Sit pose Sit Pose / Cuff Pose
- Cuff pose Showing cuff pose / Not showing cuff pose
- Derived state. A function of Sit State, Sit pose, Cuffed state
- Current animation Animation name / NULL_STR
- Current squirm animation Animation name / NULL_STR
- Current playing animation Animation name / NULL_STR
- Derived state. A function of Sit State, Sit pose, Current animation, Current squirm animation
- Leash state Leashed / Unleashed
- Leash anchor Agent key / Object Key / NULL_KEY
Item Properties
- Set Channel
- Item color: Steel / Gold / Iron / etc....
- Sparkles: Sparkles On / Sparkles Off
- Sparkle color: White / Green / etc...
Item State
- Part of current bound anim: Cuffed / Not Cuffed
- Cuff state: Red / Yellow / Green