2025/07/20 Update

Added PEPS AI.
Full compile.
This commit is contained in:
Jaysyn904
2025-07-20 00:16:36 -04:00
parent 45bdcc5b63
commit df58b1a133
1286 changed files with 142909 additions and 2992 deletions

35
_module/nss/0i_time.nss Normal file
View File

@@ -0,0 +1,35 @@
/*//////////////////////////////////////////////////////////////////////////////
// Script Name: 0i_time
////////////////////////////////////////////////////////////////////////////////
Include script for handling all time functions for the server.
Lokey's functions:
int GetPosixTimestamp();
string GetCurrentDateTime();
*///////////////////////////////////////////////////////////////////////////////
#include "inc_sqlite_time"
// RETURNS a Timestamp in seconds since 1970-01-01.
int GetCurrentTimeInSeconds();
// RETURNS a formated date, good for timestamping logs and text.
string GetCurrentDateTime();
// Sends a server shutdown message 1800 seconds i.e 30 minutes before.
// nDuration is in seconds. i.e. one hours is 3600 defaults to 24 hours (86400).
// Should be put into the servers OnHeartBeat.
void CheckServerShutdownMessage(int nDuration = 86400);
int GetCurrentTimeInSeconds()
{
string stmt = "SELECT strftime('%s','now');";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlStep(sqlQuery);
return SqlGetInt(sqlQuery, 0);
}
string GetCurrentDateTime()
{
string stmt = "SELECT datetime('now', 'localtime')";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlStep(sqlQuery);
return SqlGetString(sqlQuery, 0);
}