TrinityCore
Loading...
Searching...
No Matches
GameTime.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GAMETIME_H
19#define __GAMETIME_H
20
21#include "Define.h"
22#include "Duration.h"
23
24class WowTime;
25
26namespace GameTime
27{
28 // Server start time
30
31 // Current server time (unix) in seconds
32 TC_GAME_API time_t GetGameTime();
33
34 // Milliseconds since server start
36
39
42
44 template<typename Clock>
45 typename Clock::time_point GetTime();
46
49
50 TC_GAME_API tm const* GetDateAndTime();
51
53
55
56 void UpdateGameTimers();
57
60}
61
62#endif
#define TC_GAME_API
Definition Define.h:129
uint32_t uint32
Definition Define.h:154
std::chrono::system_clock::time_point SystemTimePoint
Definition Duration.h:41
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
Definition Duration.h:40
WowTime const * GetWowTime()
Definition GameTime.cpp:106
SystemTimePoint GetTime< std::chrono::system_clock >()
Definition GameTime.cpp:80
WowTime const * GetUtcWowTime()
Definition GameTime.cpp:101
Clock::time_point GetTime()
Current chrono Clock time point.
Definition GameTime.cpp:73
void UpdateGameTimers()
Definition GameTime.cpp:111
SystemTimePoint GetSystemTime()
Current chrono system_clock time point.
Definition GameTime.cpp:62
TimePoint Now()
Current chrono steady_clock time point.
Definition GameTime.cpp:67
tm const * GetDateAndTime()
Definition GameTime.cpp:96
time_t GetGameTime()
Definition GameTime.cpp:52
time_t GetStartTime()
Definition GameTime.cpp:47
uint32 GetUptime()
Uptime (in secs)
Definition GameTime.cpp:91
TimePoint GetTime< std::chrono::steady_clock >()
Definition GameTime.cpp:86
uint32 GetGameTimeMS()
Definition GameTime.cpp:57