beyond-all-reason / bar-lobby

BAR Lobby Client
https://beyond-all-reason.github.io/bar-lobby/
MIT License
37 stars 35 forks source link

Support scenarios #121

Open Jazcash opened 1 year ago

Jazcash commented 1 year ago

image

image

https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/singleplayer/scenarios/scenario000.lua https://github.com/beyond-all-reason/BYAR-Chobby/blob/b1fb5b4a60f91f5a214f43a64d07d4cdedb31a5b/LuaMenu/widgets/gui_scenario_window.lua#L677

Jazcash commented 1 year ago

Scenarios now implemented, but missing personal records because I don't believe there's any way for bar lobby to get this info currently. I believe Chobby can get this info because it has access to the Lua callins from the game, and SPADS can get the info via the AutohostInterface provided by the engine.

https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/luarules/gadgets/game_end.lua#L353 https://github.com/beyond-all-reason/BYAR-Chobby/blob/master/LuaMenu/widgets/gui_scenario_window.lua#L1089 https://github.com/beyond-all-reason/spring/blob/BAR105/rts/Net/AutohostInterface.cpp

The simplest solution for now might be having the game_end gadget send the needed info in a synced message (Spring.SendLuaRulesMsg), and then parsing that info from the replay.

Jazcash commented 1 year ago

Supposedly there is a local socket interface for spring.exe that we might be able to utilise to send data between the lobby and game