-
Notifications
You must be signed in to change notification settings - Fork 1k
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
bus: use json for data transport, new plugins #1019
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
@@ -49,7 +49,7 @@ loadPlugins 2 | |||
# loadPlugins_list <list> | |||
# 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
@@ -90,9 +90,10 @@ use Exporter; | |||
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
bus
transport mechanism from packed binary data to JSON.verbose
option toBus::Client
.CLIENT_LIST2
packet type, which returns data as an array of hashes instead of a flat hash.bus_hook
pluginbus_hook
plugin which converts bus messages into hook calls, and vice versa.** Hook
bus/send
- allow plugins other thanbus_hook
to send bus messages.** Hook
bus/sent
- called wheneverbus_hook
sends a bus message.** Hook
bus/recv
- called wheneverbus_hook
receives a bus message.** Hook
bus/recv/$MID
- where$MID
is the actual message ID (eg,JOIN
orLEAVE
) - called wheneverbus_hook
receives a bus message with message ID equal to$MID
bus_party
pluginbus_party 1
inconfig.txt
.bus_party
plugin which sends party update packets every 0.2 seconds, and updates the party with data from the bus.bus_command
pluginbus_command
plugin which runs commands sent over the bus.bus-command.pl
script which sends a command over the bus, from the command line, to thebus_command
plugin.**
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,follow
is turned off)**
FOLLOWERS
= all bots which are following (ie,follow
is on andfollowTarget
is 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_groups
comma-separated config variable.ONLINE,MAP=prontera,SHOPS
would match bots which are fully in-game, on theprontera
map, and havebus_command_groups
set toSHOPS
.