Jycraft / jycraft

Extend Minecraft servers with Python using Jython.
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

Allow message sending from Jython scripts #12

Open pauleveritt opened 8 years ago

pauleveritt commented 8 years ago

We can have Jython scripts (either from the Editor via browser or on disk) that can listen for Minecraft events and do some work. It would be nice if that work included the ability to send messages to browsers over a WebSocket.

For example, whenever someone moves in the world, send the new coordinates to a browser, which moves an icon representing that person, thus making a map.

AngelMunoz commented 8 years ago

I think this could be one use of that mysterious class that implements the websocketlistener, yet I would like to do some custom test to check what is it for

pauleveritt commented 8 years ago

This ticket is really about making some Java websocket-message-sending function/object available in the scope of the Python interpreter.

—Paul

On Nov 26, 2015, at 12:57 PM, Angel Daniel Munoz Gonzalez notifications@github.com wrote:

I think this could be one use of that mysterious class that implements the websocketlistener, yet I would like to do some custom test to check what is it for

— Reply to this email directly or view it on GitHub https://github.com/Jycraft/jycraft-server-plugin/issues/12#issuecomment-159969765.

AngelMunoz commented 8 years ago

I tink we could actually have some java classes (in the jycraft plugin) that use a similar approach that is implemented already (FileRunner and TaskRunner classes but instead running jython, checking for user positions) on spigot and sponge plugins to send the positions over websockets-json that would require a bit more knowledge of each API to know how to do it on java then just rather than using jython scripts on the client draw maps and traces with javascript instead with the json received

pauleveritt commented 8 years ago

That would be a fantastic step forward. Then, writing a plugin on the filesystem that listens for interesting things and interacts with the web client will feasible.

—Paul

On Jan 12, 2016, at 6:01 AM, Angel Daniel Munoz Gonzalez notifications@github.com wrote:

I tink we could actually have some java classes (in the jycraft plugin) that use a similar approach that is implemented already (FileRunner and TaskRunner classes but instead running jython, checking for user positions) on spigot and sponge plugins to send the positions over websockets-json that would require a bit more knowledge of each API to know how to do it on java then just rather than using jython scripts on the client draw maps and traces with javascript instead with the json received

— Reply to this email directly or view it on GitHub https://github.com/Jycraft/jycraft/issues/12#issuecomment-170876723.