provide client tag in game interface meta

This commit is contained in:
RaidMax 2022-09-21 13:04:15 -05:00
parent cd6097d133
commit e88071684d

View File

@ -415,16 +415,19 @@ function onReceivedDvar(server, dvarName, dvarValue, success) {
let data = []; let data = [];
const metaService = _serviceResolver.ResolveService('IMetaServiceV2');
if (event.subType === 'Meta') { if (event.subType === 'Meta') {
const metaService = _serviceResolver.ResolveService('IMetaServiceV2');
const meta = metaService.GetPersistentMeta(event.data, client.ClientId, token).GetAwaiter().GetResult(); const meta = metaService.GetPersistentMeta(event.data, client.ClientId, token).GetAwaiter().GetResult();
data[event.data] = meta === null ? '' : meta.Value; data[event.data] = meta === null ? '' : meta.Value;
logger.WriteDebug(`event data is ${event.data}`); logger.WriteDebug(`event data is ${event.data}`);
} else { } else {
const tagMeta = metaService.GetPersistentMetaByLookup('ClientTagV2', 'ClientTagNameV2', client.ClientId, token).GetAwaiter().GetResult();
data = { data = {
level: client.Level, level: client.Level,
clientId: client.ClientId, clientId: client.ClientId,
lastConnection: client.LastConnection lastConnection: client.LastConnection,
tag: tagMeta?.Value
}; };
} }