2025-07-22 13:13 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002511Spring engineLuapublic2011-09-26 01:37
ReporterjK 
Assigned ToKloot 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target Version83.0Fixed in Version0.82.7+git 
Summary0002511: (master) chat commands are reordered because of buffering in spring MT, this possible breaks widgets and possible more
Descriptionit does
  Spring.SendCommands({"showhealthbars 0"})
  Spring.SendCommands({"showrezbars 0"})
  widgetHandler:AddAction("showhealthbars", showhealthbars)
  Spring.SendCommands({"unbind f9 showhealthbars"})
  Spring.SendCommands({"bind f9 luaui showhealthbars"})

So it deactive `engine` healthbars and THEN it adds its own F9 handler function.
Now with buffered chat commands the custom F9 handler is already linked, when "showhealthbars 0" is processed and so it deactivates the lua ones!
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
duplicate of 0002675closed (master) chat commands are reordered 
+Relationships

-Notes

~0007271

zerver (reporter)

Okay, this had nothing to do with buffering of chat commands.

Instead it is due to some camera refactoring in 9bd22b4f6b7fb52b41d91c91059a5c34c8d2e62e

I made a temp fix here
https://github.com/spring/spring/commit/1ea71d01e974782753c05dae8ccb21e0ed5c000a
but it may need some tweaking.

~0007272

Kloot (developer)

Last edited: 2011-08-24 00:26

Erhm, what ARE you smoking? How the _HELL_ can there even be a relation when the refactoring commit was made on July _27_ and this report on July 1?

~0007273

jK (developer)

Last edited: 2011-08-24 01:47

@zerver
I gave you the code that broke! and yeah, it is exactly those 5 lines! Is there any camera related thing in there? No!

It's this commit that broke it:
https://github.com/spring/spring/commit/5886a2921c52ea8c8fdb02fd4fe2f4372dc832fd

and now the code is moved here after multiple commits:
https://github.com/spring/spring/blob/master/rts/Game/UI/GuiHandler.cpp#L4298

Spring.SendCommands({"showhealthbars 0"}) runs game->ActionPressed -> it doesn't find an executor (command is removed in 83) -> it calls guihandler->PushLayoutCommand(), that buffers the command instead of executing it -> now Lua calls widgetHandler:AddAction("showhealthbars", showhealthbars) and adds its own action handler for it -> new DrawFrame occurs, GUIHandler:Update() is called, now it calls the _incorrect_ lua action


So now you can fix it, already did 80% of the work for you ...

~0007274

zerver (reporter)

Last edited: 2011-08-24 01:49

Kloot, chill man! The relationship is merely that you broke something that affected the same widget.

~0007275

zerver (reporter)

jK, the "showxxxbars" commands only remain in MT spring. This is why ActionPressed does not find an executor.

So you should fix the widget something like this

if string.find(tostring(Game.version), "MT") then
  Spring.SendCommands({"showhealthbars 0"})
  Spring.SendCommands({"showrezbars 0"})
end

~0007276

zerver (reporter)

I added dummy showxxxbars commands for single threaded spring, so no need to fix that widget anymore

https://github.com/spring/spring/commit/5f3193fb62f9da3c691b1fde10378665efa03812

~0007277

jK (developer)

Could you please stop adding your hacks all over the engine esp. w/o any comments!?

The bug is that the order of incoming commands isn't preserved!
As the forum test thread implies other widgets are affected by this, too.
SO PLEASE REVERT/FIX THE BUFFERING!

~0007283

zerver (reporter)

Mmmkay, MT would deadlock, so reverting for single thread is the best I can do ATM.

https://github.com/spring/spring/commit/7b01ba9f73cb348767f926dd66f5d6070dbf38d3

~0007310

abma (administrator)

so, is it fixed or not?

~0007312

zerver (reporter)

This specific issue is fixed, but it was not related to buffering of chat commands.

Buffering of chat commands only occurs for certain custom (unrecognized) commands, and reordering should therefore be a very minor problem. Still, I decided to revert it for single thread.

I'm not sure if the camera issue that Kloot introduced is 100% fixed. It works much better now at least.
+Notes

-Issue History
Date Modified Username Field Change
2011-07-01 18:28 jK New Issue
2011-07-01 18:28 jK Graphics Card => unknown
2011-07-07 23:38 jK Target Version => 0.83.0
2011-08-15 22:23 abma Severity minor => major
2011-08-23 23:20 zerver Note Added: 0007271
2011-08-23 23:21 zerver Assigned To => Kloot
2011-08-23 23:21 zerver Status new => feedback
2011-08-24 00:24 Kloot Note Added: 0007272
2011-08-24 00:26 Kloot Note Edited: 0007272
2011-08-24 01:40 jK Note Added: 0007273
2011-08-24 01:41 jK Note Edited: 0007273
2011-08-24 01:42 jK Note Edited: 0007273
2011-08-24 01:47 jK Note Edited: 0007273
2011-08-24 01:47 zerver Note Added: 0007274
2011-08-24 01:49 zerver Note Edited: 0007274
2011-08-24 02:26 zerver Note Added: 0007275
2011-08-24 02:48 zerver Note Added: 0007276
2011-08-24 17:35 jK Note Added: 0007277
2011-08-25 01:39 zerver Note Added: 0007283
2011-08-30 18:09 abma Note Added: 0007310
2011-08-31 19:27 zerver Note Added: 0007312
2011-09-08 18:27 abma Summary (master) buffering of chat commands breaks the healthbars widget and possible more => (master) chat commands are reordered because of buffering, this possible breaks widgets and possible more
2011-09-08 19:12 abma Summary (master) chat commands are reordered because of buffering, this possible breaks widgets and possible more => (master) chat commands are reordered because of buffering in spring MT, this possible breaks widgets and possible more
2011-09-16 02:08 zerver Status feedback => resolved
2011-09-16 02:08 zerver Fixed in Version => 0.82.7+git
2011-09-16 02:08 zerver Resolution open => fixed
2011-09-26 01:37 abma Relationship added duplicate of 0002675
+Issue History