diff --git a/r5dev/game/server/liveapi/liveapi.cpp b/r5dev/game/server/liveapi/liveapi.cpp index 7ad96c52..7333fe72 100644 --- a/r5dev/game/server/liveapi/liveapi.cpp +++ b/r5dev/game/server/liveapi/liveapi.cpp @@ -332,14 +332,6 @@ static bool LiveAPI_CheckSwitchType(HSQUIRRELVM const v, const SQObjectPtr& obj) #define LIVEAPI_UNSUPPORTED_TYPE_ERROR(v, gotType, eventMsg) {v_SQVM_RaiseError(v, "Value type \"%s\" is not supported for message \"%s\".\n", IdType2Name(gotType), eventMsg->GetTypeName().c_str()); return false; } #define LIVEAPI_CHECK_RECURSION_DEPTH(v, currDepth) { if (currDepth > LIVEAPI_MAX_ITEM_DEPTH) { v_SQVM_RaiseError(v, "Exceeded nesting depth limit of \"%i\".", LIVEAPI_MAX_ITEM_DEPTH); return false; }} -uint64_t GetUnixTimeStamp() // TODO: move elsewhere -{ - __time64_t time; - _time64(&time); - - return time; -} - /* ██╗███╗ ██╗████████╗███████╗██████╗ ███╗ ███╗███████╗██████╗ ██╗ █████╗ ██████╗ ██╗ ██╗ diff --git a/r5dev/public/tier0/utility.h b/r5dev/public/tier0/utility.h index cf8e2e1a..f245e34e 100644 --- a/r5dev/public/tier0/utility.h +++ b/r5dev/public/tier0/utility.h @@ -122,6 +122,7 @@ int CompareIPv6(const IN6_ADDR& ipA, const IN6_ADDR& ipB); ///////////////////////////////////////////////////////////////////////////// // Time +uint64_t GetUnixTimeStamp(); std::chrono::nanoseconds IntervalToDuration(const float flInterval); ///////////////////////////////////////////////////////////////////////////// diff --git a/r5dev/tier0/utility.cpp b/r5dev/tier0/utility.cpp index f3105773..0c55dfd1 100644 --- a/r5dev/tier0/utility.cpp +++ b/r5dev/tier0/utility.cpp @@ -1148,6 +1148,16 @@ int CompareIPv6(const IN6_ADDR& ipA, const IN6_ADDR& ipB) return 0; } +/////////////////////////////////////////////////////////////////////////////// +// For obtaining the current timestamp. +uint64_t GetUnixTimeStamp() +{ + __time64_t time; + _time64(&time); + + return time; +} + /////////////////////////////////////////////////////////////////////////////// // For obtaining a duration from a certain interval. std::chrono::nanoseconds IntervalToDuration(const float flInterval)