예제 #1
0
        private void changeCaptainPos()
        {
            int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count;

            ItemTeamMemberData myTeamData = BaseProxy <TeamProxy> .getInstance().MyTeamData;

            List <ItemTeamData> itemTeamDataList = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList;

            int count2 = this.itemMemberObjList.Count;

            for (int i = 0; i < count; i++)
            {
                for (int j = 0; j < this.itemMemberObjList.Count; j++)
                {
                    bool flag = itemTeamDataList[i].cid == this.itemMemberObjList[j].cid;
                    if (flag)
                    {
                        bool isCaptain = itemTeamDataList[i].isCaptain;
                        if (isCaptain)
                        {
                            a3_currentTeamPanel.ItemMemberObj item = this.itemMemberObjList[j];
                            this.itemMemberObjList.RemoveAt(j);
                            this.itemMemberObjList.Insert(0, item);
                        }
                    }
                }
            }
            for (int k = 0; k < this.itemMemberObjList.Count; k++)
            {
                this.itemMemberObjList[k].root.SetSiblingIndex(k);
            }
        }
        void changeCaptainPos()
        {
            int memberCount                      = TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count;
            ItemTeamMemberData  itmd             = TeamProxy.getInstance().MyTeamData;
            List <ItemTeamData> itemTeamDataList = TeamProxy.getInstance().MyTeamData.itemTeamDataList;
            int imoCount = itemMemberObjList.Count;

            for (int i = 0; i < memberCount; i++)
            {
                for (int j = 0; j < itemMemberObjList.Count; j++)
                {
                    if (itemTeamDataList[i].cid == itemMemberObjList[j].cid)
                    {
                        if (itemTeamDataList[i].isCaptain)
                        {
                            ItemMemberObj imo = itemMemberObjList[j];
                            itemMemberObjList.RemoveAt(j);
                            itemMemberObjList.Insert(0, imo);
                        }
                    }
                }
            }
            for (int i = 0; i < itemMemberObjList.Count; i++)
            {
                itemMemberObjList[i].root.SetSiblingIndex(i);
            }
        }
예제 #3
0
 void SetDissolve(Variant data)//13解散队伍
 {
     A3_TeamModel.getInstance().cidNameElse.Clear();
     joinedTeam = false;
     MyTeamData = null;
     dispatchEvent(GameEvent.Create(EVENT_DISSOLVETEAM, this, data));
 }
예제 #4
0
        private void onAffirminvite(GameEvent e)
        {
            Variant            data             = e.data;
            ItemTeamMemberData affirmInviteData = ModelBase <A3_TeamModel> .getInstance().AffirmInviteData;

            this.team_object_change.value = this.change_v((int)affirmInviteData.ltpid, false);
            this.Show(affirmInviteData);
        }
        void onAffirminvite(GameEvent e)
        {
            Variant            data = e.data;
            ItemTeamMemberData itm  = A3_TeamModel.getInstance().AffirmInviteData;

            team_object_change.value = change_v((int)itm.ltpid, false);
            Show(itm);
        }
예제 #6
0
        private void SetDissolve(Variant data)
        {
            ModelBase <A3_TeamModel> .getInstance().cidNameElse.Clear();

            this.joinedTeam = false;
            this.MyTeamData = null;
            base.dispatchEvent(GameEvent.Create(TeamProxy.EVENT_DISSOLVETEAM, this, data, false));
        }
예제 #7
0
 void SetLeaveTeam(Variant data)
 {
     MyTeamData = null;
     dispatchEvent(GameEvent.Create(EVENT_LEAVETEAM, this, null));
     A3_TeamModel.getInstance().cidNameElse.Clear();
     MonsterMgr._inst.HideInvaildMonster();
     flytxt.instance.fly(ContMgr.getCont("TeamProxy_hanveout"));
 }
예제 #8
0
        private void SetLeaveTeam(Variant data)
        {
            this.MyTeamData = null;
            base.dispatchEvent(GameEvent.Create(TeamProxy.EVENT_LEAVETEAM, this, null, false));
            ModelBase <A3_TeamModel> .getInstance().cidNameElse.Clear();

            MonsterMgr._inst.HideInvaildMonster();
            flytxt.instance.fly("您已离开队伍", 0, default(Color), null);
        }
        void onNoticeHaveMemberLeave(GameEvent e)
        {
            Variant data = e.data;
            uint    cid  = data["cid"];
            //不用删除后边的,直接用set,然后将信息擦除,放到last
            int           indexRemove = (int)TeamProxy.getInstance().MyTeamData.removedIndex;
            ItemMemberObj imo         = itemMemberObjList[indexRemove];

            itemMemberObjList.RemoveAt(indexRemove);
            itemMemberObjList.Add(imo);
            imo.ClearInfo();
            for (int i = indexRemove; i < itemMemberObjList.Count; i++)
            {
                itemMemberObjList[i].root.SetSiblingIndex(i);
            }
            int itemMemberCount = TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count;

            for (int i = indexRemove; i < itemMemberCount; i++)
            {
                ItemTeamData itd = TeamProxy.getInstance().MyTeamData.itemTeamDataList[i];
                itemMemberObjList[i].SetInfo(itd, TeamProxy.getInstance().MyTeamData.meIsCaptain);
            }
            for (int i = itemMemberCount; i < itemMemberObjList.Count; i++)//对空位置的操作
            {
                if (TeamProxy.getInstance().MyTeamData.meIsCaptain || TeamProxy.getInstance().MyTeamData.membInv)
                {
                    itemMemberObjList[i].ClearInfo(true);
                }
                else
                {
                    itemMemberObjList[i].ClearInfo();
                }
            }
            if (TeamProxy.getInstance().MyTeamData.meIsCaptain)
            {
                togInvite.gameObject.SetActive(true);
                //  togJoin.gameObject.SetActive(true);
                if (togInvite.isOn != TeamProxy.getInstance().MyTeamData.membInv)
                {
                    togInvite.isOn = TeamProxy.getInstance().MyTeamData.membInv;
                }
                // if (togJoin.isOn != TeamProxy.getInstance().MyTeamData.dirJoin)
                //{
                //     togJoin.isOn = TeamProxy.getInstance().MyTeamData.dirJoin;
                // }
            }
            else
            {
                togInvite.gameObject.SetActive(false);
                //  togJoin.gameObject.SetActive(false);
            }
            setTeamBuffTxt();
            ItemTeamMemberData itm = TeamProxy.getInstance().MyTeamData;

            Show(itm);
        }
예제 #10
0
        private void changeCaptain()
        {
            int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count;

            ItemTeamMemberData myTeamData = BaseProxy <TeamProxy> .getInstance().MyTeamData;

            List <ItemTeamData> itemTeamDataList = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList;

            int count2 = this.itemMemberObjList.Count;

            for (int i = 0; i < count; i++)
            {
                for (int j = 0; j < this.itemMemberObjList.Count; j++)
                {
                    bool flag = itemTeamDataList[i].cid == this.itemMemberObjList[j].cid;
                    if (flag)
                    {
                        bool meIsCaptain = myTeamData.meIsCaptain;
                        if (meIsCaptain)
                        {
                            this.itemMemberObjList[j].ChangeToMeCaptain(itemTeamDataList[i], null);
                        }
                        else
                        {
                            this.itemMemberObjList[j].ChangeToMeCustom();
                        }
                    }
                }
            }
            bool meIsCaptain2 = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

            if (meIsCaptain2)
            {
                for (int k = count; k < count2; k++)
                {
                    this.itemMemberObjList[k].ChangeToMeCaptain(null, myTeamData);
                }
            }
            bool meIsCaptain3 = myTeamData.meIsCaptain;

            if (meIsCaptain3)
            {
                this.togInvite.gameObject.SetActive(true);
                this.togJoin.gameObject.SetActive(true);
                bool membInv = BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv;

                this.togInvite.GetComponent <Toggle>().isOn = membInv;
                bool dirJoin = BaseProxy <TeamProxy> .getInstance().MyTeamData.dirJoin;

                this.togJoin.GetComponent <Toggle>().isOn = dirJoin;
            }
            this.changeCaptainPos();
        }
예제 #11
0
        void SetCreateTeam(Variant data)
        {
            //teamPosMapid1.Clear();
            if (MyTeamData != null)
            {
                MyTeamData = null; MyTeamData = new ItemTeamMemberData();
            }
            else
            {
                MyTeamData = new ItemTeamMemberData();
            }
            joinedTeam = true;

            uint teamId = data["teamid"];

            ItemTeamData itd = new ItemTeamData();

            itd.name                = PlayerModel.getInstance().name;
            itd.lvl                 = PlayerModel.getInstance().lvl;
            itd.knightage           = PlayerModel.getInstance().clanid.ToString();
            itd.mapId               = PlayerModel.getInstance().mapid;
            itd.MembCount           = 1;
            itd.cid                 = PlayerModel.getInstance().cid;
            itd.zhuan               = PlayerModel.getInstance().up_lvl;
            itd.combpt              = PlayerModel.getInstance().combpt;
            itd.teamId              = teamId;
            itd.isCaptain           = true;
            itd.showRemoveMemberBtn = false;
            itd.online              = true;
            MyTeamData.teamId       = teamId;
            MyTeamData.dirJoin      = true;
            MyTeamData.membInv      = false;
            MyTeamData.leaderCid    = itd.cid;
            MyTeamData.meIsCaptain  = true;
            MyTeamData.ltpid        = data["ltpid"];
            MyTeamData.itemTeamDataList.Add(itd);
            dispatchEvent(GameEvent.Create(EVENT_CREATETEAM, this, data));
            SendEditorInfoDirJoin(true);//是否允许玩家加入
            if (!A3_TeamModel.getInstance().cidNameElse.ContainsKey(itd.cid))
            {
                A3_TeamModel.getInstance().cidNameElse.Add(itd.cid, itd.name);
            }
            //if (trage == true)
            //{

            //}
            //点击他人信息组队(若没有队伍先创建在组队)
            if (now_Team)
            {
                TeamProxy.getInstance().SendInvite(trage_cid);
                now_Team = false;
            }
        }
예제 #12
0
        private void SetCreateTeam(Variant data)
        {
            bool flag = this.MyTeamData != null;

            if (flag)
            {
                this.MyTeamData = null;
                this.MyTeamData = new ItemTeamMemberData();
            }
            else
            {
                this.MyTeamData = new ItemTeamMemberData();
            }
            this.joinedTeam = true;
            uint         teamId       = data["teamid"];
            ItemTeamData itemTeamData = new ItemTeamData();

            itemTeamData.name = ModelBase <PlayerModel> .getInstance().name;

            itemTeamData.lvl = ModelBase <PlayerModel> .getInstance().lvl;

            itemTeamData.knightage = ModelBase <PlayerModel> .getInstance().clanid.ToString();

            itemTeamData.mapId = ModelBase <PlayerModel> .getInstance().mapid;

            itemTeamData.MembCount = 1;
            itemTeamData.cid       = ModelBase <PlayerModel> .getInstance().cid;

            itemTeamData.zhuan = ModelBase <PlayerModel> .getInstance().up_lvl;

            itemTeamData.combpt = ModelBase <PlayerModel> .getInstance().combpt;

            itemTeamData.teamId              = teamId;
            itemTeamData.isCaptain           = true;
            itemTeamData.showRemoveMemberBtn = false;
            itemTeamData.online              = true;
            this.MyTeamData.teamId           = teamId;
            this.MyTeamData.dirJoin          = true;
            this.MyTeamData.membInv          = false;
            this.MyTeamData.leaderCid        = itemTeamData.cid;
            this.MyTeamData.meIsCaptain      = true;
            this.MyTeamData.ltpid            = data["ltpid"];
            this.MyTeamData.itemTeamDataList.Add(itemTeamData);
            base.dispatchEvent(GameEvent.Create(TeamProxy.EVENT_CREATETEAM, this, data, false));
            this.SendEditorInfoDirJoin(true);
            bool flag2 = !ModelBase <A3_TeamModel> .getInstance().cidNameElse.ContainsKey(itemTeamData.cid);

            if (flag2)
            {
                ModelBase <A3_TeamModel> .getInstance().cidNameElse.Add(itemTeamData.cid, itemTeamData.name);
            }
        }
예제 #13
0
 //创建刷新数据
 public void GetTeam_info(ItemTeamMemberData itm)
 {
     // ItemTeamMemberData itm = TeamProxy.getInstance()?.pageItemTeamData;
     itdList.Clear();
     for (int i = 0; i < itm.itemTeamDataList.Count; i++)
     {
         //if (itm.itemTeamDataList[i].ltpid == v)
         //{
         itdList.Add(itm.itemTeamDataList[i]);
         //}
     }
     Set_teaminfo();
 }
예제 #14
0
        private void Get_curPageTeam_info(Variant data)
        {
            pageItemTeamData = new ItemTeamMemberData();
            List <ItemTeamData> pageteamListInfoDataList = new List <ItemTeamData>();

            pageteamListInfoDataList.Clear();
            uint totalCount = data["total_cnt"];
            uint idx_begin  = data["idx_begin"];

            if (a3_SpeedTeam.instance != null)
            {
                a3_SpeedTeam.instance.allnum     = (int)totalCount;
                a3_SpeedTeam.instance.begion_idx = (int)idx_begin;
            }
            pageItemTeamData.totalCount = totalCount;
            pageItemTeamData.idxBegin   = idx_begin;
            List <Variant> info = data["info"]._arr;

            foreach (Variant item in info)
            {
                ItemTeamData tlid = new ItemTeamData();
                tlid.teamId  = item["tid"];
                tlid.curcnt  = item["curcnt"];
                tlid.maxcnt  = item["maxcnt"];
                tlid.name    = item["lname"];
                tlid.carr    = item["lcarr"];
                tlid.lvl     = item["llevel"];
                tlid.zhuan   = item["lzhuan"];
                tlid.mapId   = item["lmapid"];
                tlid.ltpid   = item["ltpid"];
                tlid.ldiff   = item["ldiff"];
                tlid.members = item["members"]._arr;
                if (string.IsNullOrEmpty(item["lclname"]))
                {
                    tlid.knightage = ContMgr.getCont("FriendProxy_wu");
                }
                else
                {
                    tlid.knightage = item["lclname"];
                }
                pageteamListInfoDataList.Add(tlid);
                //itdList.Add(pageteamListInfoDataList.itemTeamDataList[i]);
                //teamPosMapid.Add(tlid);
            }
            pageItemTeamData.itemTeamDataList = pageteamListInfoDataList;
            a3_SpeedTeam.instance?.GetTeam_info(pageItemTeamData);
            dispatchEvent(GameEvent.Create(EVENT_CURPAGE_TEAM, this, data));
        }
        /// <summary>
        /// for case 10  确认申请 申请者会推送队伍的信息res=10 不会单独推确认信息 拒绝申请会推res=21
        /// </summary>
        /// <param name="itm"></param>
        public void Show(ItemTeamMemberData itm)
        {
            int itmCount = itm.itemTeamDataList.Count;

            for (int i = 0, j = 0; i < itmCount; i++, j++)
            {
                if (itemMemberObjList.Exists((item) => item.cid == itm.itemTeamDataList[i].cid))
                {
                    j--;
                    continue;
                }
                itemMemberObjList[j].SetInfo(itm.itemTeamDataList[i], itm.meIsCaptain);
            }
            setTeamBuffTxt();
            for (int i = itmCount; i < 5; i++)//将剩余的位置设置为空,即只显示邀请按钮
            {
                if (itm.meIsCaptain || itm.membInv)
                {
                    itemMemberObjList[i].ClearInfo(true);
                }
                else
                {
                    itemMemberObjList[i].ClearInfo();
                }
            }

            this.gameObject.SetActive(true);
            a3_teamPanel._instance.gameObject.SetActive(false);
            if (itm.leaderCid == PlayerModel.getInstance().cid)
            {
                if (togInvite.isOn != itm.membInv)
                {
                    togInvite.isOn = itm.membInv;
                }
                //if (togJoin.isOn != itm.dirJoin) togJoin.isOn = itm.dirJoin;
            }
            else
            {
                togInvite.gameObject.SetActive(false);
                //togJoin.gameObject.SetActive(false);
            }
            cid = itm.leaderCid;

            // team_object_change.value = change_v((int)itm.ltpid, false);
            // Debug.LogError(change_v((int)itm.ltpid, false));
            //Debug.LogError(itm.ltpid + "ssss" + itm.leaderCid + "ss" + itm.meIsCaptain + "ss" + itm.membInv);
        }
예제 #16
0
        private void Get_curPageTeam_info(Variant data)
        {
            this.pageItemTeamData = new ItemTeamMemberData();
            List <ItemTeamData> list = new List <ItemTeamData>();

            list.Clear();
            uint totalCount = data["total_cnt"];
            uint idxBegin   = data["idx_begin"];

            this.pageItemTeamData.totalCount = totalCount;
            this.pageItemTeamData.idxBegin   = idxBegin;
            List <Variant> arr = data["info"]._arr;

            foreach (Variant current in arr)
            {
                ItemTeamData itemTeamData = new ItemTeamData();
                itemTeamData.teamId  = current["tid"];
                itemTeamData.curcnt  = current["curcnt"];
                itemTeamData.maxcnt  = current["maxcnt"];
                itemTeamData.name    = current["lname"];
                itemTeamData.carr    = current["lcarr"];
                itemTeamData.lvl     = current["llevel"];
                itemTeamData.zhuan   = current["lzhuan"];
                itemTeamData.mapId   = current["lmapid"];
                itemTeamData.ltpid   = current["ltpid"];
                itemTeamData.ldiff   = current["ldiff"];
                itemTeamData.members = current["members"]._arr;
                bool flag = string.IsNullOrEmpty(current["lclname"]);
                if (flag)
                {
                    itemTeamData.knightage = "无";
                }
                else
                {
                    itemTeamData.knightage = current["lclname"];
                }
                list.Add(itemTeamData);
            }
            this.pageItemTeamData.itemTeamDataList = list;
            a3_SpeedTeam expr_209 = a3_SpeedTeam.instance;

            if (expr_209 != null)
            {
                expr_209.GetTeam_info(this.pageItemTeamData);
            }
            base.dispatchEvent(GameEvent.Create(TeamProxy.EVENT_CURPAGE_TEAM, this, list, false));
        }
예제 #17
0
        void onGetTeamListInfo(GameEvent e)
        {
            ItemTeamMemberData itm      = TeamProxy.getInstance().mapItemTeamData;
            List <uint>        newTeams = new List <uint>();

            newTeams.Clear();
            for (int i = 0; i < itm.itemTeamDataList.Count; i++)
            {
                newTeams.Add(itm.itemTeamDataList[i].teamId);
            }
            Dictionary <uint, itemTeamInfoPrefab> needRemoveDic = new Dictionary <uint, itemTeamInfoPrefab>();

            needRemoveDic.Clear();
            foreach (KeyValuePair <uint, itemTeamInfoPrefab> itip in itemTeamInfoPrefabDic)
            {
                if (!newTeams.Contains(itip.Key))
                {
                    needRemoveDic[itip.Key] = itip.Value;
                }
            }
            foreach (KeyValuePair <uint, itemTeamInfoPrefab> itip in needRemoveDic)
            {
                if (itemTeamInfoPrefabDic[itip.Key].root != null)
                {
                    GameObject.Destroy(itemTeamInfoPrefabDic[itip.Key].root.gameObject);
                }
                itemTeamInfoPrefabDic.Remove(itip.Key);
            }

            uint totalCount = itm.totalCount;
            uint indexBegin = itm.idxBegin;

            foreach (ItemTeamData tlid in itm.itemTeamDataList)
            {
                if (itemTeamInfoPrefabDic.ContainsKey(tlid.teamId))
                {
                    itemTeamInfoPrefabDic[tlid.teamId].Set(tlid);
                }
                else
                {
                    itemTeamInfoPrefab itip = new itemTeamInfoPrefab(transform);
                    itip.Set(tlid);
                    itemTeamInfoPrefabDic[tlid.teamId] = itip;
                }
            }
        }
예제 #18
0
        public void Show(ItemTeamMemberData itm)
        {
            int count = itm.itemTeamDataList.Count;

            for (int i = 0; i < count; i++)
            {
                this.itemMemberObjList[i].SetInfo(itm.itemTeamDataList[i], itm.meIsCaptain);
            }
            this.setTeamBuffTxt();
            for (int j = count; j < 5; j++)
            {
                bool flag = itm.meIsCaptain || itm.membInv;
                if (flag)
                {
                    this.itemMemberObjList[j].ClearInfo(true);
                }
                else
                {
                    this.itemMemberObjList[j].ClearInfo(false);
                }
            }
            base.gameObject.SetActive(true);
            a3_teamPanel._instance.gameObject.SetActive(false);
            bool flag2 = itm.leaderCid == ModelBase <PlayerModel> .getInstance().cid;

            if (flag2)
            {
                bool flag3 = this.togInvite.isOn != itm.membInv;
                if (flag3)
                {
                    this.togInvite.isOn = itm.membInv;
                }
                bool flag4 = this.togJoin.isOn != itm.dirJoin;
                if (flag4)
                {
                    this.togJoin.isOn = itm.dirJoin;
                }
            }
            else
            {
                this.togInvite.gameObject.SetActive(false);
                this.togJoin.gameObject.SetActive(false);
            }
            this.cid = itm.leaderCid;
        }
 public void ChangeToMeCaptain(ItemTeamData itd = null, ItemTeamMemberData itmd = null)//原队长离队,自己变成队长时候
 {
     if (itd != null)
     {
         cid = itd.cid;
         if (itd.cid != PlayerModel.getInstance().cid)
         {
             btnRemoveTeam.gameObject.SetActive(true);
         }
     }
     else
     {
         if (itmd != null)
         {
             btnInvite.gameObject.SetActive(true);
         }
     }
 }
        void changeCaptain()
        {
            int memberCount                      = TeamProxy.getInstance().MyTeamData.itemTeamDataList.Count;
            ItemTeamMemberData  itmd             = TeamProxy.getInstance().MyTeamData;
            List <ItemTeamData> itemTeamDataList = TeamProxy.getInstance().MyTeamData.itemTeamDataList;
            int imoCount = itemMemberObjList.Count;

            for (int i = 0; i < memberCount; i++)
            {
                for (int j = 0; j < itemMemberObjList.Count; j++)
                {
                    if (itemTeamDataList[i].cid == itemMemberObjList[j].cid)
                    {
                        if (itmd.meIsCaptain)
                        {
                            itemMemberObjList[j].ChangeToMeCaptain(itemTeamDataList[i]);
                        }
                        else
                        {
                            itemMemberObjList[j].ChangeToMeCustom();
                        }
                    }
                }
            }
            if (TeamProxy.getInstance().MyTeamData.meIsCaptain)
            {
                for (int i = memberCount; i < imoCount; i++)
                {
                    itemMemberObjList[i].ChangeToMeCaptain(null, itmd);
                }
            }

            if (itmd.meIsCaptain)
            {
                togInvite.gameObject.SetActive(true);
                // togJoin.gameObject.SetActive(true);
                bool isCanInv = TeamProxy.getInstance().MyTeamData.membInv;
                togInvite.GetComponent <Toggle>().isOn = isCanInv;
                bool isCanjoin = TeamProxy.getInstance().MyTeamData.dirJoin;
                // togJoin.GetComponent<Toggle>().isOn = isCanjoin;
            }
            changeCaptainPos();
        }
예제 #21
0
        void onShowNearby(bool b)//是否只显示附近的队伍
        {
            ItemTeamMemberData  itm     = TeamProxy.getInstance().mapItemTeamData;
            List <ItemTeamData> itdList = new List <ItemTeamData>();

            itdList.Clear();
            for (int i = 0; i < itm.itemTeamDataList.Count; i++)
            {
                if (itm.itemTeamDataList[i].mapId != PlayerModel.getInstance().mapid)
                {
                    itdList.Add(itm.itemTeamDataList[i]);
                }
            }
            for (int i = 0; i < itdList.Count; i++)
            {
                if (itemTeamInfoPrefabDic.ContainsKey(itdList[i].teamId))
                {
                    itemTeamInfoPrefabDic[itdList[i].teamId].root.gameObject.SetActive(!b);
                }
            }
        }
예제 #22
0
        void SetMapTeam(Variant data)
        {
            mapItemTeamData = new ItemTeamMemberData();
            List <ItemTeamData> teamListInfoDataList = new List <ItemTeamData>();
            uint totalCount = data["total_cnt"];
            uint idx_begin  = data["idx_begin"];

            mapItemTeamData.totalCount = totalCount;
            mapItemTeamData.idxBegin   = idx_begin;
            List <Variant> info = data["info"]._arr;

            foreach (Variant item in info)
            {
                ItemTeamData tlid = new ItemTeamData();
                tlid.teamId  = item["tid"];
                tlid.curcnt  = item["curcnt"];
                tlid.maxcnt  = item["maxcnt"];
                tlid.name    = item["lname"];
                tlid.carr    = item["lcarr"];
                tlid.lvl     = item["llevel"];
                tlid.zhuan   = item["lzhuan"];
                tlid.mapId   = item["lmapid"];
                tlid.ltpid   = item["ltpid"];
                tlid.ldiff   = item["ldiff"];
                tlid.members = item["members"]._arr;
                if (string.IsNullOrEmpty(item["lclname"]))
                {
                    tlid.knightage = ContMgr.getCont("a3_active_wuxianzhi");
                }
                else
                {
                    tlid.knightage = item["lclname"];
                }
                teamListInfoDataList.Add(tlid);
                //teamPosMapid.Add(tlid);
            }
            mapItemTeamData.itemTeamDataList = teamListInfoDataList;

            dispatchEvent(GameEvent.Create(EVENT_TEAMLISTINFO, this, mapItemTeamData));
        }
예제 #23
0
        private void SetMapTeam(Variant data)
        {
            this.mapItemTeamData = new ItemTeamMemberData();
            List <ItemTeamData> list = new List <ItemTeamData>();
            uint totalCount          = data["total_cnt"];
            uint idxBegin            = data["idx_begin"];

            this.mapItemTeamData.totalCount = totalCount;
            this.mapItemTeamData.idxBegin   = idxBegin;
            List <Variant> arr = data["info"]._arr;

            foreach (Variant current in arr)
            {
                ItemTeamData itemTeamData = new ItemTeamData();
                itemTeamData.teamId  = current["tid"];
                itemTeamData.curcnt  = current["curcnt"];
                itemTeamData.maxcnt  = current["maxcnt"];
                itemTeamData.name    = current["lname"];
                itemTeamData.carr    = current["lcarr"];
                itemTeamData.lvl     = current["llevel"];
                itemTeamData.zhuan   = current["lzhuan"];
                itemTeamData.mapId   = current["lmapid"];
                itemTeamData.ltpid   = current["ltpid"];
                itemTeamData.ldiff   = current["ldiff"];
                itemTeamData.members = current["members"]._arr;
                bool flag = string.IsNullOrEmpty(current["lclname"]);
                if (flag)
                {
                    itemTeamData.knightage = "无";
                }
                else
                {
                    itemTeamData.knightage = current["lclname"];
                }
                list.Add(itemTeamData);
            }
            this.mapItemTeamData.itemTeamDataList = list;
            base.dispatchEvent(GameEvent.Create(TeamProxy.EVENT_TEAMLISTINFO, this, this.mapItemTeamData, false));
        }
예제 #24
0
            public void ChangeToMeCaptain(ItemTeamData itd = null, ItemTeamMemberData itmd = null)
            {
                bool flag = itd != null;

                if (flag)
                {
                    this.cid = itd.cid;
                    bool flag2 = itd.cid != ModelBase <PlayerModel> .getInstance().cid;

                    if (flag2)
                    {
                        this.btnRemoveTeam.gameObject.SetActive(true);
                    }
                }
                else
                {
                    bool flag3 = itmd != null;
                    if (flag3)
                    {
                        this.btnInvite.gameObject.SetActive(true);
                    }
                }
            }
예제 #25
0
        void SetAffirmInvite(Variant data)//10 确认邀请
        {
            ItemTeamMemberData AffirmInviteData = new ItemTeamMemberData();

            if (data.ContainsKey("cofirmed"))
            {
                bool cofirmed = data["cofirmed"]; AffirmInviteData.cofirmed = cofirmed;
            }
            if (data.ContainsKey("tid"))
            {
                uint tid = data["tid"];
                AffirmInviteData.teamId = tid;
                List <ItemTeamData> itdList  = new List <ItemTeamData>();
                List <Variant>      plysList = data["plys"]._arr;
                uint leaderCid = data["leader_cid"];
                bool dirJoin   = data["dir_join"];
                bool membInv   = data["memb_inv"];
                uint ltpid     = data["ltpid"];
                AffirmInviteData.ltpid     = ltpid;
                AffirmInviteData.leaderCid = leaderCid;
                AffirmInviteData.dirJoin   = dirJoin;
                AffirmInviteData.membInv   = membInv;
                if (MyTeamData == null)
                {
                    MyTeamData = new ItemTeamMemberData();
                }

                MyTeamData.teamId    = tid;
                MyTeamData.leaderCid = leaderCid;
                MyTeamData.dirJoin   = dirJoin;
                MyTeamData.membInv   = membInv;
                MyTeamData.ltpid     = ltpid;
                foreach (Variant pl in plysList)
                {
                    uint         cid    = pl["cid"];
                    string       name   = pl["name"];
                    uint         lvl    = pl["lvl"];
                    uint         zhuan  = pl["zhuan"];
                    uint         combpt = pl["combpt"];
                    uint         carr   = pl["carr"];
                    bool         online = pl["online"];
                    ItemTeamData itd    = new ItemTeamData();
                    itd.cid                 = cid;
                    itd.name                = name;
                    itd.lvl                 = lvl;
                    itd.zhuan               = zhuan;
                    itd.combpt              = (int)combpt;
                    itd.carr                = carr;
                    itd.online              = online;
                    itd.isCaptain           = leaderCid == cid ? true : false;
                    itd.showRemoveMemberBtn = false;
                    itdList.Add(itd);
                    MyTeamData.itemTeamDataList.Add(itd);
                    if ((ltpid == 108 || ltpid == 109 || ltpid == 110 || ltpid == 111) && !A3_TeamModel.getInstance().cidName.ContainsKey(cid))
                    {
                        A3_TeamModel.getInstance().cidName.Add(cid, name);
                    }
                    if (!A3_TeamModel.getInstance().cidNameElse.ContainsKey(cid))
                    {
                        A3_TeamModel.getInstance().cidNameElse.Add(cid, name);
                    }
                }
                if (ltpid == 108 || ltpid == 109 || ltpid == 110 || ltpid == 111)//组队副本直接跳到组队页面
                {
                    //ArrayList arr = new ArrayList();
                    //arr.Add(1);
                    //InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_COUNTERPART, arr);
                    //a3_counterpart.instance?.transform.SetAsLastSibling();
                    //a3_counterpart.instance?.getGameObjectByPath("currentTeam").SetActive(true);
                    A3_TeamModel.getInstance().bein   = true;
                    A3_TeamModel.getInstance().ltpids = ltpid;
                }
                //服务器返回的是不包含自己在内的人,需要把自己加进去
                ItemTeamData itdSelf = new ItemTeamData();
                itdSelf.cid                 = PlayerModel.getInstance().cid;
                itdSelf.name                = PlayerModel.getInstance().name;
                itdSelf.lvl                 = PlayerModel.getInstance().lvl;
                itdSelf.zhuan               = PlayerModel.getInstance().up_lvl;
                itdSelf.combpt              = (int)PlayerModel.getInstance().combpt;
                itdSelf.carr                = (uint)PlayerModel.getInstance().profession;
                itdSelf.online              = true;
                itdSelf.isCaptain           = false;
                itdSelf.showRemoveMemberBtn = false;
                itdSelf.ltpid               = data["ltpid"];
                itdList.Add(itdSelf);

                AffirmInviteData.itemTeamDataList = itdList;
                MyTeamData.itemTeamDataList.Add(itdSelf);
                A3_TeamModel.getInstance().AffirmInviteData = AffirmInviteData;
                dispatchEvent(GameEvent.Create(EVENT_AFFIRMINVITE, this, data));
                joinedTeam = true;
                MonsterMgr._inst.RefreshVaildMonster();
            }
        }
예제 #26
0
        private void SetAffirmInvite(Variant data)
        {
            ItemTeamMemberData itemTeamMemberData = new ItemTeamMemberData();
            bool flag = data.ContainsKey("cofirmed");

            if (flag)
            {
                bool cofirmed = data["cofirmed"];
                itemTeamMemberData.cofirmed = cofirmed;
            }
            bool flag2 = data.ContainsKey("tid");

            if (flag2)
            {
                uint teamId = data["tid"];
                itemTeamMemberData.teamId = teamId;
                List <ItemTeamData> list = new List <ItemTeamData>();
                List <Variant>      arr  = data["plys"]._arr;
                uint num     = data["leader_cid"];
                bool dirJoin = data["dir_join"];
                bool membInv = data["memb_inv"];
                uint num2    = data["ltpid"];
                itemTeamMemberData.ltpid     = num2;
                itemTeamMemberData.leaderCid = num;
                itemTeamMemberData.dirJoin   = dirJoin;
                itemTeamMemberData.membInv   = membInv;
                bool flag3 = this.MyTeamData == null;
                if (flag3)
                {
                    this.MyTeamData = new ItemTeamMemberData();
                }
                this.MyTeamData.teamId    = teamId;
                this.MyTeamData.leaderCid = num;
                this.MyTeamData.dirJoin   = dirJoin;
                this.MyTeamData.membInv   = membInv;
                this.MyTeamData.ltpid     = num2;
                foreach (Variant current in arr)
                {
                    uint         num3         = current["cid"];
                    string       text         = current["name"];
                    uint         lvl          = current["lvl"];
                    uint         zhuan        = current["zhuan"];
                    uint         combpt       = current["combpt"];
                    uint         carr         = current["carr"];
                    bool         online       = current["online"];
                    ItemTeamData itemTeamData = new ItemTeamData();
                    itemTeamData.cid                 = num3;
                    itemTeamData.name                = text;
                    itemTeamData.lvl                 = lvl;
                    itemTeamData.zhuan               = zhuan;
                    itemTeamData.combpt              = (int)combpt;
                    itemTeamData.carr                = carr;
                    itemTeamData.online              = online;
                    itemTeamData.isCaptain           = (num == num3);
                    itemTeamData.showRemoveMemberBtn = false;
                    list.Add(itemTeamData);
                    this.MyTeamData.itemTeamDataList.Add(itemTeamData);
                    bool flag4 = (num2 == 108u || num2 == 109u || num2 == 110u || num2 == 111u) && !ModelBase <A3_TeamModel> .getInstance().cidName.ContainsKey(num3);

                    if (flag4)
                    {
                        ModelBase <A3_TeamModel> .getInstance().cidName.Add(num3, text);
                    }
                    bool flag5 = !ModelBase <A3_TeamModel> .getInstance().cidNameElse.ContainsKey(num3);

                    if (flag5)
                    {
                        ModelBase <A3_TeamModel> .getInstance().cidNameElse.Add(num3, text);
                    }
                }
                bool flag6 = num2 == 108u || num2 == 109u || num2 == 110u || num2 == 111u;
                if (flag6)
                {
                    ArrayList arrayList = new ArrayList();
                    arrayList.Add(1);
                    InterfaceMgr.getInstance().open(InterfaceMgr.A3_COUNTERPART, arrayList, false);
                    a3_counterpart expr_33B = a3_counterpart.instance;
                    if (expr_33B != null)
                    {
                        expr_33B.transform.SetAsLastSibling();
                    }
                    a3_counterpart expr_351 = a3_counterpart.instance;
                    if (expr_351 != null)
                    {
                        expr_351.getGameObjectByPath("currentTeam").SetActive(true);
                    }
                    ModelBase <A3_TeamModel> .getInstance().bein = true;

                    ModelBase <A3_TeamModel> .getInstance().ltpids = num2;
                }
                ItemTeamData itemTeamData2 = new ItemTeamData();
                itemTeamData2.cid = ModelBase <PlayerModel> .getInstance().cid;

                itemTeamData2.name = ModelBase <PlayerModel> .getInstance().name;

                itemTeamData2.lvl = ModelBase <PlayerModel> .getInstance().lvl;

                itemTeamData2.zhuan = ModelBase <PlayerModel> .getInstance().up_lvl;

                itemTeamData2.combpt = ModelBase <PlayerModel> .getInstance().combpt;

                itemTeamData2.carr = (uint)ModelBase <PlayerModel> .getInstance().profession;

                itemTeamData2.online              = true;
                itemTeamData2.isCaptain           = false;
                itemTeamData2.showRemoveMemberBtn = false;
                itemTeamData2.ltpid = data["ltpid"];
                list.Add(itemTeamData2);
                itemTeamMemberData.itemTeamDataList = list;
                this.MyTeamData.itemTeamDataList.Add(itemTeamData2);
                ModelBase <A3_TeamModel> .getInstance().AffirmInviteData = itemTeamMemberData;

                base.dispatchEvent(GameEvent.Create(TeamProxy.EVENT_AFFIRMINVITE, this, data, false));
                this.joinedTeam = true;
                MonsterMgr._inst.RefreshVaildMonster();
            }
        }
예제 #27
0
        public static bool RefreshLockSkill(BaseRole LockRole)
        {
            bool flag = LockRole.isDead || LockRole == null;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = LockRole is MonsterRole;
                if (flag2)
                {
                    result = true;
                }
                else
                {
                    bool flag3 = OtherPlayerMgr._inst.m_mapOtherPlayer[LockRole.m_unIID].zhuan < 1;
                    if (flag3)
                    {
                        result = false;
                    }
                    else
                    {
                        switch (ModelBase <PlayerModel> .getInstance().pk_state)
                        {
                        case PK_TYPE.PK_PEACE:
                            result = false;
                            return(result);

                        case PK_TYPE.PK_PKALL:
                            result = true;
                            return(result);

                        case PK_TYPE.PK_TEAM:
                        {
                            bool arg_E3_0;
                            if (LockRole is ProfessionRole)
                            {
                                ItemTeamMemberData expr_C3 = BaseProxy <TeamProxy> .getInstance().MyTeamData;

                                arg_E3_0 = (expr_C3 == null || expr_C3.itemTeamDataList.Exists((ItemTeamData m) => m.cid == LockRole.m_unCID));
                            }
                            else
                            {
                                arg_E3_0 = false;
                            }
                            result = arg_E3_0;
                            return(result);
                        }

                        case PK_TYPE.PK_HERO:
                        {
                            bool flag4 = LockRole.rednm > 0;
                            result = flag4;
                            return(result);
                        }
                        }
                        result = false;
                    }
                }
            }
            return(result);
        }
예제 #28
0
        private void onNoticeHaveMemberLeave(GameEvent e)
        {
            Variant data         = e.data;
            uint    num          = data["cid"];
            int     removedIndex = (int)BaseProxy <TeamProxy> .getInstance().MyTeamData.removedIndex;

            a3_currentTeamPanel.ItemMemberObj itemMemberObj = this.itemMemberObjList[removedIndex];
            this.itemMemberObjList.RemoveAt(removedIndex);
            this.itemMemberObjList.Add(itemMemberObj);
            itemMemberObj.ClearInfo(false);
            for (int i = removedIndex; i < this.itemMemberObjList.Count; i++)
            {
                this.itemMemberObjList[i].root.SetSiblingIndex(i);
            }
            int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count;

            for (int j = removedIndex; j < count; j++)
            {
                ItemTeamData itd = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList[j];

                this.itemMemberObjList[j].SetInfo(itd, BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain);
            }
            for (int k = count; k < this.itemMemberObjList.Count; k++)
            {
                bool flag = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain || BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv;

                if (flag)
                {
                    this.itemMemberObjList[k].ClearInfo(true);
                }
                else
                {
                    this.itemMemberObjList[k].ClearInfo(false);
                }
            }
            bool meIsCaptain = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

            if (meIsCaptain)
            {
                this.togInvite.gameObject.SetActive(true);
                this.togJoin.gameObject.SetActive(true);
                bool flag2 = this.togInvite.isOn != BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv;

                if (flag2)
                {
                    this.togInvite.isOn = BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv;
                }
                bool flag3 = this.togJoin.isOn != BaseProxy <TeamProxy> .getInstance().MyTeamData.dirJoin;

                if (flag3)
                {
                    this.togJoin.isOn = BaseProxy <TeamProxy> .getInstance().MyTeamData.dirJoin;
                }
            }
            else
            {
                this.togInvite.gameObject.SetActive(false);
                this.togJoin.gameObject.SetActive(false);
            }
            this.setTeamBuffTxt();
            ItemTeamMemberData myTeamData = BaseProxy <TeamProxy> .getInstance().MyTeamData;

            this.Show(myTeamData);
        }