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
Send the race time using warmup timer #602
Conversation
necropotame
commented
Jan 4, 2017
- The race time is no longer sent using the round tick. This will allow to use it to sync animations through all clients
- The race time is now sent using the warmup tick. The client use the warmup tick only if the flag GAMESTATEFLAG_RACETIME is set. The warmup tick is sent in negative to prevent modified clients to display an useless big warmup message. We could also remove GAMESTATEFLAG_RACETIME and detect the sign of the warmup time to decide, but it's less elegant.
- For clients that doesn't support GAMESTATEFLAG_RACETIME, if the timer type is set to "game time" or "both", then it is forced to be "broadcast".
- A small bug is fixed concerning the /timer command that was not displaying the type of timer in the chat.
Was there a discussion about this? |
It follows this discussion: https://ddnet.tw/irclogs/2017-01-04.log Using the gametick for the race time makes impossible the use animations for collision quads (#601). It was not clear how to change this, east says that all of you needed to discuss about that on github. I've made this commit as a suggestion of possible and simple way to implement a fix to this issue. |
This forces the vanilla clients to the ugly broadcast timer, if we are okay with that it looks fine. Also I guess you shouldn't bump the version in your commits. |
@def- Should I remove the version bump, close the PR or keep it like this? |
Not sure. Do we want this? |
In case features making use of the animation syncing will be added in the future we definitely want this. Like QshaR's interactive maps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we want this.
@necropotame There's a merge conflict.
src/game/server/ddracechat.cpp
Outdated
if(pPlayer->m_ClientVersion >= VERSION_DDNET_GAMETICK) | ||
pPlayer->m_TimerType = 0; | ||
else | ||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD,"timer","gametimer is not supported by your client."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add spaces after the commas?
src/game/server/ddracechat.cpp
Outdated
else | ||
{ | ||
pPlayer->m_TimerType = 1; | ||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD,"timer","gametimer is not supported by your client."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
src/game/server/ddracechat.cpp
Outdated
|
||
if((OldType == 1 || OldType == 2) && (pPlayer->m_TimerType == 0 || pPlayer->m_TimerType == 3)) | ||
pSelf->SendBroadcast("", pResult->m_ClientID); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are motivated, it would be great if you could introduce symbolical constants for the timers (optional, not needed to get the PR accepted).
Which version should I use to resolve this conflict? 10.4.1, 10.5, 10.4? |
I'd say 10.4.1. |
Just merge this by hand ignoring changes to |
770dd6e
to
d13f527
Compare
d13f527
to
6a9406d
Compare
It's done. Tell me if you want me to move the enum somewhere else. |
I wonder how Github can display "no merge conflicts" here... Let's try. |
Ok, looks like it worked. Thanks for the pull request, @necropotame! |
If you use the last version of DDNet, it will be okay. You can use "/timer cycle" to move between the different way for displaying the race time. |
Using 10.4.1 and /timer cycle is the same as /timer broadcast. |
@necropotame It seems like this broke synchronized envelopes on game time. Do you have any idea if it can be fixed? Pipou is working on a minigame that would need this. |