Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

allanon
Copy link
Member

@allanon allanon commented Aug 28, 2017

  • Change the bus transport mechanism from packed binary data to JSON.
  • Add a verbose option to Bus::Client.
  • Add a new built-in CLIENT_LIST2 packet type, which returns data as an array of hashes instead of a flat hash.

bus_hook plugin

  • Add a new bus_hook plugin which converts bus messages into hook calls, and vice versa.
    ** Hook bus/send - allow plugins other than bus_hook to send bus messages.
    ** Hook bus/sent - called whenever bus_hook sends a bus message.
    ** Hook bus/recv - called whenever bus_hook receives a bus message.
    ** Hook bus/recv/$MID - where $MID is the actual message ID (eg, JOIN or LEAVE) - called whenever bus_hook receives a bus message with message ID equal to $MID

bus_party plugin

  • Must be turned on by setting bus_party 1 in config.txt.
  • Add a new bus_party plugin which sends party update packets every 0.2 seconds, and updates the party with data from the bus.

bus_command plugin

  • Add a new bus_command plugin which runs commands sent over the bus.
  • Add a new bus-command.pl script which sends a command over the bus, from the command line, to the bus_command plugin.
  • Commands can be targeted by party or group. Available groups:
    ** 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 and followTarget 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 variable var.
    ** Additionally, any value which matches a value in the bus_command_groups comma-separated config variable.
  • Command groups may also be a comma-separated list, in which case all groups must match. For example, ONLINE,MAP=prontera,SHOPS would match bots which are fully in-game, on the prontera map, and have bus_command_groups set to SHOPS.

@Nipodemos
Copy link
Contributor

it would be good to be able to send a message via bus,instead of just commands, just like the old one

@ghost
Copy link

ghost commented Sep 4, 2017

W
O
W

@Nipodemos
Copy link
Contributor

Nipodemos commented Sep 16, 2017

having this error while trying to open wxstart.exe
image

when using openkore.pl works normally

also i have another thing to ask... how to use bus_commands??? i've notice that there is no command to use

and the bus screen its not separeted anymore, its mixes with the first openkore opened...
image

here's my feedback so far

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
Copy link
Member

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

@@ -90,9 +90,10 @@ use Exporter;
use base qw(Exporter);
use Encode;
use Utils::Exceptions;
use JSON;
Copy link
Member

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";
Copy link
Member

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

@lututui
Copy link
Member

lututui commented Sep 16, 2017

@Nipodemos

and the bus screen its not separeted anymore, its mixes with the first openkore opened...

src/Bus/bus-server.pl is still working

also i have another thing to ask... how to use bus_commands??? i've notice that there is no command to use

Use src/Bus/bus-command.pl

I don't know if it's the best way to do this (probably not), but I got it working this way
image

@lututui lututui added the plugin label Sep 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants