CS2-Kit
C++23 library for CS2 Metamod:Source plugin development
Loading...
Searching...
No Matches
Player.cpp
Go to the documentation of this file.
1#include <CS2Kit/Players/Player.hpp>
2#include <CS2Kit/Utils/TimeUtils.hpp>
3
5{
6
7using namespace CS2Kit::Utils;
8
9Player::Player(int slot, int64_t steamId, const std::string& name, const std::string& ipAddress)
10 : _slot(slot), _steamId(steamId), _name(name), _ipAddress(ipAddress), _connectTime(TimeUtils::Now())
11{}
12
13int64_t Player::GetPlaytime() const
14{
15 return TimeUtils::Now() - _connectTime;
16}
17
18} // namespace CS2Kit::Players