Skip to content

Commit 0006631

Browse files
committed
chore: update levilamina to 0.9.3
1 parent 3b0bc49 commit 0006631

File tree

13 files changed

+59
-50
lines changed

13 files changed

+59
-50
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.4.9] - 2024-03-11
8+
## [0.4.10] - 2024-03-14
9+
10+
### Changed
11+
12+
- Support LeviLamina 0.9.3
913

1014
### Fixed
1115

@@ -162,7 +166,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
162166
[#53]: https://github.com/LiteLDev/LegacyScriptEngine/issues/53
163167
[#54]: https://github.com/LiteLDev/LegacyScriptEngine/issues/54
164168

165-
[0.4.9]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.4.8...v0.4.9
169+
[0.4.10]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.4.8...v0.4.10
166170
[0.4.8]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.4.7...v0.4.8
167171
[0.4.7]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.4.6...v0.4.7
168172
[0.4.6]: https://github.com/LiteLDev/LegacyScriptEngine/compare/v0.4.3...v0.4.6

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "native",
55
"description": "A plugin engine for running LLSE plugins on LeviLamina",
66
"author": "LiteLDev",
7-
"version": "0.4.9",
7+
"version": "0.4.10",
88
"dependencies": [
99
{
1010
"name": "LegacyMoney"

src/legacy/api/EntityAPI.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,9 @@ Local<Value> EntityClass::getEntityFromViewVector(const Arguments& args) {
13791379
}
13801380
HitResult result = actor->traceRay(maxDistance, true, false);
13811381
Actor* entity = result.getEntity();
1382-
if (entity) return EntityClass::newEntity(entity);
1382+
if (entity) {
1383+
return EntityClass::newEntity(entity);
1384+
}
13831385
return Local<Value>();
13841386
}
13851387
CATCH("Fail in getEntityFromViewVector!");
@@ -1434,7 +1436,9 @@ Local<Value> EntityClass::getBlockFromViewVector(const Arguments& args) {
14341436
bp = res.mBlockPos;
14351437
}
14361438
Block const& bl = actor->getDimensionBlockSource().getBlock(bp);
1437-
if (bl.isEmpty()) return Local<Value>();
1439+
if (bl.isEmpty()) {
1440+
return Local<Value>();
1441+
}
14381442
return BlockClass::newBlock(std::move(&bl), &bp, actor->getDimensionId().id);
14391443
}
14401444
CATCH("Fail in getBlockFromViewVector!");

src/legacy/api/PlayerAPI.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,7 +2981,6 @@ Local<Value> PlayerClass::getAttributes(const Arguments& args) {
29812981
}
29822982

29832983
Local<Value> PlayerClass::getEntityFromViewVector(const Arguments& args) {
2984-
29852984
try {
29862985
Player* player = get();
29872986
if (!player) return Local<Value>();
@@ -2992,7 +2991,9 @@ Local<Value> PlayerClass::getEntityFromViewVector(const Arguments& args) {
29922991
}
29932992
HitResult result = player->traceRay(maxDistance, true, false);
29942993
Actor* entity = result.getEntity();
2995-
if (entity) return EntityClass::newEntity(entity);
2994+
if (entity) {
2995+
return EntityClass::newEntity(entity);
2996+
}
29962997
return Local<Value>();
29972998
}
29982999
CATCH("Fail in getEntityFromViewVector!");
@@ -3003,10 +3004,10 @@ Local<Value> PlayerClass::getBlockFromViewVector(const Arguments& args) {
30033004
Player* player = get();
30043005
if (!player) return Local<Value>();
30053006
bool includeLiquid = false;
3006-
bool solidOnly = false; // not used
3007+
bool solidOnly = false;
30073008
float maxDistance = 5.25f;
3008-
bool ignoreBorderBlocks = true; // not used
3009-
bool fullOnly = false; // not used
3009+
bool ignoreBorderBlocks = true;
3010+
bool fullOnly = false;
30103011
if (args.size() > 0) {
30113012
CHECK_ARG_TYPE(args[0], ValueKind::kBoolean);
30123013
includeLiquid = args[0].asBoolean().value();
@@ -3041,15 +3042,16 @@ Local<Value> PlayerClass::getBlockFromViewVector(const Arguments& args) {
30413042
}
30423043
);
30433044

3044-
return Local<Value>();
30453045
BlockPos bp;
30463046
if (includeLiquid && res.mIsHitLiquid) {
30473047
bp = res.mLiquidPos;
30483048
} else {
30493049
bp = res.mBlockPos;
30503050
}
30513051
Block const& bl = player->getDimensionBlockSource().getBlock(bp);
3052-
if (bl.isEmpty()) return Local<Value>();
3052+
if (bl.isEmpty()) {
3053+
return Local<Value>();
3054+
}
30533055
return BlockClass::newBlock(std::move(&bl), std::move(&bp), &player->getDimensionBlockSource());
30543056
}
30553057
CATCH("Fail in getBlockFromViewVector!");

src/legacy/api/ScriptAPI.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <thread>
1414
#include <windows.h>
1515

16-
#define H ll::hash_utils::do_hash
16+
using ll::hash_utils::doHash;
1717

1818
//////////////////// APIs ////////////////////
1919

@@ -36,50 +36,50 @@ Local<Value> ColorLog(const Arguments& args) {
3636

3737
try {
3838
std::string prefix = "";
39-
switch (H(args[0].asString().toString())) {
40-
case H("dk_blue"):
39+
switch (doHash(args[0].asString().toString())) {
40+
case doHash("dk_blue"):
4141
prefix = "\x1b[34m";
4242
break;
43-
case H("dk_green"):
43+
case doHash("dk_green"):
4444
prefix = "\x1b[32m";
4545
break;
46-
case H("bt_blue"):
46+
case doHash("bt_blue"):
4747
prefix = "\x1b[36m";
4848
break;
49-
case H("dk_red"):
49+
case doHash("dk_red"):
5050
prefix = "\x1b[31m";
5151
break;
52-
case H("purple"):
52+
case doHash("purple"):
5353
prefix = "\x1b[35m";
5454
break;
55-
case H("dk_yellow"):
55+
case doHash("dk_yellow"):
5656
prefix = "\x1b[33m";
5757
break;
58-
case H("grey"):
58+
case doHash("grey"):
5959
prefix = "\x1b[37m";
6060
break;
61-
case H("sky_blue"):
61+
case doHash("sky_blue"):
6262
prefix = "\x1b[94m";
6363
break;
64-
case H("blue"):
64+
case doHash("blue"):
6565
prefix = "\x1b[94m";
6666
break;
67-
case H("green"):
67+
case doHash("green"):
6868
prefix = "\x1b[92m";
6969
break;
70-
case H("cyan"):
70+
case doHash("cyan"):
7171
prefix = "\x1b[36m";
7272
break;
73-
case H("red"):
73+
case doHash("red"):
7474
prefix = "\x1b[91m";
7575
break;
76-
case H("pink"):
76+
case doHash("pink"):
7777
prefix = "\x1b[95m";
7878
break;
79-
case H("yellow"):
79+
case doHash("yellow"):
8080
prefix = "\x1b[93m";
8181
break;
82-
case H("white"):
82+
case doHash("white"):
8383
prefix = "\x1b[97m";
8484
break;
8585
default:

src/legacy/engine/TimeTaskSystem.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
#include <shared_mutex>
1616
#include <vector>
1717

18-
std::atomic_uint timeTaskId = 0;
19-
std::mutex locker;
20-
ll::schedule::GameTickScheduler
21-
taskScheduler; // This should be GameTickScheduler or ServerTimeScheduler after fix dead lock problem
18+
std::atomic_uint timeTaskId = 0;
19+
std::mutex locker;
20+
ll::schedule::GameTickScheduler taskScheduler;
2221
struct TimeTaskData {
2322
uint64 task;
2423
script::Global<Function> func;

src/legacy/legacyapi/db/Row.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ RowHeader::~RowHeader() {}
1212

1313
size_t RowHeader::add(const std::string& name) {
1414
push_back(name);
15-
hashes.push_back(ll::hash_utils::do_hash2(name));
15+
hashes.push_back(ll::hash_utils::doHash2(name));
1616
return size() - 1;
1717
}
1818

1919
bool RowHeader::contains(const std::string& name) {
20-
return std::find(hashes.begin(), hashes.end(), ll::hash_utils::do_hash2(name)) != hashes.end();
20+
return std::find(hashes.begin(), hashes.end(), ll::hash_utils::doHash2(name)) != hashes.end();
2121
}
2222

2323
void RowHeader::remove(const std::string& name) {
24-
auto hs = ll::hash_utils::do_hash2(name);
24+
auto hs = ll::hash_utils::doHash2(name);
2525
for (size_t i = 0; i < size(); ++i) {
2626
if (hashes[i] == hs) {
2727
erase(begin() + i);
@@ -33,7 +33,7 @@ void RowHeader::remove(const std::string& name) {
3333
}
3434

3535
size_t RowHeader::at(const std::string& name) {
36-
auto hs = ll::hash_utils::do_hash2(name);
36+
auto hs = ll::hash_utils::doHash2(name);
3737
for (size_t i = 0; i < size(); ++i) {
3838
if (hashes[i] == hs) return i;
3939
}
@@ -63,7 +63,7 @@ bool RowHeader::check(const Row& row) const {
6363
}
6464

6565
size_t RowHeader::operator[](const std::string& name) {
66-
auto hs = ll::hash_utils::do_hash2(name);
66+
auto hs = ll::hash_utils::doHash2(name);
6767
for (size_t i = 0; i < size(); ++i) {
6868
if (hashes[i] == hs) return i;
6969
}

tooth.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "github.com/LiteLDev/LegacyScriptEngine",
4-
"version": "0.4.9",
4+
"version": "0.4.10",
55
"info": {
66
"name": "LegacyScriptEngine",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",
@@ -12,7 +12,7 @@
1212
]
1313
},
1414
"dependencies": {
15-
"gitea.litebds.com/LiteLDev/legacy-script-engine-lua": "0.4.9",
16-
"gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": "0.4.9"
15+
"gitea.litebds.com/LiteLDev/legacy-script-engine-lua": "0.4.10",
16+
"gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": "0.4.10"
1717
}
1818
}

tooth.lua.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-lua",
4-
"version": "0.4.9",
4+
"version": "0.4.10",
55
"info": {
66
"name": "LegacyScriptEngine with Lua backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",
@@ -17,7 +17,7 @@
1717
"github.com/LiteLDev/LegacyMoney": "0.4.x"
1818
},
1919
"prerequisites": {
20-
"github.com/LiteLDev/LeviLamina": "0.9.x"
20+
"github.com/LiteLDev/LeviLamina": ">=0.9.3 <0.10.0"
2121
},
2222
"files": {
2323
"place": [

tooth.nodejs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-nodejs",
4-
"version": "0.4.9",
4+
"version": "0.4.10",
55
"info": {
66
"name": "LegacyScriptEngine with NodeJs backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",
@@ -19,7 +19,7 @@
1919
"gitea.litebds.com/LiteLDev/node-binaries": "16.16.0"
2020
},
2121
"prerequisites": {
22-
"github.com/LiteLDev/LeviLamina": "0.9.x"
22+
"github.com/LiteLDev/LeviLamina": ">=0.9.3 <0.10.0"
2323
},
2424
"files": {
2525
"place": [

tooth.python.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-python",
4-
"version": "0.4.9",
4+
"version": "0.4.10",
55
"info": {
66
"name": "LegacyScriptEngine with Python backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",
@@ -18,7 +18,7 @@
1818
"gitea.litebds.com/LiteLDev/python-binaries": "3.10.11"
1919
},
2020
"prerequisites": {
21-
"github.com/LiteLDev/LeviLamina": "0.9.x"
21+
"github.com/LiteLDev/LeviLamina": ">=0.9.3 <0.10.0"
2222
},
2323
"files": {
2424
"place": [

tooth.quickjs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 2,
33
"tooth": "gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs",
4-
"version": "0.4.9",
4+
"version": "0.4.10",
55
"info": {
66
"name": "LegacyScriptEngine with QuickJs backend",
77
"description": "A plugin engine for running LLSE plugins on LeviLamina",
@@ -17,7 +17,7 @@
1717
"github.com/LiteLDev/LegacyMoney": "0.4.x"
1818
},
1919
"prerequisites": {
20-
"github.com/LiteLDev/LeviLamina": "0.9.x"
20+
"github.com/LiteLDev/LeviLamina": ">=0.9.3 <0.10.0"
2121
},
2222
"files": {
2323
"place": [

xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ add_requires(
99
"legacymoney 0.4.0",
1010
"legacyparticleapi 0.4.0",
1111
"legacyremotecall 0.4.0",
12-
"levilamina 0.9.2",
12+
"levilamina 0.9.3",
1313
"lightwebsocketclient",
1414
"magic_enum",
1515
"nlohmann_json",

0 commit comments

Comments
 (0)