1111
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "sqstdstring.h"
|
||||
#include "sqstdsystem.h"
|
||||
#include "CConnectPool.h"
|
||||
#include "croncpp.h"
|
||||
#include "l_socket.h"
|
||||
#include <openssl/md5.h>
|
||||
#include <iostream>
|
||||
@@ -868,10 +869,27 @@ static SQInteger AutoReload(HSQUIRRELVM v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SQInteger L_Sq_Cron_Next(HSQUIRRELVM v)
|
||||
{
|
||||
const SQChar *Str;
|
||||
sq_getstring(v, 2, &Str);
|
||||
SQInteger Date;
|
||||
sq_getinteger(v, 3, &Date);
|
||||
|
||||
auto cron = cron::make_cron(Str);
|
||||
std::time_t next = cron::cron_next(cron, Date);
|
||||
sq_pushinteger(v, next);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void RegisterGame(HSQUIRRELVM v)
|
||||
{
|
||||
getConfigPath(szGamePath, sizeof(szGamePath));
|
||||
|
||||
// 获取下一个cron
|
||||
register_World_func(v, L_Sq_Cron_Next, _SC("Sq_Cron_Next"));
|
||||
|
||||
// int 和指针相互转换
|
||||
register_World_func(v, RunScript, _SC("sq_RunScript"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user