public R <ClientDbData> GetDbClientByDbId(ulong clientDbId) { if (clientDbNames.TryGetValue(clientDbId, out var clientData)) { return(clientData); } try { clientData = tsBaseClient.ClientDbInfo(clientDbId); clientDbNames.Store(clientDbId, clientData); return(clientData); } catch (Ts3CommandException) { return("No client found."); } }
public R <ClientDbData> GetDbClientByDbId(ulong clientDbId) { if (clientDbNames.TryGetValue(clientDbId, out var clientData)) { return(clientData); } var result = tsBaseClient.ClientDbInfo(clientDbId); if (!result.Ok) { return("No client found."); } clientData = result.Value; clientDbNames.Store(clientDbId, clientData); return(clientData); }
public string GetNameByDbId(ulong clientDbId) { string name; if (clientDbNames.TryGetValue(clientDbId, out name)) { return(name); } try { var response = tsBaseClient.ClientDbInfo(clientDbId); name = response?.NickName ?? string.Empty; clientDbNames.Add(clientDbId, name); return(name); } catch (Ts3CommandException) { return(null); } }