1新增 2修复

- 新增getEntityOwnerUniqueId接口
- 修复注册PAPI变量无法使用匿名函数
- 修复注册相同PAPI名字无法重载
This commit is contained in:
子沐呀
2024-07-18 21:39:49 +08:00
Unverified
parent a47f8c729d
commit 52897a25a7
5 changed files with 47 additions and 12 deletions
+4
View File
@@ -1,3 +1,4 @@
#include "GMLIB/Server/PlaceholderAPI.h"
#include "Global.h"
#include <regex>
@@ -25,6 +26,7 @@ bool registerPlayerPlaceholder(
std::string const& PAPIName
) {
if (RemoteCall::hasFunc(PluginName, FuncName)) {
PlaceholderAPI::unregisterPlaceholder(PAPIName);
if (isParameters(PAPIName)) {
auto Call = RemoteCall::importAs<std::string(Player * pl, std::unordered_map<std::string, std::string>)>(
PluginName,
@@ -54,6 +56,7 @@ bool registerServerPlaceholder(
std::string const& PAPIName
) {
if (RemoteCall::hasFunc(PluginName, FuncName)) {
PlaceholderAPI::unregisterPlaceholder(PAPIName);
if (isParameters(PAPIName)) {
auto Call =
RemoteCall::importAs<std::string(std::unordered_map<std::string, std::string>)>(PluginName, FuncName);
@@ -78,6 +81,7 @@ bool registerStaticPlaceholder(
int num
) {
if (RemoteCall::hasFunc(PluginName, FuncName)) {
PlaceholderAPI::unregisterPlaceholder(PAPIName);
if (isParameters(PAPIName)) {
auto Call = RemoteCall::importAs<std::string()>(PluginName, FuncName);
if (num == -1) {