lotgd / core

Core functionality for Legend of the Green Dragon, a text-based RPG game.
GNU Affero General Public License v3.0
152 stars 15 forks source link

Make bin\daenerys extensible #41

Closed Vassyli closed 8 years ago

Vassyli commented 8 years ago

This commit makes bin\daenerys extensible for additional commands

Fixes #40.

austenmc commented 8 years ago

How will this work?

Vassyli commented 8 years ago

I can take the daenerys utils binary and register commands in the crate using the static function to provide additional features. Something along the lines of

Main::registerCommand(new CrateUserCreateCommand())
austenmc commented 8 years ago

Couple of things:

  1. Do you have a concrete use case for this yet? If not, let's wait to add complexity until we have a real use case.
  2. Main::registerCommand() would only work while the daenerys tool is running. To make this really extensible, daenerys should fire a hook and listeners can return commands in the event handler.
Vassyli commented 8 years ago

I thought about extending the tool on both sites to provide commands to:

  1. Extend with commands to initiate database with default data in core
  2. Extend then in crate with commands to create new user

I'll close this PR and think about it a bit more.