-
Notifications
You must be signed in to change notification settings - Fork 174
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
Pause/Unpause events and forwards #626
Conversation
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.
I have some suggestions on what to change.
And maybe you should explain more the changes you made, especially the Timer_UnpauseEventCheck()
.
Basically, tell that:
- You cancel the timer if not pauseable
- You cancel the timer if the pause time is unlimited
- You wait while the match is not freezed (
!InFreezeTime
) - You trigger the unpause event when
g_PauseTimeUsed
is less than or equal to 0 (meaning the pause is finished).
scripting/include/get5.inc
Outdated
@@ -38,6 +38,11 @@ enum SideChoice { | |||
SideChoice_KnifeRound, // There will be a knife round to choose sides | |||
}; | |||
|
|||
enum PauseType { | |||
PauseType_Tech, // Technical pause | |||
PauseType_Tac, // Tactical Pause |
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.
Maybe say PauseType_Tactical
instead, it's easier to read.
scripting/get5/eventlogger.sp
Outdated
@@ -78,10 +84,8 @@ public void EventLogger_SeriesStart() { | |||
|
|||
public void EventLogger_MapVetoed(MatchTeam team, const char[] map) { | |||
EventLogger_StartEvent(); | |||
|
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.
Try not to change code in places you are not doing anything important. And maybe follow the existant style.
Like, keep the same style with blank lines in the event logger functions for Pause
and Unpause
too. 😊
scripting/get5/eventlogger.sp
Outdated
EventLogger_EndEvent("pause_command"); | ||
} | ||
|
||
public void EventLogger_Unpause(MatchTeam team) { |
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.
The Command suffix is missing in EventLogger_UnpauseCommand
.
Call_StartForward(g_OnMatchPaused); | ||
Call_PushCell(team); | ||
Call_PushCell(PauseType_Tac); | ||
Call_Finish(); |
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.
A blank line after this? 😅 (sorry, nitpicking)
Get5_MessageToAll("%t", "AdminForceTechPauseInfoMessage"); | ||
return Plugin_Handled; | ||
} | ||
|
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.
Do not remove this line 😊
// Keep running timer until we are paused. | ||
return Plugin_Continue; | ||
} else { | ||
if (g_PauseTimeUsed <= 0) { |
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.
This if instruction is badly indented.
CreateTimer(1.0, Timer_PauseTimeCheck, team, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); | ||
// Keep track of timer, since we don't want several timers created for one pause checking instance. |
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.
Are you sure you need to keep track of it? This would be the only case of that in the project.
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.
Hey! Thanks for taking the time review, it's much appreciated!
I think initially I wanted to keep track of this here because I had an initial assumption/testing that a timer would be created each time a person called the !pause
command, which would create a new timer and erroneously cause another timer, and thus event firing, to be sent off when the timer finished. However, I don't think this is the case upon further review. I'll make that change and remove the handler and test that out here :) Thanks again!
Hey @Drarig29! So I think there may be an issue with pausing that I just encountered, and was wondering how to continue. I've removed the global handler from the timer counter, however I noticed that if you pause during the countdown to knifing (as an example, haven't tested without knife rounds), your pause count goes down, but the game won't pause when it moves to the next state. This will also increase the countdown timer for this functionality to *2 what it should be, and will also create additional timers, but also sends out however many I think somewhere along one of my commits, I used the global handler to check if the timer was running (and also had I also tested this pause issue with the latest commit on the master branch, and it has the same issue where a team's timeout gets taken away and the game does not go into a paused. Should a separate PR/issue be created for this? If so, I won't put a possible fix in this merge. I think this is due to the fact that when both teams are ready, and the game state flips from warmup to knife round during the warmup countdown to knife. This can be observed here Line 1314 in 358a67a
But then https://github.com/splewis/get5/blob/master/scripting/get5/kniferounds.sp#L7 For these 5 seconds, a user on a team can call Thanks! |
Because you tested the issue on the master branch, we are sure it's not your PR which added the bug. So yeah, IMO you should make another issue and a linked PR. And sorry I'm not an expert in CS:GO timings, I'm not even perfectly familiar with the game. What's more, I don't have a server to do the testing anymore, I have a new PC. I just wanted to give a review to wake up the PR 😁 |
9276503
to
1c872d2
Compare
Sorry to wake this old PR, but I was wondering if we could get any progress on it? It would be a nice addition to have so people with different plugins that record events could check if a match is live, or ping someone in discord/web if a match is paused. Thanks! |
9ceca79
to
b85bc86
Compare
b85bc86
to
5977494
Compare
@splewis Apologies for the ping, but I was wondering if this could get reviewed/merged? It would be nice from an event-based perspective to be notified when matches get paused if organizers are running more than one match at a time. |
I'll take a look this week.
…On Tue, Dec 21, 2021, 10:44 AM PhlexPlexico ***@***.***> wrote:
@splewis <https://github.com/splewis> Apologies for the ping, but I was
wondering if this could get reviewed/merged? It would be nice from an
event-based perspective to be notified when matches get paused if
organizers are running more than one match at a time.
—
Reply to this email directly, view it on GitHub
<#626 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAORUVTLQ26HXT5OQGFJQCLUSCVGRANCNFSM4WO6CO2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi!
Per the issue #412, this PR creates some forwards and events for pausing and un-pausing in game, so that they can be used in other applications/plugins as well (such as a web-panel notifying if a match is paused).
I saw that PR #386 hasn't been acted upon since I last looked, and I figured I would take a stab at the fixed timeout issue mentioned, as well as provide some context for a pause.
The pause events also take in which team is making the call, and a reason, either tactical or technical, this is to provide some context and help with a forward to determine why a pause was called.
I tested a few of the different possibilities for pausing, including fixed timer and tech pauses, and I think the events successfully pause/unpause under every event.