Skip to content

feat: update panel state when round ends #37

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

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ All other information should be explored by reading the source code!
- [2023/3/29 08:46] fix: place history.scores updates to correct loc.([#32](https://github.com/Escapingbug/dotaxctf/pull/32), reporter: AAA剑圣)
- [2023/3/29 11:18] feat: print with `[Sandbox.candidate_name]` banner to support checking specified hero's log.([#33](https://github.com/Escapingbug/dotaxctf/pull/33))
- [2023/3/29 15:26] feat: print with `[Sandbox.candidate_name.script]` banner when script got an error.([#35](https://github.com/Escapingbug/dotaxctf/pull/35))
- [2023/3/29 21:44] feat: remove all nonempty entities after round ends.([#36](https://github.com/Escapingbug/dotaxctf/pull/36))
- [2023/3/29 21:44] fix: remove all nonempty entities after round ends.([#36](https://github.com/Escapingbug/dotaxctf/pull/36))
- [2023/3/29 22:49] feat: update panel state when round ends.([#37](https://github.com/Escapingbug/dotaxctf/pull/37))
12 changes: 12 additions & 0 deletions rounds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ function Rounds:UpdateScoresPanel()
)
end

function Rounds:UpdateRoundEndPanel()
local event = {
round_count = self.round_count
}
CustomGameEventManager:Send_ServerToAllClients(
"roundEnd",
event
)
end

--[[
Send scores to server and reset to 0
]]
Expand Down Expand Up @@ -541,6 +551,7 @@ function Rounds:BeginRound(bot_scripts)
callback = function ()
Timers:RemoveTimer("round_periodic_timer")
Rounds:RoundEndedScoring()
Rounds:UpdateRoundEndPanel()
Rounds:FlushScoresAndRunNextRound()
Sandbox:CleanUpItems()
end
Expand All @@ -556,6 +567,7 @@ function Rounds:BeginRound(bot_scripts)
if #living_teams <= 1 then
Timers:RemoveTimer("round_limit_timer")
Rounds:RoundEndedScoring()
Rounds:UpdateRoundEndPanel()
Rounds:FlushScoresAndRunNextRound()
Sandbox:CleanUpItems()
return
Expand Down