Skip to content

Commit

Permalink
chore: format all files
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Feb 24, 2024
1 parent b0210af commit 086c379
Show file tree
Hide file tree
Showing 53 changed files with 243 additions and 253 deletions.
26 changes: 13 additions & 13 deletions docs/apis/DataAPI/PermAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@ By static method:

### Properties

Name | Type | Description
-----------------|-----------------|-----------------------
`name` | `String` | The role name
`displayName` | `String` | The role display name
`priority` | `Number` | The role priority
`permissions` | `Array<Object>` | The role permissions
`members` | `Array<String>` | The role members(XUID)
| Name | Type | Description |
| ------------- | --------------- | ---------------------- |
| `name` | `String` | The role name |
| `displayName` | `String` | The role display name |
| `priority` | `Number` | The role priority |
| `permissions` | `Array<Object>` | The role permissions |
| `members` | `Array<String>` | The role members(XUID) |

The `permissions` property is an array of objects, each object contains the following properties:

Name | Type | Description
-----------------|-----------------|-----------------------
`name` | `String` | The permission name
`enabled` | `Boolean` | Whether the permission is enabled
`extra` | `Object` | The extra data of the permission
| Name | Type | Description |
| --------- | --------- | --------------------------------- |
| `name` | `String` | The permission name |
| `enabled` | `Boolean` | Whether the permission is enabled |
| `extra` | `Object` | The extra data of the permission |

<br/>

Expand Down Expand Up @@ -387,4 +387,4 @@ mc.listen("onJoin", function (pl, msg) {
pl.kick("You are not allowed to join this server");
}
});
```
```
26 changes: 13 additions & 13 deletions docs/apis/DataAPI/PermAPI.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@

### 属性

名称 | 类型 | 描述
-----------------|-----------------|-----------------------
`name` | `String` | 身份组名称
`displayName` | `String` | 身份组显示名称
`priority` | `Number` | 身份组优先级,越大越优先
`permissions` | `Array<Object>` | 身份组拥有的权限
`members` | `Array<String>` | 身份组成员的XUID
| 名称 | 类型 | 描述 |
| ------------- | --------------- | ------------------------ |
| `name` | `String` | 身份组名称 |
| `displayName` | `String` | 身份组显示名称 |
| `priority` | `Number` | 身份组优先级,越大越优先 |
| `permissions` | `Array<Object>` | 身份组拥有的权限 |
| `members` | `Array<String>` | 身份组成员的XUID |

`permissions` 属性是一个对象的数组,每个对象都含有以下属性:

名称 | 类型 | 描述
-----------------|-----------------|-----------------------
`name` | `String` | 权限名称
`enabled` | `Boolean` | 权限是否开启
`extra` | `Object` | 权限的额外数据
| 名称 | 类型 | 描述 |
| --------- | --------- | -------------- |
| `name` | `String` | 权限名称 |
| `enabled` | `Boolean` | 权限是否开启 |
| `extra` | `Object` | 权限的额外数据 |

<br/>

Expand Down Expand Up @@ -391,4 +391,4 @@ mc.listen("onJoin", function (pl, msg) {
pl.kick("You are not allowed to join this server");
}
});
```
```
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ nav:
- Home: index.md

- Tutorials:
- tutorials/create_your_first_plugin.md
- tutorials/create_your_first_plugin.md

- faq.md

Expand Down
2 changes: 1 addition & 1 deletion src/baselib/BaseLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def _llse_python_base_lib_command_handle(self, func=None):
def wrapper(func):
self.setCallback(func)
return func

if func:
return wrapper(func)
return wrapper
Expand Down
1 change: 0 additions & 1 deletion src/legacy/api/BaseAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class FloatPos : public FloatVec4, public ScriptClass {
Local<Value> getDimId() { return Number::newNumber(dim); }
Local<Value> toString();


void setX(const Local<Value>& value) { x = value.asNumber().toInt64(); }
void setY(const Local<Value>& value) { y = value.asNumber().toInt64(); }
void setZ(const Local<Value>& value) { z = value.asNumber().toInt64(); }
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/api/BlockEntityAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ class BlockEntityClass : public ScriptClass {
Local<Value> setNbt(const Arguments& args);
Local<Value> getBlock(const Arguments& args);
};
extern ClassDefine<BlockEntityClass> BlockEntityClassBuilder;
extern ClassDefine<BlockEntityClass> BlockEntityClassBuilder;
2 changes: 1 addition & 1 deletion src/legacy/api/CommandCompatibleAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ void ProcessRegCmdQueue();
// 玩家自定义命令注册回调
bool CallPlayerCmdCallback(Player* player, const std::string& cmdPrefix, const std::vector<std::string>& paras);
// 控制台自定义命令注册回调
bool CallServerCmdCallback(const std::string& cmdPrefix, const std::vector<std::string>& paras);
bool CallServerCmdCallback(const std::string& cmdPrefix, const std::vector<std::string>& paras);
2 changes: 1 addition & 1 deletion src/legacy/api/ContainerAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ Local<Value> ContainerClass::isEmpty(const Arguments& args) {
return Boolean::newBoolean(container->isEmpty());
}
CATCH("Fail in isEmpty!");
}
}
2 changes: 1 addition & 1 deletion src/legacy/api/ContainerAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ class ContainerClass : public ScriptClass {
Local<Value> removeAllItems(const Arguments& args);
Local<Value> isEmpty(const Arguments& args);
};
extern ClassDefine<ContainerClass> ContainerClassBuilder;
extern ClassDefine<ContainerClass> ContainerClassBuilder;
4 changes: 0 additions & 4 deletions src/legacy/api/DataAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ extern ClassDefine<void> DataClassBuilder;

Local<Array> objectificationMoneyHistory(const string& res);


//////////////////// Money Static ////////////////////

class MoneyClass {
Expand All @@ -46,7 +45,6 @@ class MoneyClass {
};
extern ClassDefine<void> MoneyClassBuilder;


//////////////////// Classes ////////////////////

class ConfBaseClass {
Expand All @@ -66,7 +64,6 @@ class ConfBaseClass {
virtual Local<Value> write(const Arguments& args) = 0;
};


class ConfJsonClass : public ScriptClass, public ConfBaseClass {
private:
ordered_json jsonConf;
Expand All @@ -93,7 +90,6 @@ class ConfJsonClass : public ScriptClass, public ConfBaseClass {
};
extern ClassDefine<ConfJsonClass> ConfJsonClassBuilder;


class ConfIniClass : public ScriptClass, public ConfBaseClass {
private:
SimpleIni* iniConf;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/api/DeviceAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ class DeviceClass : public ScriptClass {
Local<Value> getServerAddress();
Local<Value> getClientId();
};
extern ClassDefine<DeviceClass> DeviceClassBuilder;
extern ClassDefine<DeviceClass> DeviceClassBuilder;
2 changes: 1 addition & 1 deletion src/legacy/api/EntityAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ class EntityClass : public ScriptClass {
Local<Value> removeEffect(const Arguments& args);
};
extern ClassDefine<EntityClass> EntityClassBuilder;
extern ClassDefine<void> ActorDamageCauseBuilder;
extern ClassDefine<void> ActorDamageCauseBuilder;
1 change: 0 additions & 1 deletion src/legacy/api/EventAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include <shared_mutex>
#include <string>


//////////////////// Listeners ////////////////////

// 监听器表
Expand Down
3 changes: 1 addition & 2 deletions src/legacy/api/FileSystemAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Local<Value> CheckIsDir(const Arguments& args);
Local<Value> GetFileSize(const Arguments& args);
Local<Value> GetFilesList(const Arguments& args);


//////////////////// Classes ////////////////////
class FileClass : public ScriptClass {
private:
Expand Down Expand Up @@ -79,4 +78,4 @@ class FileClass : public ScriptClass {
static Local<Object> newFile(std::fstream&& f, const std::string& path, bool isBinary);
static Local<Value> open(const Arguments& args) { return OpenFile(args); }
};
extern ClassDefine<FileClass> FileClassBuilder;
extern ClassDefine<FileClass> FileClassBuilder;
2 changes: 1 addition & 1 deletion src/legacy/api/GameUtilsAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ ClassDefine<void> TextClassBuilder = defineClass("Format")
.property("StrikeThrough", []() { return String::newString("§m"); })
.property("Random", []() { return String::newString("§k"); })
.property("Clear", []() { return String::newString("§r"); })
.build();
.build();
3 changes: 1 addition & 2 deletions src/legacy/api/GameUtilsAPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once
#include "api/APIHelp.h"


extern ClassDefine<void> TextClassBuilder;
extern ClassDefine<void> TextClassBuilder;
2 changes: 1 addition & 1 deletion src/legacy/api/ItemAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ class ItemClass : public ScriptClass {
Local<Value> match(const Arguments& args);
};

extern ClassDefine<ItemClass> ItemClassBuilder;
extern ClassDefine<ItemClass> ItemClassBuilder;
3 changes: 1 addition & 2 deletions src/legacy/api/LoggerAPI.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "api/APIHelp.h"


//////////////////// Classes ////////////////////

class LoggerClass {
Expand All @@ -20,4 +19,4 @@ class LoggerClass {

static Local<Value> setLogLevel(const Arguments& args);
};
extern ClassDefine<void> LoggerClassBuilder;
extern ClassDefine<void> LoggerClassBuilder;
3 changes: 1 addition & 2 deletions src/legacy/api/McAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <string>


class McClass {
public:
static Local<Value> getBDSVersion(const Arguments& args);
Expand Down Expand Up @@ -72,4 +71,4 @@ class McClass {
static Local<Value> getWeather(const Arguments& args);
static Local<Value> setWeather(const Arguments& args);
};
extern ClassDefine<void> McClassBuilder;
extern ClassDefine<void> McClassBuilder;
2 changes: 1 addition & 1 deletion src/legacy/api/MoreGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class MoreGlobal {
static void Init();
static DBStorage* getDBStorage() { return db; };
static void setDBStorage(DBStorage* dbs) { db = dbs; };
};
};
2 changes: 1 addition & 1 deletion src/legacy/api/NativeStdString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ Local<Value> NativeStdString::destroy() {
return Local<Value>();
}
CATCH("Fail in NativeStdString::destroy!");
}
}
2 changes: 1 addition & 1 deletion src/legacy/api/NativeStdString.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ class NativeStdString : public ScriptClass {
Local<Value> destroy();
};

extern ClassDefine<NativeStdString> NativeStdStringBuilder;
extern ClassDefine<NativeStdString> NativeStdStringBuilder;
2 changes: 1 addition & 1 deletion src/legacy/api/NetworkAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ class HttpResponseClass : public ScriptClass {
Local<Value> getReason();
Local<Value> getVersion();
};
extern ClassDefine<HttpResponseClass> HttpResponseClassBuilder;
extern ClassDefine<HttpResponseClass> HttpResponseClassBuilder;
2 changes: 1 addition & 1 deletion src/legacy/api/PlayerAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ class PlayerClass : public ScriptClass {

Local<Value> setAbility(const Arguments& args);
};
extern ClassDefine<PlayerClass> PlayerClassBuilder;
extern ClassDefine<PlayerClass> PlayerClassBuilder;
3 changes: 1 addition & 2 deletions src/legacy/api/ScoreboardAPI.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "api/APIHelp.h"


//////////////////// Classes ////////////////////
class Objective;
class ObjectiveClass : public ScriptClass {
Expand All @@ -23,4 +22,4 @@ class ObjectiveClass : public ScriptClass {
Local<Value> deleteScore(const Arguments& args);
Local<Value> getScore(const Arguments& args);
};
extern ClassDefine<ObjectiveClass> ObjectiveClassBuilder;
extern ClassDefine<ObjectiveClass> ObjectiveClassBuilder;
3 changes: 1 addition & 2 deletions src/legacy/api/ScriptAPI.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "api/APIHelp.h"


//////////////////// APIs ////////////////////

Local<Value> Log(const Arguments& args);
Expand All @@ -10,4 +9,4 @@ Local<Value> FastLog(const Arguments& args);

Local<Value> SetTimeout(const Arguments& args);
Local<Value> SetInterval(const Arguments& args);
Local<Value> ClearInterval(const Arguments& args);
Local<Value> ClearInterval(const Arguments& args);
2 changes: 1 addition & 1 deletion src/legacy/api/StructureAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ Local<Value> McClass::setStructure(const Arguments& args) {
return Boolean::newBoolean(true);
}
CATCH("Fail in setStructure!");
}
}
3 changes: 1 addition & 2 deletions src/legacy/api/SystemAPI.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "api/APIHelp.h"


//////////////////// System Static ////////////////////

class SystemClass {
Expand All @@ -13,4 +12,4 @@ class SystemClass {
static Local<Value> cmd(const Arguments& args);
static Local<Value> newProcess(const Arguments& args);
};
extern ClassDefine<void> SystemClassBuilder;
extern ClassDefine<void> SystemClassBuilder;
2 changes: 1 addition & 1 deletion src/legacy/engine/LocalShareData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ std::mutex messageLoopLock;
void InitLocalShareData() {
srand(clock());
localShareData = new LocalDataType;
}
}
3 changes: 1 addition & 2 deletions src/legacy/engine/LocalShareData.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <mutex>
#include <string>


//////////////////// Structs ////////////////////

// 命令回调信息结构体
Expand Down Expand Up @@ -61,4 +60,4 @@ extern std::mutex messageLoopLock;

//////////////////// APIs ////////////////////

void InitLocalShareData();
void InitLocalShareData();
2 changes: 1 addition & 1 deletion src/legacy/engine/OperationCount.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class OperationCount {
bool hasReachCount(int count);
bool hasReachMaxEngineCount();
bool hasReachMaxBackendCount();
};
};
2 changes: 1 addition & 1 deletion src/legacy/legacyapi/Base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ inline std::string Decode(const std::string& base64_input) {

return out;
}
} // namespace Base64
} // namespace Base64
2 changes: 1 addition & 1 deletion src/legacy/legacyapi/db/Any.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ Any Any::str2any(const std::string& str) {
} else return Any(str);
}

} // namespace DB
} // namespace DB
2 changes: 1 addition & 1 deletion src/legacy/legacyapi/db/ConnParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ std::string ConnParams::getPath() { return get<std::string>({"path", "file", "fi

std::string ConnParams::getRaw() { return raw; }

} // namespace DB
} // namespace DB
Loading

0 comments on commit 086c379

Please sign in to comment.