mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Tier0: move GetUnixTimeStamp() to utility code
This commit is contained in:
parent
d1498240eb
commit
1e8dd63e4c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
██╗███╗ ██╗████████╗███████╗██████╗ ███╗ ███╗███████╗██████╗ ██╗ █████╗ ██████╗ ██╗ ██╗
|
||||
|
@ -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);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user