示例#1
0
 /// <summary>
 /// 通知玩家、角色服务分配信息
 /// </summary>
 /// <param name="playerIDList"></param>
 /// <param name="allocSvrList"></param>
 public void OnNotifyPlayerListSvrAllocInfo(ref TStrList loginNameList, ref PtPlayerAllocSvrList allocSvrList)
 {
     for (int i = 0; i < loginNameList.GetElements().Count; ++i)
     {
         UserSvrInfo svrInfo = new UserSvrInfo();
         svrInfo.m_LoginName = loginNameList.GetElements()[i];
         for (int j = 0; j < allocSvrList.GetElements().Count; ++j)
         {
             if (allocSvrList.GetElements()[j].svrType == eServerType.GAME)
             {
                 svrInfo.m_GameServerName = allocSvrList.GetElements()[j].svrName;
             }
             else if (allocSvrList.GetElements()[j].svrType == eServerType.GATEWAY)
             {
                 svrInfo.m_GateWayName = allocSvrList.GetElements()[j].svrName;
             }
         }
         AllocSvrMap.Instance.AddPlayerSvrInfo(svrInfo);
     }
 }
示例#2
0
        /// <summary>
        /// 通知玩家服务分配信息
        /// </summary>
        /// <param name="userID">玩家ID</param>
        /// <param name="allocSvrList">服务分配信息</param>
        public void OnNotifyPlayerSvrAllocInfo(string loginName, ref PtPlayerAllocSvrList allocSvrList)
        {
            UserSvrInfo svrInfo = new UserSvrInfo();

            svrInfo.m_LoginName = loginName;
            //SvLogger.Debug("OnNotifyPlayerSvrAllocInfo Begin: PlayerFlagID={0}, AllocSvrCount={1}.", svrInfo.m_PlayerFlagID, allocSvrList.GetElements().Count);

            for (int i = 0; i < allocSvrList.GetElements().Count; ++i)
            {
                if (allocSvrList.GetElements()[i].svrType == eServerType.GAME)
                {
                    svrInfo.m_GameServerName = allocSvrList.GetElements()[i].svrName;
                }
                else if (allocSvrList.GetElements()[i].svrType == eServerType.GATEWAY)
                {
                    svrInfo.m_GateWayName = allocSvrList.GetElements()[i].svrName;
                }
            }
            AllocSvrMap.Instance.AddPlayerSvrInfo(svrInfo);

            //SvLogger.Debug("OnNotifyPlayerSvrAllocInfo Done.");
        }