TrinityCore
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}
58
59#endif
#define TC_GAME_API
Definition: Define.h:124
uint32_t uint32
Definition: Define.h:143
std::chrono::system_clock::time_point SystemTimePoint
Definition: Duration.h:42
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
Definition: Duration.h:41
WowTime const * GetWowTime()
Definition: GameTime.cpp:97
WowTime const * GetUtcWowTime()
Definition: GameTime.cpp:92
Clock::time_point GetTime()
Current chrono Clock time point.
Definition: GameTime.cpp:65
void UpdateGameTimers()
Definition: GameTime.cpp:102
SystemTimePoint GetSystemTime()
Current chrono system_clock time point.
Definition: GameTime.cpp:54
TimePoint Now()
Current chrono steady_clock time point.
Definition: GameTime.cpp:59
tm const * GetDateAndTime()
Definition: GameTime.cpp:87
time_t GetGameTime()
Definition: GameTime.cpp:44
time_t GetStartTime()
Definition: GameTime.cpp:39
uint32 GetUptime()
Uptime (in secs)
Definition: GameTime.cpp:82
uint32 GetGameTimeMS()
Definition: GameTime.cpp:49