Skip to content

Fix social distancing bug (name trademarked by kamilprzyb)#67

Merged
CPunch merged 1 commit intoOpenFusionProject:masterfrom
mostafa-abdelbrr:master
Sep 6, 2020
Merged

Fix social distancing bug (name trademarked by kamilprzyb)#67
CPunch merged 1 commit intoOpenFusionProject:masterfrom
mostafa-abdelbrr:master

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Sep 5, 2020

No description provided.

@CakeLancelot
Copy link
Copy Markdown
Member

BTW, for those who weren't following on the Discord channel: this bug caused players to disconnect as soon as another player came into view. It only occurred on builds compiled with MSVC, which had a different getTime() method.

Here's an image of the bug occurring:
image

According a decompilation of the client, the only instance this error message will be displayed is when the server time is out of sync.

(I know this should've been put into an issue or something, sorry about that)

Comment thread src/CNStructs.cpp
@@ -1,4 +1,7 @@
#include "CNStructs.hpp"
#if defined _MSC_VER
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just #ifdef _MSC_VER should be fine here

Comment thread src/CNStructs.cpp
time_t t;
time(&t);
return (uint64_t)t;
std::chrono::milliseconds value = std::chrono::duration_cast<std::chrono::milliseconds>((std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now())).time_since_epoch());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indentation here

@CPunch CPunch merged commit e936cb9 into OpenFusionProject:master Sep 6, 2020
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.

2 participants