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

fix: uptime in protocolstatus #2459

Merged
merged 6 commits into from
Jul 6, 2024
Merged

Conversation

htc16
Copy link
Contributor

@htc16 htc16 commented Mar 18, 2024

Description

There is an uptime error in protocolstatus, as it does not load the time in the cache correctly, causing it to not update the time.

I added this variable within uptime, so that, instead of using the cache time, in specific cases it loads the system time, so it is possible to use this in other parts where uptime is a problem, just adding the true inside OTSYS_TIME().

This fixes a time overrun, where the server had been online for over 53 years. One other player and I had this problem, I don't know if other people did.

Behaviour

Actual

Do this and that doesn't happens

Expected

Do this and that happens

Fixes #issuenumber

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Server Version:
  • Client:
  • Operating System: Debian 12

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

There is an uptime error in protocolstatus, as it does not load the time in the cache correctly, causing it to not update the time.

I added this variable within uptime, so that, instead of using the cache time, in specific cases it loads the system time, so it is possible to use this in other parts where uptime is a problem, just adding the true inside OTSYS_TIME().
@Necromonde
Copy link

Fiz toda essas alterações e o uptime continuou o mesmo
Capturar

@htc16
Copy link
Contributor Author

htc16 commented Mar 19, 2024

Did you test it correctly? Did you delete the cache from the previous compiler?

@elsongabriel
Copy link
Contributor

Did you test it correctly? Did you delete the cache from the previous compiler?

How can we test this?

@htc16
Copy link
Contributor Author

htc16 commented Apr 3, 2024

Did you test it correctly? Did you delete the cache from the previous compiler?

How can we test this?

I believe this can occur using debian 12, which is my case, I'm not sure of the real cause of this, because the problem is limited to some people from what I could see.

@elsongabriel
Copy link
Contributor

Did you test it correctly? Did you delete the cache from the previous compiler?

How can we test this?

I believe this can occur using debian 12, which is my case, I'm not sure of the real cause of this, because the problem is limited to some people from what I could see.

I'm checking here, and Myaac give me Uptime: 475597h 48m
I'll fix this return, with days and hours.

but, where can we check our uptime?

@htc16
Copy link
Contributor Author

htc16 commented Apr 3, 2024

Did you test it correctly? Did you delete the cache from the previous compiler?

How can we test this?

I believe this can occur using debian 12, which is my case, I'm not sure of the real cause of this, because the problem is limited to some people from what I could see.

I'm checking here, and Myaac give me Uptime: 475597h 48m I'll fix this return, with days and hours.

but, where can we check our uptime?

From what I understand, the wrong return happens because the system for starting the server cannot even have a predefined time, and when it arrives at the moment that leaves the server online, it loads the 0 uptime that is stored in the cache when it starts. I believe that's it. The only change I made was a modification to the source so that the server gets the system time directly without accessing the cache when online.

@elsongabriel
Copy link
Contributor

Did you test it correctly? Did you delete the cache from the previous compiler?

How can we test this?

I believe this can occur using debian 12, which is my case, I'm not sure of the real cause of this, because the problem is limited to some people from what I could see.

I'm checking here, and Myaac give me Uptime: 475597h 48m I'll fix this return, with days and hours.
but, where can we check our uptime?

From what I understand, the wrong return happens because the system for starting the server cannot even have a predefined time, and when it arrives at the moment that leaves the server online, it loads the 0 uptime that is stored in the cache when it starts. I believe that's it. The only change I made was a modification to the source so that the server gets the system time directly without accessing the cache when online.

ok nice.. I fixed myaac serverinfo page, to show like this:
image

@htc16
Copy link
Contributor Author

htc16 commented Apr 3, 2024

Did you test it correctly? Did you delete the cache from the previous compiler?

How can we test this?

I believe this can occur using debian 12, which is my case, I'm not sure of the real cause of this, because the problem is limited to some people from what I could see.

I'm checking here, and Myaac give me Uptime: 475597h 48m I'll fix this return, with days and hours.
but, where can we check our uptime?

From what I understand, the wrong return happens because the system for starting the server cannot even have a predefined time, and when it arrives at the moment that leaves the server online, it loads the 0 uptime that is stored in the cache when it starts. I believe that's it. The only change I made was a modification to the source so that the server gets the system time directly without accessing the cache when online.

ok nice.. I fixed myaac serverinfo page, to show like this: image

but the problem is also with otservlist and the server score starts to drop so much!

@elsongabriel elsongabriel changed the title Fix: uptime in protocolstatus fix: uptime in protocolstatus Apr 3, 2024
Copy link
Contributor

github-actions bot commented May 4, 2024

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale No activity label May 4, 2024
@github-actions github-actions bot removed the Stale No activity label May 25, 2024
@elsongabriel elsongabriel merged commit 9825f4c into opentibiabr:main Jul 6, 2024
21 checks passed
pasturryx pushed a commit to pasturryx/canary1 that referenced this pull request Aug 1, 2024
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

Successfully merging this pull request may close these issues.

4 participants