openitg / openitg

The OpenITG Project Code - an open-source rhythm dancing game based on StepMania 3.95
http://openitg.gr-p.com/
157 stars 78 forks source link

Request: anonymous scores, lua bindings #105

Open timpany opened 7 years ago

timpany commented 7 years ago

Thank you for implementing the broadcast support! Is there a way to get scores for players without a usb to go to a receiver? The comments say the guids are always generated, but could you blank out the player guid on submission if it's not from usb? This let's all scores from everyone go to the receiver.

Is it possible to access the network features from lua? I think some themes benefit from the ability to use the http functionality.

chrispable commented 7 years ago

The first part of what you want is actually pretty easy to do and I guess it's trivial to throw out a predefined guid at the listener. I'll work that up when I get some time. Probably a 2 line change.

Lua stuff I'm not familiar with. In fact I've never even coded it. If you are, by all means go ahead. I think it might be a bit difficult because you'll need to implement call backs and I've no idea how that even works with lua. The httphelper object creates an anonymous thread when doing a threaded request and the result is blocked via semaphore until it's ready. It doesn't use a call back currently, its just a best effort broadcast. Unless you do thread management in a theme, the result blocking will appear to hang the ui. Not even sure if themes can make worker threads. Your welcome to implement this functionality yourself but as of right now, I've little utility for it and I'm busy with other functionality.