public HostInfo GetHostInfo(uint hostId) { var hostInfo = new HostInfo(); //该host包含的所有service的id //该host所有service的address //该host所有service的名称 var aName = GetName(hostId); this.mHNAME2ANAME.TryGetValue(aName, out var aList); List <string> svcNameList = new List <string>(); if (aList != null) { svcNameList = aList.Distinct().Where(m => m.EndsWith("Service")).ToList(); } hostInfo.HostId = hostId; hostInfo.HostName = Global.IdManager.GetHostName(hostId); hostInfo.HostAddr = Global.IdManager.GetHostAddr(hostId);//, false); hostInfo.ServiceId2Name = svcNameList.ToDictionary(m => GetId(m), m => m); hostInfo.ServiceId2TName = svcNameList.ToDictionary(m => GetId(m), m => m); return(hostInfo); }
public HostInfo GetHostInfo(uint hostId) { var hostInfo = new HostInfo(); //该host包含的所有service的id //该host所有service的address //该host所有service的名称 this.mHID2AID.TryGetValue(hostId, out var actorList); List <uint> serviceIdList = new List <uint>(); if (actorList != null) { serviceIdList = actorList.Distinct().Where(m => this.GetActorName(m).EndsWith("Service")).ToList(); } hostInfo.HostId = hostId; hostInfo.HostName = Global.IdManager.GetHostName(hostId); hostInfo.HostAddr = Global.IdManager.GetHostAddr(hostId);//, false); hostInfo.ServiceId2Name = serviceIdList.ToDictionary(m => m, m => this.GetActorName(m)); hostInfo.ServiceId2TName = serviceIdList.ToDictionary(m => m, m => this.GetActorTypename(m)); return(hostInfo); }
public void OnAddHostId(HostInfo hostInfo, Action <bool> callback, RpcContext ctx) { var result = Global.IdManager.RegisterHostInfo(hostInfo); callback(result); }