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

Send the race time using warmup timer #602

Merged
merged 3 commits into from Feb 28, 2017

Conversation

necropotame
Copy link
Contributor

  • 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.

@def-
Copy link
Member

def- commented Jan 5, 2017

Was there a discussion about this?

@necropotame
Copy link
Contributor Author

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.

@Learath2
Copy link
Member

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.

@necropotame
Copy link
Contributor Author

@def- Should I remove the version bump, close the PR or keep it like this?

@def-
Copy link
Member

def- commented Feb 27, 2017

Not sure. Do we want this?

@timakro
Copy link
Member

timakro commented Feb 27, 2017

In case features making use of the animation syncing will be added in the future we definitely want this. Like QshaR's interactive maps.

Copy link
Member

@heinrich5991 heinrich5991 left a 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.

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.");
Copy link
Member

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?

else
{
pPlayer->m_TimerType = 1;
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD,"timer","gametimer is not supported by your client.");
Copy link
Member

Choose a reason for hiding this comment

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

Same here.


if((OldType == 1 || OldType == 2) && (pPlayer->m_TimerType == 0 || pPlayer->m_TimerType == 3))
pSelf->SendBroadcast("", pResult->m_ClientID);

Copy link
Member

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).

@necropotame
Copy link
Contributor Author

Which version should I use to resolve this conflict? 10.4.1, 10.5, 10.4?

@heinrich5991
Copy link
Member

I'd say 10.4.1.

@Learath2
Copy link
Member

Just merge this by hand ignoring changes to version.h then commit a seperate version bump.

@necropotame
Copy link
Contributor Author

It's done. Tell me if you want me to move the enum somewhere else.

@heinrich5991
Copy link
Member

I wonder how Github can display "no merge conflicts" here... Let's try.

@heinrich5991 heinrich5991 merged commit 6517567 into ddnet:master Feb 28, 2017
@heinrich5991
Copy link
Member

Ok, looks like it worked. Thanks for the pull request, @necropotame!

@Sonix-
Copy link

Sonix- commented Mar 5, 2017

Any option to hide it or move the timer elsewhere? I find it pretty annoying placed at the middle of the screen. Plus it spams broadcast messages in f1
screenshot_2017-03-05_01-22-59

@necropotame
Copy link
Contributor Author

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.

@Chairn
Copy link
Contributor

Chairn commented Mar 5, 2017

Using 10.4.1 and /timer cycle is the same as /timer broadcast.

@def-
Copy link
Member

def- commented Jun 10, 2020

@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.

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.

None yet

7 participants