Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ShipsLogControl] Log might not update if first entry text is the same as the latest #1947

Open
oznogon opened this issue Mar 18, 2023 · 0 comments

Comments

@oznogon
Copy link
Contributor

oznogon commented Mar 18, 2023

Steps to reproduce:

  1. Send a log-filling set of addToShipLog calls to a PlayerSpaceship during a scenario via the exec.lua HTTP API endpoint:
for i=1,100,1
do
player:addToShipLog("ack", "yellow")
end
  1. Send the exact same set again a few seconds later, after no other log activity on the player ship.

Expected behavior:

The newest entries in the log have the newer timestamp.

Observed behavior:

The log doesn't appear to update.

This appears to be due to checks like these in ShipsLogControl:

if (log_text->getEntryCount() > 0 && logs.size() > 0 && log_text->getEntryText(0) != logs[0].text)
{
bool updated = false;
for(unsigned int n=1; n<log_text->getEntryCount(); n++)
{
if (log_text->getEntryText(n) == logs[0].text)

Specifically:

log_text->getEntryText(0) != logs[0].text

which returns true if two separate log entries from different times have identical text.

@oznogon oznogon changed the title [GuiAdvancedScrollText] Scrollmight not update if first entry text is the same as the latest [ShipsLogControl] Log might not update if first entry text is the same as the latest Mar 18, 2023
csibbitt added a commit to csibbitt/EmptyEpsilon that referenced this issue Oct 10, 2023
* Add a sequence # to log messages
* Store seq in GuiAdvancedScrollText along with rest of log data
* Compare seq instead of text when sync'ing ScrollText to log
* Fixes Issue daid#1947
daid pushed a commit that referenced this issue Oct 11, 2023
* Add a sequence # to log messages
* Store seq in GuiAdvancedScrollText along with rest of log data
* Compare seq instead of text when sync'ing ScrollText to log
* Fixes Issue #1947
Tsht pushed a commit to Tsht/EmptyEpsilon that referenced this issue Nov 22, 2023
* Add a sequence # to log messages
* Store seq in GuiAdvancedScrollText along with rest of log data
* Compare seq instead of text when sync'ing ScrollText to log
* Fixes Issue daid#1947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant