yorkhackspace / SpacehackServer

Server side of the Spacehack game
3 stars 1 forks source link

Add support for processing simple commands #12

Closed choffee closed 7 years ago

choffee commented 7 years ago

In order to be able to write a simple interface I am processing commands over mqtt in the server.

This way we can write commands onto mqtt with any UI and not have to fiddle with the game code too much.

This just adds exit and skip_intro commands

To use it: mosquitto_pub -h localhost -t command/exit -m"No real message"

lexbailey commented 7 years ago

I like it! I'll probably merge this in tomorrow when i go hack the server.

choffee commented 7 years ago

It might be worth testing it first :)

I was trying to get it up and running on my laptop last night but could not get it to do anything. I did have to switch to the paho library for mqtt as I can't find the old mosquitto library any more.

john

aquila12 commented 7 years ago

I think last time i did anything with it i also needed to adapt it to use paho. If that's something that isn't in master yet we should probably bite the bullet, it's mostly the same.

On 17 Mar 2017 9:22 a.m., "John Cooper" notifications@github.com wrote:

It might be worth testing it first :)

I was trying to get it up and running on my laptop last night but could not get it to do anything. I did have to switch to the paho library for mqtt as I can't find the old mosquitto library any more.

john

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yorkhackspace/SpacehackServer/pull/12#issuecomment-287305683, or mute the thread https://github.com/notifications/unsubscribe-auth/AF1XJseVL2FVjlDOCTtC8kSUFraxCJ7tks5rmlDggaJpZM4Mf_OB .

choffee commented 7 years ago

Oh and I think I might have missed the client.subsctibe bit for the commands. I may get time over lunch...

lexbailey commented 7 years ago

Thanks John, this needed some tweaks, but it's got the command support off the ground. I've got a basic GUI sending commands, I'm going to keep playing around with it today.