public override void onShowed()
        {
            isshow = this;
            FriendProxy.getInstance().addEventListener(FriendProxy.EVENT_LOOKFRIEND, GetInfo);

            uint tid = 0;

            if (uiData != null && uiData.Count > 0)
            {
                tid = (uint)uiData[0];
                if (uiData.Count > 1)
                {
                    RetWin = (string)uiData[1];
                }
            }
            else
            {
                tid = SelfRole._inst.m_LockRole.m_unCID;
            }
            FriendProxy.getInstance().sendgetplayerinfo(tid);
            this.transform.SetAsLastSibling();
            create_scene();
            GRMap.GAME_CAMERA.SetActive(false);
            transform.FindChild("ig_bg_bg").gameObject.SetActive(false);
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FUNCTIONBAR);
        }
        void addfriend()
        {
            uint   cid  = SelfRole._inst.m_LockRole.m_unCID;
            string name = SelfRole._inst.m_LockRole.roleName;

            FriendProxy.getInstance().sendAddFriend(cid, name);
            hide();
        }
Example #3
0
 void onBtnAddFriendClick(GameObject go)
 {
     if (transform.gameObject.activeSelf)
     {
         transform.gameObject.SetActive(false);
     }
     FriendProxy.getInstance().sendAddFriend(cid, playerName);
 }
 public override void onClosed()
 {
     InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL);
     desPKSence();
     desAvatar();
     FriendProxy.getInstance().removeEventListener(FriendProxy.EVENT_LOOKFRIEND, GetInfo);
     // image.transform.DOScale(new Vector3(0, 0, 0), 1);
 }
Example #5
0
 public override void onClosed()
 {
     foreach (KeyValuePair <uint, itemBeRequestFriend> item in beRequestFriendList)
     {
         GameObject.Destroy(beRequestFriendList[item.Key].root.gameObject);
     }
     beRequestFriendList.Clear();
     FriendProxy.getInstance().requestFirendList.Clear();
 }
Example #6
0
        void onBtnAgreenClick(GameObject go)
        {
            Dictionary <uint, itemFriendData> requestFriendList = FriendProxy.getInstance().requestFirendList;

            foreach (KeyValuePair <uint, itemFriendData> item in requestFriendList)
            {
                FriendProxy.getInstance().sendAgreeApplyFriend(item.Key);
            }
            InterfaceMgr.getInstance().close(InterfaceMgr.A3_BEREQUESTFRIEND);
        }
Example #7
0
 void onBtnAgreen(GameObject go)//同意被添加好友
 {
     FriendProxy.getInstance().sendAgreeApplyFriend(cid);
     if (FriendProxy.getInstance().requestFriendListNoAgree.Contains(mName))
     {
         FriendProxy.getInstance().requestFriendListNoAgree.Remove(mName);
     }
     Destroy(a3_beRequestFriend.mInstance.beRequestFriendList[cid].root.gameObject);
     a3_beRequestFriend.mInstance.beRequestFriendList.Remove(cid);
 }
        public override void onClosed()
        {
            isshow = null;
            FriendProxy.getInstance().removeEventListener(FriendProxy.EVENT_LOOKFRIEND, GetInfo);
            disposeAvatar();
            for (int i = 1; i <= 10; i++)
            {
                GameObject go = transform.FindChild("ig_bg1/txt" + i).gameObject;
                go.GetComponent <Text>().enabled = true;
                if (go.transform.childCount > 0)
                {
                    Destroy(go.transform.GetChild(0).gameObject);
                }
            }
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL);
            GRMap.GAME_CAMERA.SetActive(true);


            if (itemFriendPrefab.instance?.watch_avt == true)
            {
                ArrayList arr = new ArrayList();
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_SHEJIAO, arr);
                itemFriendPrefab.instance.watch_avt = false;
            }

            if (itemNearbyListPrefab.instance?.watch_avt == true)
            {
                ArrayList arr = new ArrayList();
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_SHEJIAO, arr);
                itemNearbyListPrefab.instance.watch_avt = false;
            }
            if (RetWin != null)
            {
                if (RetWin.Equals(InterfaceMgr.A3_FB_TEAM))
                {
                    ArrayList arr = new ArrayList();
                    arr.Add(null);
                    arr.Add(false);
                    InterfaceMgr.getInstance().ui_async_open(RetWin, arr);
                }
                else
                {
                    InterfaceMgr.getInstance().ui_async_open(RetWin);
                }
                RetWin = null;
            }

            if (a3_ranking.isshow && a3_ranking.isshow.Toback)
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_RANKING);
            }
        }
Example #9
0
 public void OnClosed()
 {
     root.gameObject.SetActive(false);
     FriendProxy.getInstance().removeEventListener(FriendProxy.EVENT_FRIENDLIST, OnFriendRefresh);
     for (int i = tfFriendContainer.childCount; i > 0; i--)
     {
         GameObject.Destroy(tfFriendContainer.GetChild(i - 1).gameObject);
     }
     for (int i = tfFriendContainer.childCount; i > 0; i--)
     {
         GameObject.Destroy(tfFriendContainer.GetChild(i - 1).gameObject);
     }
 }
Example #10
0
        override public void onShowed()
        {
            Dictionary <uint, itemFriendData> requestFriendList = FriendProxy.getInstance().requestFirendList;

            foreach (KeyValuePair <uint, itemFriendData> item in requestFriendList)
            {
                itemBeRequestFriend ibrf = new itemBeRequestFriend(itemPrefab.transform, requestFriendList[item.Key]);
                ibrf.root.SetParent(contentParent.transform);
                ibrf.root.localScale = Vector3.one;
                beRequestFriendList.Add(requestFriendList[item.Key].cid, ibrf);
            }
            contentParent.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 70 * requestFriendList.Count);
        }
Example #11
0
        public void Init()
        {
            //保存一些游戏对象
            root             = a3_fb_team.Instance.transform.Find("invite_panel");
            prefabFriendInfo = root.transform.Find("itemPrefabs/itemFriend").gameObject;
            prefabNearbyInfo = root.transform.Find("itemPrefabs/itemNearby").gameObject;

            goFriendPanel = root.transform.Find("mainBody/myFriendsPanel").gameObject;
            goNearbyPanel = root.transform.Find("mainBody/neighborPanel").gameObject;

            tfFriendContainer = root.transform.Find("mainBody/myFriendsPanel/right/main/body/scroll/contains");
            tfNearbyContainer = root.transform.Find("mainBody/neighborPanel/right/main/body/scroll/contains");

            toggleFriend = root.transform.Find("mainBody/left/toggleGroup/togFriend").GetComponent <Toggle>();
            toggleNearby = root.transform.Find("mainBody/left/toggleGroup/togNearby").GetComponent <Toggle>();

            btn_refresh         = new BaseButton(root.transform.Find("btn_refresh"));
            btn_refresh.onClick = (go) =>
            {
                if (toggleFriend.isOn)
                {
                    FriendProxy.getInstance().sendfriendlist(FriendProxy.FriendType.FRIEND);
                }
                else
                {
                    RefreshNearby();
                }
            };

            btn_close         = new BaseButton(root.transform.Find("btn_close"));
            btn_close.onClick = (go) => { OnClosed(); };

            toggleFriend.onValueChanged.AddListener((b) =>
            {
                if (b)
                {
                    goFriendPanel.SetActive(true);
                    goNearbyPanel.SetActive(false);
                }
            });
            toggleNearby.onValueChanged.AddListener((b) =>
            {
                if (b)
                {
                    goFriendPanel.SetActive(false);
                    goNearbyPanel.SetActive(true);
                }
            });
        }
Example #12
0
        void OnFriendRefresh(GameEvent e)
        {
            for (int i = tfFriendContainer.childCount; i > 0; i--)
            {
                GameObject.Destroy(tfFriendContainer.GetChild(i - 1).gameObject);
            }
            Variant data = e.data;

            if (data.ContainsKey("buddy"))
            {
                List <Variant> listFriend = data["buddy"]._arr;
                for (int i = 0; i < listFriend.Count; i++)
                {
                    GameObject go     = GameObject.Instantiate(prefabFriendInfo);
                    string     name   = listFriend[i]["name"];
                    string     level  = listFriend[i]["zhuan"] + ContMgr.getCont("zhuan") + listFriend[i]["lvl"] + ContMgr.getCont("ji");
                    string     combat = listFriend[i]["combpt"];
                    uint       cid    = listFriend[i]["cid"]._uint;
                    bool       online = listFriend[i]["online"];
                    go.transform.Find("Toggle/containts/txtName").GetComponent <Text>().text   = name;
                    go.transform.Find("Toggle/containts/txtLevel").GetComponent <Text>().text  = level;
                    go.transform.Find("Toggle/containts/txtcombat").GetComponent <Text>().text = combat;
                    if (online)
                    {
                        uint mapId = (uint)FriendProxy.getInstance().FriendDataList[cid].map_id;
                        go.transform.Find("Toggle/containts/txtpos").GetComponent <Text>().text = SvrMapConfig.instance.getSingleMapConf((uint)mapId)["map_name"]._str;
                    }
                    else
                    {
                        go.transform.Find("Toggle/containts/txtpos").GetComponent <Text>().text = ContMgr.getCont("a3_friend_lx");
                    }
                    go.transform.SetParent(tfFriendContainer, false);
                    new BaseButton(go.transform.Find("btn_invite")).onClick = (_go) =>
                    {
                        TeamProxy.getInstance().SendInvite(cid);
                    };
                }
            }
        }
Example #13
0
 public override void onShowed()
 {
     if (uiData != null)
     {
         FriendProxy.getInstance().sendgetplayerinfo((uint)uiData[0]);
         getComponentByPath <Text>("selfname").text        = PlayerModel.getInstance().name;
         getComponentByPath <Text>("selfname/selflv").text = PlayerModel.getInstance().up_lvl + ContMgr.getCont("zhuan") + PlayerModel.getInstance().lvl + ContMgr.getCont("ji");
         getComponentByPath <Text>("selfzdl").text         = PlayerModel.getInstance().combpt.ToString();
         if ((string)uiData[1] != "")
         {
             matchname = (string)uiData[1];
         }
         // getComponentByPath<Text>("matchname/matchname").text = (string)uiData[1];
         llid = (int)uiData[2];
     }
     _instance = this;
     getGameObjectByPath("ig_bg_bg").SetActive(false);
     InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FUNCTIONBAR);
     showPKSence();
     createAvatar_self();
     FriendProxy.getInstance().addEventListener(FriendProxy.EVENT_LOOKFRIEND, GetInfo);
     //image.transform.DOScale(new Vector3(1, 1, 1), 2);
 }
Example #14
0
 public void OnShowed()
 {
     FriendProxy.getInstance().addEventListener(FriendProxy.EVENT_FRIENDLIST, OnFriendRefresh);
     RefreshNearby();
     FriendProxy.getInstance().sendfriendlist(FriendProxy.FriendType.FRIEND);
 }
        public void refreshViewData1(Variant v)
        {
            int carr = v["carr"];

            if (v.ContainsKey("eqp"))
            {
                m_roleDta.m_BodyID       = 0;
                m_roleDta.m_BodyFXID     = 0;
                m_roleDta.m_EquipColorID = 0;
                m_roleDta.m_Weapon_LID   = 0;
                m_roleDta.m_Weapon_LFXID = 0;
                m_roleDta.m_Weapon_RID   = 0;
                m_roleDta.m_Weapon_RFXID = 0;

                foreach (Variant p in v["eqp"]._arr)
                {
                    a3_ItemData data = a3_BagModel.getInstance().getItemDataById(p["tpid"]);
                    if (data.equip_type == 3)
                    {
                        int bodyid   = (int)data.tpid;
                        int bodyFxid = p["intensify"];
                        m_roleDta.m_BodyID   = bodyid;
                        m_roleDta.m_BodyFXID = bodyFxid;

                        uint colorid = 0;
                        if (p.ContainsKey("colour"))
                        {
                            colorid = p["colour"];
                        }
                        m_roleDta.m_EquipColorID = colorid;
                    }
                    if (data.equip_type == 6)
                    {
                        int weaponid   = (int)data.tpid;
                        int weaponFxid = p["intensify"];
                        switch (carr)
                        {
                        case 2:
                            m_roleDta.m_Weapon_RID   = weaponid;
                            m_roleDta.m_Weapon_RFXID = weaponFxid;
                            break;

                        case 3:
                            m_roleDta.m_Weapon_LID   = weaponid;
                            m_roleDta.m_Weapon_LFXID = weaponFxid;
                            break;

                        case 5:
                            m_roleDta.m_Weapon_LID   = weaponid;
                            m_roleDta.m_Weapon_LFXID = weaponFxid;
                            m_roleDta.m_Weapon_RID   = weaponid;
                            m_roleDta.m_Weapon_RFXID = weaponFxid;
                            break;
                        }
                    }
                }
            }
            if (v.ContainsKey("wing"))
            {
                m_roleDta.m_WindID   = v["wing"];
                m_roleDta.m_WingFXID = v["wing"];
            }
            //军衔SS
            if (v.ContainsKey("ach_title"))
            {
                title_id = v["ach_title"];
                isactive = v["title_display"]._bool;
                PlayerNameUIMgr.getInstance().refreshTitlelv(this, title_id);
            }
            if (v.ContainsKey("lvl"))
            {
                lvl = v["lvl"];
            }

            if (v.ContainsKey("combpt"))
            {
                combpt = v["combpt"];
            }
            if (v.ContainsKey("clname"))
            {
                clanName = v["clname"];
            }
            ArrayList arry = new ArrayList();

            arry.Add(m_unCID);
            arry.Add(combpt);
            if (FriendProxy.getInstance() != null)
            {
                FriendProxy.getInstance().reFreshProfessionInfo(arry);
            }

            // if (OtherPlayerMgr._inst.VIEW_PLAYER_TYPE == 1 || m_isMain)
            //refreshViewType(VIEW_TYPE_ALL);
            //onRefresh_ViewType();


            set_weaponl(m_roleDta.m_Weapon_LID, m_roleDta.m_Weapon_LFXID);
            set_weaponr(m_roleDta.m_Weapon_RID, m_roleDta.m_Weapon_RFXID);
            set_wing(m_roleDta.m_WindID, m_roleDta.m_WingFXID);
            set_body(m_roleDta.m_BodyID, m_roleDta.m_BodyFXID);
        }
Example #16
0
 void onBtnRefuse(GameObject go)//拒绝好友请求
 {
     FriendProxy.getInstance().sendRefuseAddFriend(cid);
     Destroy(a3_beRequestFriend.mInstance.beRequestFriendList[cid].root.gameObject);
     a3_beRequestFriend.mInstance.beRequestFriendList.Remove(cid);
 }
Example #17
0
 void OnRefresh()
 {
     FriendProxy.getInstance().sendfriendlist(FriendProxy.FriendType.FRIEND);
 }
Example #18
0
        void getPublish(Variant data)
        {
            if (data.ContainsKey("tp") && data["tp"] != 10)
            {
                UnityEngine.Debug.Log("聊天所有信息" + data.dump());
            }
            if (data.ContainsKey("cid"))
            {
                uint cid = data["cid"]._uint;
                if (FriendProxy.getInstance().BlackDataList.ContainsKey(cid))
                {
                    return;
                }
            }
            if (data.ContainsKey("res"))
            {
                int res = data["res"];
                if (res < 0)//-158
                {
                    Globle.err_output(res);
                    return;
                }
                if (res == 1)//私聊玩家存在情况下
                {
                    a3_chatroom._instance.meSays(false);
                }
            }
            else
            {
                switch ((ChatToType)data["tp"]._int)
                {
                case ChatToType.Nearby:
                    if (!data.ContainsKey("url"))
                    {
                        uint   cid = data["cid"]._uint;
                        string msg = data["msg"]._str;
                        foreach (KeyValuePair <uint, ProfessionRole> item in OtherPlayerMgr._inst.m_mapOtherPlayerSee)
                        {
                            if (item.Value.m_unCID == cid)
                            {
                                PlayerChatUIMgr.getInstance().show(item.Value, analysisStrName(msg));
                            }
                        }
                    }

                    break;

                case ChatToType.PrivateSecretlanguage:
                    if (GlobleSetting.IGNORE_PRIVATE_INFO)
                    {
                        return;                                       //客户端开启屏蔽私聊信息
                    }
                    break;
                }
                // UIClient.instance.dispatchEvent(GameEvent.Create(UI_EVENT.GET_PUBLISH, this, data));

                if (data["tp"] == 10)
                {//系统消息特殊处理,走马灯的同时,聊天框也要显示
                    if (broadcasting.instance != null)
                    {
                        broadcasting.instance.addGonggaoMsg(data["msg"]);
                    }

                    data["tp"] = (int)ChatToType.SystemMsg;
                    if (a3_chatroom._instance != null)
                    {
                        a3_chatroom._instance.otherSays(data);
                    }
                }
                else if (data["tp"] == 11)
                {
                    data["tp"] = (int)ChatToType.LegionSystemMsg;
                    if (data.ContainsKey("guard_time"))
                    {
                        if (A3_LegionModel.getInstance().myLegion.lvl > 1)
                        {
                            data["msg"] = ContMgr.getCont(("clan_log_12"), new List <string>()
                            {
                                (3 - data["guard_time"]).ToString(), (A3_LegionModel.getInstance().myLegion.lvl - 1).ToString()
                            });
                        }
                        else
                        {
                            data["msg"] = ContMgr.getCont(("clan_log_11"), new List <string>()
                            {
                                (3 - data["guard_time"]).ToString()
                            });
                        }

                        if (a3_chatroom._instance != null)
                        {
                            a3_chatroom._instance.otherSays(data);
                        }
                    }
                }
                else if (data["tp"] == 12)
                {
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_CITYWARTIP);
                }
                else
                {
                    if (a3_chatroom._instance != null)
                    {
                        List <Variant> lp = null;
                        if (data.ContainsKey("xtp"))
                        {
                            int xtp = data["xtp"]._int;
                            switch (xtp)
                            {
                            case 1:
                                data = AnalysisData(data, out lp, xtp);
                                if (lp.Count == 6 &&
                                    lp[5].ContainsKey("tid") &&
                                    TeamProxy.getInstance()?.MyTeamData != null &&
                                    lp[5]["tid"] == TeamProxy.getInstance().MyTeamData.teamId&&
                                    PlayerModel.getInstance().IsCaptain)     //反馈仅对队长可见
                                {
                                    flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_in_fb2"));
                                }
                                break;

                            default: break;
                            }
                        }
                        a3_chatroom._instance.otherSays(data, lp);
                    }
                }
            }
        }