VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::Rounds Class Reference

runtime.Rounds: the running round's timer, and ending the round with the engine's own win panel and round_end, even with mp_ignore_round_win_conditions on. Team scores are not changed. More...

#include <Rounds.hpp>

Public Member Functions

 Rounds (EntitySystem &entities, const Bindings &bindings, const Clock &clock)
 Rounds (const Rounds &)=delete
Rounds & operator= (const Rounds &)=delete
Status Available () const
Status End (RoundEndReason reason, float delaySeconds) const
Status SetTime (int seconds) const
std::optional< float > TimeLeft () const

Detailed Description

runtime.Rounds: the running round's timer, and ending the round with the engine's own win panel and round_end, even with mp_ignore_round_win_conditions on. Team scores are not changed.

runtime.Rounds.SetTime(45 * 60);
runtime.Rounds.End(VoltMod::RoundEndReason::TerroristsWin, 5.0f);

Game-thread only.

Definition at line 32 of file Rounds.hpp.

Constructor & Destructor Documentation

◆ Rounds() [1/2]

VoltMod::Rounds::Rounds ( EntitySystem & entities,
const Bindings & bindings,
const Clock & clock )
inline

All three must outlive this service.

Definition at line 36 of file Rounds.hpp.

Referenced by operator=(), and Rounds().

◆ Rounds() [2/2]

VoltMod::Rounds::Rounds ( const Rounds & )
delete

References Rounds().

Member Function Documentation

◆ Available()

Status VoltMod::Rounds::Available ( ) const

Whether End works: unsupported when the TerminateRound signature did not bind.

Definition at line 20 of file Rounds.cpp.

References VoltMod::Error::Unsupported().

Referenced by End().

◆ End()

Status VoltMod::Rounds::End ( RoundEndReason reason,
float delaySeconds ) const

End the round for reason; the next one starts after delaySeconds.

Returns
Error::NotReady when no map is running.

Definition at line 29 of file Rounds.cpp.

References Available(), VoltMod::Schema::View::Base(), VoltMod::GameRules(), and VoltMod::NoGameRules().

◆ operator=()

Rounds & VoltMod::Rounds::operator= ( const Rounds & )
delete

References Rounds().

◆ SetTime()

Status VoltMod::Rounds::SetTime ( int seconds) const

Sets the running round to last seconds from its start, whatever mp_roundtime says; the round timer shows it at once. The next round starts from mp_roundtime again.

Returns
Error::NotReady when no map is running.

Definition at line 45 of file Rounds.cpp.

References VoltMod::GameRules(), VoltMod::NoGameRules(), and VoltMod::Schema::CCSGameRules::SetRoundTime().

◆ TimeLeft()

std::optional< float > VoltMod::Rounds::TimeLeft ( ) const

Seconds until the round timer runs out, below 0 once it has; empty when no map is running.

Definition at line 56 of file Rounds.cpp.

References VoltMod::GameRules(), VoltMod::Schema::CCSGameRules::RoundStartTime(), and VoltMod::Schema::CCSGameRules::RoundTime().


The documentation for this class was generated from the following files: