예제 #1
0
        public static string GetUserIdByRoleId(int rid, int serverId)
        {
            RoleMiniInfo roleMiniInfo = GetRoleMiniInfo(rid, serverId);

            if (null != roleMiniInfo)
            {
                return(roleMiniInfo.userId);
            }

            return("");
        }
예제 #2
0
        public static int GetZoneIdByRoleId(long rid, int serverId)
        {
            RoleMiniInfo roleMiniInfo = GetRoleMiniInfo(rid, serverId);

            if (null != roleMiniInfo)
            {
                return(roleMiniInfo.zoneId);
            }

            return(0);
        }
예제 #3
0
        public static string GetUserIdByRoleId(int rid, int serverId)
        {
            RoleMiniInfo roleMiniInfo = CacheManager.GetRoleMiniInfo((long)rid, serverId);
            string       result;

            if (null != roleMiniInfo)
            {
                result = roleMiniInfo.userId;
            }
            else
            {
                result = "";
            }
            return(result);
        }
예제 #4
0
        public static int GetZoneIdByRoleId(long rid, int serverId)
        {
            RoleMiniInfo roleMiniInfo = CacheManager.GetRoleMiniInfo(rid, serverId);
            int          result;

            if (null != roleMiniInfo)
            {
                result = roleMiniInfo.zoneId;
            }
            else
            {
                result = 0;
            }
            return(result);
        }
예제 #5
0
 public static void OnInitGame(GameClient client)
 {
     lock (roleMiniInfoDict)
     {
         RoleMiniInfo roleMiniInfo;
         if (!roleMiniInfoDict.TryGetValue(client.ClientData.RoleID, out roleMiniInfo))
         {
             roleMiniInfo = new RoleMiniInfo()
             {
                 roleId = client.ClientData.RoleID,
                 zoneId = client.ClientData.ZoneID,
                 userId = client.strUserID,
             };
         }
     }
 }
예제 #6
0
 public static void OnInitGame(GameClient client)
 {
     lock (CacheManager.roleMiniInfoDict)
     {
         RoleMiniInfo roleMiniInfo;
         if (!CacheManager.roleMiniInfoDict.TryGetValue((long)client.ClientData.RoleID, out roleMiniInfo))
         {
             roleMiniInfo = new RoleMiniInfo
             {
                 roleId = (long)client.ClientData.RoleID,
                 zoneId = client.ClientData.ZoneID,
                 userId = client.strUserID
             };
         }
     }
 }