From e88071684de63d42c13c3adbba4f4159fb58b59a Mon Sep 17 00:00:00 2001 From: RaidMax Date: Wed, 21 Sep 2022 13:04:15 -0500 Subject: [PATCH] provide client tag in game interface meta --- Plugins/ScriptPlugins/GameInterface.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugins/ScriptPlugins/GameInterface.js b/Plugins/ScriptPlugins/GameInterface.js index 40539e055..48af51915 100644 --- a/Plugins/ScriptPlugins/GameInterface.js +++ b/Plugins/ScriptPlugins/GameInterface.js @@ -415,16 +415,19 @@ function onReceivedDvar(server, dvarName, dvarValue, success) { let data = []; + const metaService = _serviceResolver.ResolveService('IMetaServiceV2'); + if (event.subType === 'Meta') { - const metaService = _serviceResolver.ResolveService('IMetaServiceV2'); const meta = metaService.GetPersistentMeta(event.data, client.ClientId, token).GetAwaiter().GetResult(); data[event.data] = meta === null ? '' : meta.Value; logger.WriteDebug(`event data is ${event.data}`); } else { + const tagMeta = metaService.GetPersistentMetaByLookup('ClientTagV2', 'ClientTagNameV2', client.ClientId, token).GetAwaiter().GetResult(); data = { level: client.Level, clientId: client.ClientId, - lastConnection: client.LastConnection + lastConnection: client.LastConnection, + tag: tagMeta?.Value }; }