SollmoStudio / beyond

Beyond: The Scalable Game Server Framework
http://www.beyondframework.com
Apache License 2.0
25 stars 9 forks source link

Support multiple plugins. #191

Closed sgkim126 closed 9 years ago

sgkim126 commented 9 years ago

Currently, beyond supports only one javascript plugin. This patch makes beyond support multiple plugins.

This patch adds beyond.plugin.paths option, this option is consists of plugin names and paths. For example if beyond.plugin.paths is looks like below

beyond.plugin.paths = { logicServer = [ "/path/to/logic/server" ] admin = [ "/path/to/admin/server" ] }

the request to "//plugin/logicServer/" URI will use "/path/to/logic/server" plugin with "/plugin/" request URI, and the URI to "//plugin/admin/" will use "/path/to/admin/server" plugin with "/plugin/" request URI. In other words, the Request passed to plugin will remove plugin name from the URI.

The beyond.plugin.path option remains. It will be used as the default plugin path. If there is no matching name with URI in paths, the default plugin will be used.

sgkim126 commented 9 years ago

@noraesae PR updated. I applied your two comments.

hatashiro commented 9 years ago

Fantastic. LGTM.