コード例 #1
0
ファイル: MyGuildMain.cs プロジェクト: sakura68/portfolio
    /// <summary>
    /// 길드 가입요청 수락& 거절 패킷 받음.
    /// </summary>
    public void GuildJoinRequestAnswer(_stGuildJoinRequestAnswerAck stAck)
    {
        // 가입요청이 수락되면 내 길드에 길드원으로 넣고
        // 길드관리에도 길드원으로 변경.
        // 길드원수 갱신.

        string       str        = string.Empty;
        CGuildMember DestMember = null;

        for (int i = 0; i < m_GuildDetailInfo.vMembers.Count;)
        {
            CGuildMember member = m_GuildDetailInfo.vMembers[i];
            if (member == null)
            {
                continue;
            }

            if (member.kCharNo == stAck.kDestCharNo)
            {
                if (stAck.kAnswer == _enGuildJoinRequestAnswer.eGuildJoinRequestAnswer_YES)
                {
                    // {플레이어 이름}\n님이 길드에 가입되었습니다.(스트링 ID : 6283)
                    str = string.Format(StringTableManager.GetData(6283), member.kCharName);

                    if (member.kMemberState != _enGuildMemberState.eGuildMemberState_Member)
                    {
                        member.kMemberState = _enGuildMemberState.eGuildMemberState_Member;
                        DestMember          = member;
                        m_GuildDetailInfo.kCurrMemberCount++;
                    }
                }
                else if (stAck.kAnswer == _enGuildJoinRequestAnswer.eGuildJoinRequestAnswer_NO)
                {
                    //  {플레이어 이름}\n님의 길드 가입을 거절하였습니다.(스트링 ID : 6279)
                    str = string.Format(StringTableManager.GetData(6279), member.kCharName);
                    m_GuildDetailInfo.vMembers.Remove(member);
                    //m_GuildDetailInfo.kCurrMemberCount--;
                    continue;
                }
                //break;
            }

            ++i;
        }

        // 6254 길드원 ({0} / {1})
        string szLabeltext = string.Format(StringTableManager.GetData(6254), m_GuildDetailInfo.kCurrMemberCount, m_GuildDetailInfo.kMaxMemberCount);

        m_GuildMemberButton.SetLabel(szLabeltext);

        _MyGuild.GuildJoinRequestAnswer(stAck, DestMember, m_GuildDetailInfo);
        _guildModifyWindow.GuildJoinRequestAnswer(stAck, DestMember, m_GuildDetailInfo);

        SystemPopupWindow.Instance.SetSystemPopup(enSystemPopupType.Ok, StringTableManager.GetData(4300), str);
    }
コード例 #2
0
ファイル: GuildModify.cs プロジェクト: sakura68/portfolio
    /// <summary>
    /// 길드 가입요청 수락& 거절 패킷 받음.
    /// </summary>
    public void GuildJoinRequestAnswer(_stGuildJoinRequestAnswerAck stAck, CGuildMember member, CGuildDetail GuildDetailInfo)
    {
        bool isJoinRequest = false;

        for (int i = 0; i < m_MemberList.Count;)
        {
            GuildInformationItem infoItem = m_MemberList[i];
            if (infoItem.MemberInfo.kCharNo == stAck.kDestCharNo)
            {
                DestroyImmediate(infoItem.gameObject);
                m_MemberList.Remove(infoItem);
            }
            else
            {
                ++i;

                if (infoItem.MemberInfo.kMemberState == _enGuildMemberState.eGuildMemberState_Request)
                {
                    isJoinRequest = true;
                }
            }
        }

        m_GuildMemberButton.SetEvent(isJoinRequest);
        if (isJoinRequest == false)
        {
            UserInfo.Instance.otherNew.GuildAlram = _enGuildAlram.eGuildNewMark_None;
        }

        if (stAck.kAnswer == _enGuildJoinRequestAnswer.eGuildJoinRequestAnswer_YES)
        {
            // 수락이면 길드원으로 다시 생성.
            GuildInformationItem memberItem = UIResourceMgr.CreatePrefab <GuildInformationItem>(BUNDLELIST.PREFABS_UI_GUILD, m_GuildMemberGrid.transform, "GuildInformationItem");
            memberItem.Init(enGuildInfo_WindowType.GuildModify, stAck.kGuildKey, member);
            m_MemberList.Add(memberItem);
        }
        else if (stAck.kAnswer == _enGuildJoinRequestAnswer.eGuildJoinRequestAnswer_NO)
        {
            // 거절이면 삭제된 데이터 대입.
            m_GuildDetailInfo = GuildDetailInfo;
        }

        string szLabeltext = string.Format(StringTableManager.GetData(6254), GuildDetailInfo.kCurrMemberCount, GuildDetailInfo.kMaxMemberCount);

        m_GuildMemberButton.SetLabel(szLabeltext);

        SortMemberList();
    }
コード例 #3
0
ファイル: MyGuild.cs プロジェクト: sakura68/portfolio
    /// <summary>
    /// 길드 가입요청 수락& 거절 패킷 받음.
    /// </summary>
    public void GuildJoinRequestAnswer(_stGuildJoinRequestAnswerAck stAck, CGuildMember member, CGuildDetail GuildDetailInfo)
    {
        int iCount = m_MemberList.Count;

        for (int i = 0; i < iCount; ++i)
        {
            GuildInformationItem infoItem = m_MemberList[i];
            if (infoItem == null)
            {
                continue;
            }

            if (infoItem.MemberInfo.kCharNo == stAck.kDestCharNo)
            {
                DestroyImmediate(infoItem.gameObject);
                m_MemberList.Remove(infoItem);
                break;
            }
        }

        if (stAck.kAnswer == _enGuildJoinRequestAnswer.eGuildJoinRequestAnswer_YES)
        {
            // 수락이면 길드원으로 다시 생성.
            GuildInformationItem memberItem = UIResourceMgr.CreatePrefab <GuildInformationItem>(BUNDLELIST.PREFABS_UI_GUILD, m_GuildMemberGrid.transform, "GuildInformationItem");
            memberItem.Init(enGuildInfo_WindowType.GuildModify, stAck.kGuildKey, member);
            m_MemberList.Add(memberItem);
        }
        else if (stAck.kAnswer == _enGuildJoinRequestAnswer.eGuildJoinRequestAnswer_NO)
        {
            // 거절이면 삭제된 데이터 대입.
            m_GuildDetailInfo = GuildDetailInfo;
        }

        // 6587    {0} / {1} 명
        m_TodayAttendanceCountLabel.text = string.Format(StringTableManager.GetData(6587), GuildDetailInfo.kAttendanceCount, GuildDetailInfo.kCurrMemberCount);

        SortMemberList();
    }