From b3946d739161e8450d2adb964a034818b088243c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E6=B2=90=E5=91=80?= <163636894+zimuya4153@users.noreply.github.com> Date: Mon, 20 May 2024 01:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AAUserCache?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增getPlayerInfo接口,可以传入xuid/uuid/name快捷获取玩家信息 --- lib/GMLIB_API-JS.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/GMLIB_API-JS.js b/lib/GMLIB_API-JS.js index e8fa42b..a0c49c0 100644 --- a/lib/GMLIB_API-JS.js +++ b/lib/GMLIB_API-JS.js @@ -888,6 +888,10 @@ class UserCache { return result == "" ? null : result; } + static getPlayerInfo(playerIdentifier) { + return GMLIB_API.getAllPlayerInfo().find(Info => Object.keys(Info).some(InfoKey => Info[InfoKey] === playerIdentifier)); + } + static getAllPlayerInfo() { return GMLIB_API.getAllPlayerInfo(); }