44#include " engine/EngineManager.h"
55#include " engine/LocalShareData.h"
66#include " engine/TimeTaskSystem.h"
7- #include " ll/api/service/ServerInfo .h"
7+ #include " ll/api/service/GamingStatus .h"
88#include " ll/api/utils/StringUtils.h"
99
1010#include < corecrt_io.h>
@@ -237,14 +237,14 @@ Local<Value> FileClass::read(const Arguments& args) {
237237 int cnt = args[0 ].toInt ();
238238 script::Global<Function> callbackFunc{args[1 ].asFunction ()};
239239
240- pool.addTask (
240+ pool.execute (
241241 [cnt,
242242 fp{&file},
243243 isBinary{isBinary},
244244 lock{&lock},
245245 callback{std::move (callbackFunc)},
246246 engine{EngineScope::currentEngine ()}]() -> void {
247- if ((ll::getServerStatus () != ll::ServerStatus ::Running)) return ;
247+ if ((ll::getGamingStatus () != ll::GamingStatus ::Running)) return ;
248248 if (!EngineManager::isValid (engine)) return ;
249249
250250 char * buf = new char [cnt];
@@ -276,9 +276,9 @@ Local<Value> FileClass::readLine(const Arguments& args) {
276276 try {
277277 script::Global<Function> callbackFunc{args[0 ].asFunction ()};
278278
279- pool.addTask ([fp{&file}, lock{&lock}, callback{std::move (callbackFunc)}, engine{EngineScope::currentEngine ()}](
279+ pool.execute ([fp{&file}, lock{&lock}, callback{std::move (callbackFunc)}, engine{EngineScope::currentEngine ()}](
280280 ) {
281- if ((ll::getServerStatus () != ll::ServerStatus ::Running)) return ;
281+ if ((ll::getGamingStatus () != ll::GamingStatus ::Running)) return ;
282282 if (!EngineManager::isValid (engine)) return ;
283283
284284 std::string buf;
@@ -304,12 +304,12 @@ Local<Value> FileClass::readAll(const Arguments& args) {
304304 try {
305305 script::Global<Function> callbackFunc{args[0 ].asFunction ()};
306306
307- pool.addTask ([fp{&file},
307+ pool.execute ([fp{&file},
308308 isBinary{isBinary},
309309 lock{&lock},
310310 callback{std::move (callbackFunc)},
311311 engine{EngineScope::currentEngine ()}]() {
312- if ((ll::getServerStatus () != ll::ServerStatus ::Running)) return ;
312+ if ((ll::getGamingStatus () != ll::GamingStatus ::Running)) return ;
313313 if (!EngineManager::isValid (engine)) return ;
314314
315315 lock->lock ();
@@ -351,13 +351,13 @@ Local<Value> FileClass::write(const Arguments& args) {
351351 script::Global<Function> callbackFunc;
352352 if (args.size () >= 2 ) callbackFunc = args[1 ].asFunction ();
353353
354- pool.addTask ([fp{&file},
354+ pool.execute ([fp{&file},
355355 lock{&lock},
356356 data{std::move (data)},
357357 isString,
358358 callback{std::move (callbackFunc)},
359359 engine{EngineScope::currentEngine ()}]() {
360- if ((ll::getServerStatus () != ll::ServerStatus ::Running)) return ;
360+ if ((ll::getGamingStatus () != ll::GamingStatus ::Running)) return ;
361361 if (!EngineManager::isValid (engine)) return ;
362362
363363 lock->lock ();
@@ -390,12 +390,12 @@ Local<Value> FileClass::writeLine(const Arguments& args) {
390390 script::Global<Function> callbackFunc;
391391 if (args.size () >= 2 ) callbackFunc = args[1 ].asFunction ();
392392
393- pool.addTask ([fp{&file},
393+ pool.execute ([fp{&file},
394394 lock{&lock},
395395 data{std::move (data)},
396396 callback{std::move (callbackFunc)},
397397 engine{EngineScope::currentEngine ()}]() {
398- if ((ll::getServerStatus () != ll::ServerStatus ::Running)) return ;
398+ if ((ll::getGamingStatus () != ll::GamingStatus ::Running)) return ;
399399 if (!EngineManager::isValid (engine)) return ;
400400
401401 lock->lock ();
@@ -472,7 +472,7 @@ Local<Value> FileClass::isEOF(const Arguments&) {
472472
473473Local<Value> FileClass::flush (const Arguments&) {
474474 try {
475- pool.addTask ([fp{&file}, lock{&lock}]() {
475+ pool.execute ([fp{&file}, lock{&lock}]() {
476476 lock->lock ();
477477 fp->flush ();
478478 lock->unlock ();
0 commit comments