Esempio n. 1
0
        // TODO: client should send spouse id
        // 发送婚宴信息
        public void SendMarryPartyList(GameClient client, MarryPartyData partyData, int roleID = -1)
        {
            Dictionary <int, MarryPartyData> marryPartyList;

            if (partyData != null || roleID > 0)
            {
                if (partyData == null)
                {
                    // 获取指定角色婚宴数据
                    partyData = m_MarryPartyDataCache.GetParty(roleID);
                    if (partyData == null)
                    {
                        int SpouseID = MarryLogic.GetSpouseID(roleID);
                        partyData = m_MarryPartyDataCache.GetParty(SpouseID);
                        if (partyData == null)
                        {
                            // 返回空代表通知客戶端自己沒有婚宴
                            partyData = new MarryPartyData();
                        }
                    }
                }

                marryPartyList = new Dictionary <int, MarryPartyData>();
                marryPartyList.Add(roleID, partyData);

                client.sendCmd <Dictionary <int, MarryPartyData> >((int)TCPGameServerCmds.CMD_SPR_MARRY_PARTY_QUERY, marryPartyList);
            }
            else
            {
                // 获取全部婚宴列表
                client.sendCmd(m_MarryPartyDataCache.GetPartyList(TCPOutPacketPool.getInstance(), (int)TCPGameServerCmds.CMD_SPR_MARRY_PARTY_QUERY));
            }
        }
Esempio n. 2
0
 public void SendMarryPartyList(GameClient client, MarryPartyData partyData, int roleID = -1)
 {
     if (partyData != null || roleID > 0)
     {
         if (partyData == null)
         {
             partyData = this.m_MarryPartyDataCache.GetParty(roleID);
             if (partyData == null)
             {
                 int SpouseID = MarryLogic.GetSpouseID(roleID);
                 partyData = this.m_MarryPartyDataCache.GetParty(SpouseID);
                 if (partyData == null)
                 {
                     partyData = new MarryPartyData();
                 }
             }
         }
         client.sendCmd <Dictionary <int, MarryPartyData> >(880, new Dictionary <int, MarryPartyData>
         {
             {
                 roleID,
                 partyData
             }
         }, false);
     }
     else
     {
         client.sendCmd(this.m_MarryPartyDataCache.GetPartyList(TCPOutPacketPool.getInstance(), 880), true);
     }
 }