-
Notifications
You must be signed in to change notification settings - Fork 1.2k
bus: use json for data transport, new plugins #1019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
it would be good to be able to send a message via bus,instead of just commands, just like the old one |
|
W |
control/sys.txt
Outdated
| # if loadPlugins is set to 2, this comma-separated list of plugin names (filename without the extension) | ||
| # specifies which plugin files to load at startup or when the "plugin load all" command is used. | ||
| loadPlugins_list macro,profiles,breakTime,raiseStat,raiseSkill,map,reconnect,eventMacro,item_weight_recorder | ||
| loadPlugins_list macro,profiles,breakTime,raiseStat,raiseSkill,map,reconnect,eventMacro,item_weight_recorder,bus_hook,bus_party,bus_command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think bus_party should be on by default
src/Bus/Messages.pm
Outdated
| use base qw(Exporter); | ||
| use Encode; | ||
| use Utils::Exceptions; | ||
| use JSON; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON::Tiny is already part of src/deps, can we use it?
|
|
||
| use FindBin qw($RealBin); | ||
| use lib "$RealBin/.."; | ||
| use lib "$RealBin/../deps"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use lib "$RealBin/../..", since XSTools.dll is there by default.
The same goes for src/Bus/bus-server.pl



bustransport mechanism from packed binary data to JSON.verboseoption toBus::Client.CLIENT_LIST2packet type, which returns data as an array of hashes instead of a flat hash.bus_hookpluginbus_hookplugin which converts bus messages into hook calls, and vice versa.** Hook
bus/send- allow plugins other thanbus_hookto send bus messages.** Hook
bus/sent- called wheneverbus_hooksends a bus message.** Hook
bus/recv- called wheneverbus_hookreceives a bus message.** Hook
bus/recv/$MID- where$MIDis the actual message ID (eg,JOINorLEAVE) - called wheneverbus_hookreceives a bus message with message ID equal to$MIDbus_partypluginbus_party 1inconfig.txt.bus_partyplugin which sends party update packets every 0.2 seconds, and updates the party with data from the bus.bus_commandpluginbus_commandplugin which runs commands sent over the bus.bus-command.plscript which sends a command over the bus, from the command line, to thebus_commandplugin.**
ALL= all bots (this is redundant, because not sending a group means the same thing)**
AI=auto= all bots with auto AI**
AI=manual= all bots with manual AI**
AI=off= all bots with AI turned off**
ONLINE= all bots fully in-game**
OFFLINE= all bots which are not fully in-game**
LEADERS= all bots which are not following (ie,followis turned off)**
FOLLOWERS= all bots which are following (ie,followis on andfollowTargetis set)**
MAP=...= all bots where...matches the map the bot is on (eg,prontera)**
var=...= all bots where...matches the value of the config variablevar.** Additionally, any value which matches a value in the
bus_command_groupscomma-separated config variable.ONLINE,MAP=prontera,SHOPSwould match bots which are fully in-game, on thepronteramap, and havebus_command_groupsset toSHOPS.