示例#1
0
    /// <summary>
    /// 英雄升星              4010
    /// </summary>
    /// <param name="packet"></param>
    /// <returns></returns>
    public bool UpgradeHeroStarResultHandle(CReadPacket packet)
    {
        Debug.Log("Upgrade Hero Star result");

        Dictionary <string, object> data = packet.data;

        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            int star = HeroAndEquipNodeData.HD.star;

            HeroAndEquipNodeData.HD.star = star + 1;
            playerData.GetInstance().selectHeroDetail.star = HeroAndEquipNodeData.HD.star;
            //HeroAndEquipNodeData.HD.SetNodeByIdAndGrade(HeroAndEquipNodeData.HD.id, HeroAndEquipNodeData.HD.star);
            //HeroData myHd = playerData.GetInstance().selectHeroDetail;
            //HeroData nextGradeHd = new HeroData(myHd.id, myHd.lvl, myHd.grade + 1, myHd.star);
            //nextGradeHd.equipSite = myHd.equipSite;
            HeroAndEquipNodeData.HD.RefreshAttr();

            //Control.ShowGUI(GameLibrary.UI_HeroDetail);
            //if (Singleton<SceneManage>.Instance.Current == EnumSceneID.UI_MajorCity01)
            //{
            //    UITooltips.Instance.SetBlackerBottom_Text("英雄升星成功");
            //    Breakthrough.instance.PlayerShengXingEffect(HeroAndEquipNodeData.HD.star-1, HeroAndEquipNodeData.HD.star);//英雄升星成功播放晋级特效
            //}
        }
        else
        {
            Debug.Log(string.Format("英雄升星错误:{0}", data["desc"].ToString()));
        }

        return(true);
    }
示例#2
0
    bool GetHerosAttrResultHandle(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            Dictionary <string, object> heroDicts = (Dictionary <string, object>)data["mh"];
            foreach (string k in heroDicts.Keys)
            {
                Dictionary <string, object> heroDict = (Dictionary <string, object>)heroDicts[k];
                long     heroId   = long.Parse(heroDict["id"].ToString());
                object[] attrs    = (object[])heroDict["attr"];
                HeroData heroData = playerData.GetInstance().GetHeroDataByID(heroId);
                for (int j = 0; j < attrs.Length; j++)
                {
                    Formula.SetAttrTo(ref heroData.serverAttrs, (AttrType)j, float.Parse(attrs[j].ToString()));
                }
            }
            if (data.ContainsKey("rk"))
            {
                playerData.GetInstance().selfData.rank = Convert.ToInt32(data["rk"]);
            }
            return(true);
        }
        return(false);
    }
示例#3
0
    private bool GetCommonBuySomeoneResultHandle(CReadPacket packet)
    {
        Debug.Log("Get common buy someone result");

        Dictionary <string, object> data = packet.data;

        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            //if (null != UISceneEntry.instance && UISceneEntry.instance.gameObject.activeSelf)
            //{
            //    UISceneEntry.instance.BuySweepVoucher();
            //}
            //Debug.Log("非商店购买某物品成功");
        }
        else
        {
            Debug.Log(string.Format("非商店购买某物品错误:{0}", data["desc"].ToString()));
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
        }

        return(true);
    }
示例#4
0
    /// <summary>
    /// 解析网络数据
    /// </summary>
    /// <param name="buffer"></param>
    public void OnUdpMessage(CReadPacket buffer)
    {
        if (buffer == null)
        {
            return;
        }
        uint protocol = buffer.GetMessageID();
        Dictionary <string, object> data = buffer.data;

        switch (protocol)
        {
        case NetProtocol.SYNC_KEY:
            GameData.m_GameManager.SyncKey(data);
            GameData.m_GameManager.UpdateUdpGame();
            break;

        case NetProtocol.START:
            GameData.m_IsGame = true;
            GameData.m_GameManager.m_UIManager.m_UpdateBattleUICallback();
            object[] playerObj = data["info"] as object[];
            GameData.m_GameManager.CreateAllPlayer(playerObj);
            break;

        default:
            break;
        }
    }
示例#5
0
    public bool UseItemResult(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            if (data.ContainsKey("expsPool"))
            {
                UIExpPropPanel.instance.beforeExpCount = playerData.GetInstance().selfData.expPool;
                playerData.GetInstance().selfData.expPool = long.Parse(data["expsPool"].ToString());; //经验池经验值
                if (playerData.GetInstance().selfData.expPool < 0)
                {
                    playerData.GetInstance().selfData.expPool = 0;
                }
                //英雄培养使用经验药水
                //if (Control.GetGUI(GameLibrary.UIExpPropPanel).gameObject.activeSelf)
                //{
                //    UIExpPropPanel.instance.RefreshData();
                //}
            }
        }
        else
        {
            Debug.Log(string.Format("使用物品失败:{0}", data["desc"].ToString()));
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
        }
        return(true);
    }
示例#6
0
    private bool FixedInfo(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;
        int pos    = packet.GetInt("sPos");
        int endpos = packet.GetInt("ePos");

        int[] info = data["info"] as int[];
        if (info != null)
        {
            for (int i = 0; i < info.Length; i++)
            {
                playerData.GetInstance().selfData.infodata[pos + i] = uint.Parse(info[i].ToString());
            }
        }
        else
        {
            System.Object[] infoarr = data["info"] as System.Object[];
            for (int i = 0; i < infoarr.Length; i++)
            {
                playerData.GetInstance().selfData.infodata[pos + i] = uint.Parse(infoarr[i].ToString());
            }
            // GuideManager.Single().InitData();
        }



        return(true);
    }
示例#7
0
    private bool SendChatInfoResult(CReadPacket packet)
    {
        Debug.Log("SendChatInfoResult");
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            Debug.Log("发送聊天成功");
        }
        else
        {
            Debug.Log(string.Format("发送聊天失败:{0}", data["desc"].ToString()));
            if (SocietyManager.Single().selfChatData != null && Globe.selectChatChannel == ChatType.PrivateChat)
            {
                playerData.GetInstance().AddChatInfoToList(SocietyManager.Single().selfChatData);
                //SocietyManager.Single().selfChatData = null;
            }
            //playerData.GetInstance().AddChatInfo(ChatContentType.PrivateTargetNotOnLine,"");
            //UIChatPanel.Instance.AddChatInfo(ChatContentType.PrivateTargetNotOnLine);
            //Control.ShowGUI(GameLibrary.UIPromptBox);
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
        }
        return(true);
    }
示例#8
0
    private bool CreateGoodsHandle(CReadPacket packet)
    {
        GameLibrary.Instance().PackedCount++;

        if (GameLibrary.Instance().PackedCount > 1)
        {
            return(false);
        }
        Debug.Log("<color=#FFc937>CreateGoodsHandle抽奖数据</color>");
        //bug.Log(" <color=#FF4040>Lottery ResultGood</color>");
        Dictionary <string, object> data = packet.data;


        int result = int.Parse(data["ret"].ToString());

        if (result == 0)
        {
            Singleton <LotteryResultManager> .Instance.LotteryHandler(data);
        }
        else
        {
            Debug.Log(string.Format("获取商店物品列表失败:{0}", data["desc"].ToString()));
            return(false);
        }
        return(true);
    }
示例#9
0
    public bool UseMountOrPetResult(CReadPacket packet)
    {
        Debug.Log("使用宠物或坐骑结果");
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());
        int types  = int.Parse(data["types"].ToString());

        if (resolt == 0)
        {
            if (types == 1)
            {
                MountAndPetNodeData.Instance().currentPetID = long.Parse(data["petId"].ToString());
                //UIMountAndPet.Instance.ShowPet();//刷新宠物
                CharacterManager.playerCS.HidePet();
            }
            else if (types == 2)
            {
                MountAndPetNodeData.Instance().currentMountID = long.Parse(data["petId"].ToString());
                //UIMountAndPet.Instance.ShowMount();//刷新坐骑
                if (CharacterManager.playerCS.pm.isRiding)//如果玩家正骑着坐骑,然后更换了坐骑,需要让玩家下坐骑(因为坐骑已经改变了)
                {
                    CharacterManager.playerCS.pm.Ride(false);
                }
            }
        }
        else
        {
            Debug.Log(string.Format("使用宠物或坐骑失败:{0}", data["desc"].ToString()));
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
        }
        return(true);
    }
示例#10
0
 private bool ErrorMessage(CReadPacket packet)
 {
     //if (UIPromptBox.Instance != null) {
     //	UIPromptBox.Instance.ShowLabel ("慢点!请慢点!");
     //}
     return(true);
 }
示例#11
0
    /// <summary>
    /// 服务器推送:新邮箱通知个数
    /// </summary>
    /// <param name="packet"></param>
    /// <returns></returns>
    private bool HaveNewMailResulet(CReadPacket packet)
    {
        Debug.Log("HaveNewMailResule");
        Dictionary <string, object> data = packet.data;
        int  count     = int.Parse(data["count"].ToString());
        long newMailID = long.Parse(data["mailId"].ToString());
        Dictionary <string, object> newpacket = new Dictionary <string, object>();

        newpacket.Add("arg1", newMailID);
        Singleton <Notification> .Instance.Send(MessageID.common_read_mail_req, newpacket, C2SMessageType.ActiveWait);

        //ClientSendDataMgr.GetSingle().GetMailSend().SendGetSingleMailInfo(newMailID,C2SMessageType.Active);
        //更新主界面邮箱格式提示  这个放到获取单个邮件信息成功后在更改,防止推送成功了,但是获取信息失败的bug
        //if (SceneManager.GetActiveScene().name == "UI_MajorCity" && Control.GetGUI(GameLibrary.UIMailPanel).gameObject.activeSelf)
        //{
        //    GameLibrary.isActiveSendPackahe = true;
        //    ClientSendDataMgr.GetSingle().GetMailSend().SendGetSingleMailInfo(newMailID);
        //    //更新主界面邮箱格式提示  这个放到获取单个邮件信息成功后在更改,防止推送成功了,但是获取信息失败的bug
        //    GameLibrary.isActiveSendPackahe = false;
        //}
        //else if(SceneManager.GetActiveScene().name == "UI_MajorCity")
        //{
        //    playerData.GetInstance().mailData.unReadMailCount = count;
        //    playerData.GetInstance().NewMailHandler(playerData.GetInstance().mailData.unReadMailCount);
        //}
        return(true);
    }
示例#12
0
    /// <summary>
    /// 获取符文列表          4026
    /// </summary>
    /// <param name="packet"></param>
    /// <returns></returns>
    public bool GetRunesListResultHandle(CReadPacket packet)
    {
        //Debug.Log("Get Runes List result");

        //Dictionary<string, object> data = packet.data;

        //int resolt = int.Parse(data["ret"].ToString());

        //if (resolt == 0)
        //{

        //    object[] item = data["item"] as object[];

        //    if (null != item)
        //    {

        //        for (int i = 0; i < item.Length; i++)
        //        {
        //            long id = long.Parse((item[i] as Dictionary<string, object>)["id"].ToString());
        //            int count = int.Parse((item[i] as Dictionary<string, object>)["at"].ToString());
        //        }

        //    }

        //}
        //else
        //{
        //    Debug.Log(string.Format("获取符文列表错误:{0}", data["desc"].ToString()));
        //}

        return(true);
    }
示例#13
0
    /// <summary>
    /// 英雄进阶              4018
    /// </summary>
    /// <param name="packet"></param>
    /// <returns></returns>
    public bool GetHeroAdvancedResultHandle(CReadPacket packet)
    {
        Debug.Log("Get Hero Advanced result");

        Dictionary <string, object> data = packet.data;

        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            //更改英雄grade+1
            HeroAndEquipNodeData.HD.grade = HeroAndEquipNodeData.HD.grade + 1;
            HeroAndEquipNodeData.HD.RefreshAttr();
            //EquipPanel.instance.OnAdvancedSuccess();
            //UITooltips.Instance.SetBlackerBottom_Text("英雄进阶成功");
            //EquipPanel.instance.PlayjinjieEffect();
            return(true);
        }
        else
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
            Debug.Log(string.Format("英雄进阶错误:{0}", data["desc"].ToString()));
            return(false);
        }
    }
示例#14
0
    /// <summary>
    /// 英雄装备材料合成      4016
    /// </summary>
    /// <param name="packet"></param>
    /// <returns></returns>
    public bool GetHeroEComResultHandle(CReadPacket packet)
    {
        Debug.Log("Get Hero Equip Com result");

        Dictionary <string, object> data = packet.data;

        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            if (EquipDevelop.GetSingolton() != null && EquipDevelop.GetSingolton().equipIntensifyDlg.equipCompoundPanel.gameObject.activeSelf)
            {
                EquipDevelop.GetSingolton().equipIntensifyDlg.equipCompoundPanel.InitData(EquipDevelop.GetSingolton().equipIntensifyDlg.equipCompoundPanel.selectMaterial);
            }
            //刷新背包数据
            //if (null != EquipInfoPanel.instance)
            //{
            //    EquipInfoPanel.instance.HeroEComHandler();
            //}
            //EquipCompoundPanel.instance.OpenMaterialCompountEff();//播放合成特效
        }
        else
        {
            Debug.Log(string.Format("装备合成错误:{0}", data["desc"].ToString()));
        }

        return(true);
    }
示例#15
0
    // {msgid=4652,ret=返回值,desc=返回描述,mh={},dh={}}
    // mh 我方出战英雄战斗属性 dh 对方出战英雄属性
    private bool GetMobaMatch(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;
        int ret  = int.Parse(data["ret"].ToString());
        int type = int.Parse(data["types"].ToString());

        if (ret == 0)
        {
            if (type == 1)
            {
                Globe.mobaMyTeam    = HeroData.GetHeroDatasFromDict((Dictionary <string, object>)data["mh1"], 4);
                Globe.mobaEnemyTeam = HeroData.GetHeroDatasFromDict((Dictionary <string, object>)data["dh1"], 4);
            }
            else if (type == 2)
            {
                Globe.moba3v3MyTeam1 = HeroData.GetHeroDatasFromDict((Dictionary <string, object>)data["mh1"], 4);
                // 匹配数据改为读配置表
                // Globe.moba3v3MyTeam2 = HeroData.GetHeroDatasFromDict((Dictionary<string, object>)data["mh2"], 4);
                // Globe.moba3v3MyTeam3 = HeroData.GetHeroDatasFromDict((Dictionary<string, object>)data["mh3"], 4);
                // Globe.moba3v3EnemyTeam1 = HeroData.GetHeroDatasFromDict((Dictionary<string, object>)data["dh1"], 4);
                // Globe.moba3v3EnemyTeam2 = HeroData.GetHeroDatasFromDict((Dictionary<string, object>)data["dh2"], 4);
                // Globe.moba3v3EnemyTeam3 = HeroData.GetHeroDatasFromDict((Dictionary<string, object>)data["dh3"], 4);
            }
            //if (UIEmbattle.instance!=null)
            //{
            //    UIEmbattle.instance.MobaMatchedAndSwitch(UIEmbattle.sourceType);
            //}
        }
        else
        {
            Debug.Log(string.Format("获取世界列表错误:{0}", data["desc"].ToString()));
        }

        return(true);
    }
示例#16
0
 public bool ServerLoadFinish(CReadPacket packet)
 {
     // CallLoad();
     GameLibrary.serverInit = true;
     //playerData.GetInstance().guideData.uId = 0;
     return(true);
 }
示例#17
0
    // {msgid=4658,ret=返回值,desc=返回描述,item={"1"={id=x,at=x,cs=x},"2"={id=x,at=x,cs=x}..}}
    // item 抽奖信息 共5个
    private bool GetMobaResult(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;
        int ret = int.Parse(data["ret"].ToString());

        if (ret == 0)
        {
            if (SceneUIManager.instance == null || SceneUIManager.instance.FlopCardPanel == null)
            {
                return(false);
            }
            Control.HideGUI(UIPanleID.UITheBattlePanel);
            Dictionary <string, object> dict = (Dictionary <string, object>)data["item"];
            if (dict != null && dict.Count > 0)
            {
                SceneUIManager.instance.FlopCardPanel.Show(dict, data["arenaCoin"].ToString());
            }
            // Time.timeScale = 0;
            return(true);
        }
        else
        {
            Debug.Log(string.Format("进入副本请求错误:{0}", data["desc"].ToString()));
            return(false);
        }
    }
示例#18
0
    public bool PingBackHandle(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;

        uint ct_h = uint.Parse(data["ch"].ToString());
        uint ct_l = uint.Parse(data["cl"].ToString());
        uint st_h = uint.Parse(data["sh"].ToString());
        uint st_l = uint.Parse(data["sl"].ToString());

        {
            System.UInt64 tempNum = ((System.UInt64)(st_h) << 32 | (System.UInt64)(st_l));
            Debug.Log(tempNum);
            if (!ClientSendDataMgr.GetSingle().GetWalkSend().ping)
            {
                ClientSendDataMgr.GetSingle().GetWalkSend().ping = true;
                ClientSendDataMgr.GetSingle().GetWalkSend().Ping();
            }

            // DateTime tempT = new DateTime( 1970 , 1 , 1 , 0 , 0 , 0 );
            // long tempL = long.Parse( tempNum.ToString() );
            // DateTime tempDT1 = tempT.AddMilliseconds( tempL );
            //DateTime tempDT = tempDT1.ToLocalTime();
            //int a1 = tempDT.Year;
            //int a2 = tempDT.Month;
            //int a3 = tempDT.Day;
            //int a4 = tempDT.Hour;
            //int a5 = tempDT.Minute;
            //int a6 = tempDT.Second;
            //int a7 = tempDT.Millisecond;
        }
        return(true);
    }
示例#19
0
    /// <summary>
    /// 玩家升级
    /// </summary>
    public bool RoleUpdateHandle(CReadPacket packet)
    {
        //Control.ShowGUI(GameLibrary.Upgrade);///升级面板
        Dictionary <string, object> data = packet.data;

        Globe.isUpgrade = true;
        playerData.GetInstance().beforePlayerLevel = playerData.GetInstance().selfData.level; //记录一下之前的等级
        playerData.GetInstance().beforeStrength = playerData.GetInstance().baginfo.strength;  //记录一下之前的体力
        playerData.GetInstance().selfData.level = int.Parse(data["values"].ToString());
        playerData.GetInstance().baginfo.strength = int.Parse(data["thew"].ToString());
        if (Singleton <SceneManage> .Instance.Current == EnumSceneID.UI_MajorCity01 && !Globe.isSaoDang)
        {
            //如果是在主城 经验来源是日常 和 主线 这两个都要弹出任务奖励,关闭任务奖励 在弹出升级面板
            Globe.isMainCityUpgrade = true;
        }
        else if (Singleton <SceneManage> .Instance.Current == EnumSceneID.Dungeons)
        {
            //如果是在副本 结算完之后再弹出升级面板
            //Control.ShowGUI(GameLibrary.Upgrade);
            //playerData.GetInstance().beforePlayerLevel = playerData.GetInstance().selfData.level;//记录一下之前的等级
            //playerData.GetInstance().selfData.level = int.Parse(data["values"].ToString());
            Globe.isDungeonsUpgrade = true;
        }
        else if (Singleton <SceneManage> .Instance.Current == EnumSceneID.UI_MajorCity01 && Globe.isSaoDang)
        {
            //如果是在主城 经济来源是扫荡 就直接弹出升级面板
            //playerData.GetInstance().beforePlayerLevel = playerData.GetInstance().selfData.level;//记录一下之前的等级
            //playerData.GetInstance().selfData.level = int.Parse(data["values"].ToString());
            Control.ShowGUI(UIPanleID.Upgrade, EnumOpenUIType.DefaultUIOrSecond);
            Globe.isSaoDang = false;
        }
        return(true);
    }
示例#20
0
    public bool CreateRoleResultHandle(CReadPacket packet)
    {
        Debug.Log("Login result");
        int resolt = packet.GetInt("ret");

        if (resolt == 0)
        {
            if (GameLibrary.Instance().isReconect)//如果断线重连状态不用接去数据
            {
                return(true);
            }
            playerData.GetInstance().selfData.changeCount = 0;
            HandleLoginPacketData(packet);
            //UICreateRole.instance.DestoryObj();
            if (Globe.isFightGuide)
            {
                SceneNewbieGuide.instance.CreateNameOver();
            }
        }
        else
        {
            HandleLoginFailed(packet);
        }
        return(true);
    }
示例#21
0
    /// <summary>
    /// 引导打开相应UI
    /// </summary>
    /// <param name="packet"></param>
    /// <returns></returns>
    private bool OpenUI(CReadPacket packet)
    {
        //Debug.Log("OpenUi");
        //Dictionary<string, object> data = packet.data;
        //byte ad = packet.ReadByte("ad");//窗口操作类型,0关闭,1打开
        //byte ui = packet.ReadByte("ui");//面板id


        //if (ad == 1)
        //{

        //    if (UIGuidePanel.Single() != null && UIGuidePanel.Single().NextGuidePanel != null)
        //    {
        //        UIGuidePanel.Single().NextGuidePanel.SetActive(true);
        //    NextGuidePanel.Single().GuideModel.transform.localPosition = new Vector3(-422, -332, 0);
        //    NextGuidePanel.Single().GuideModel.transform.localRotation = Quaternion.Euler(0, 180, 0);
        //    NextGuidePanel.Single().GuideDialogWin.transform.localPosition = new Vector3(-62, 128, 0);
        //    }

        //}
        //else
        //{


        //}
        //--"td" = typeId;
        //--"sp"= stepId;
        //--wd =widgetId


        return(true);
    }
示例#22
0
    private bool ShowHotHandle(CReadPacket packet)
    {
        Debug.Log("<color=#FFc937>Lottery HotResult抽奖每日热点</color>");
        Dictionary <string, object> data = packet.data;

        int result = int.Parse(data["ret"].ToString());

        if (result == 0)
        {
            if (data.ContainsKey("item"))
            {
                if (null != data["item"])
                {
                    int[] goodList = data["item"] as int[];
                    playerData.GetInstance().lotteryInfo.diamondDrawCounnt = int.Parse(data["dd"].ToString());
                    playerData.GetInstance().lotteryInfo.goldDrawCount = int.Parse(data["gd"].ToString());
                    playerData.GetInstance().lotteryInfo.diamondTime = long.Parse(data["ddt"].ToString());
                    playerData.GetInstance().lotteryInfo.goldTime = long.Parse(data["gdt"].ToString());
                    for (int i = 0; i < goodList.Length; i++)
                    {
                        ItemData itemInfo = new ItemData();
                        itemInfo.Id = int.Parse(goodList[i].ToString());
                        ItemNodeState vo = GameLibrary.Instance().ItemStateList[itemInfo.Id];
                        itemInfo.Name     = vo.name;
                        itemInfo.Describe = vo.describe;
                        itemInfo.IconName = vo.icon_name;
                        switch (vo.grade)
                        {
                        case 1:
                            itemInfo.GradeTYPE = GradeType.Gray;
                            break;

                        case 2:
                            itemInfo.GradeTYPE = GradeType.Green;
                            break;

                        case 4:
                            itemInfo.GradeTYPE = GradeType.Blue;
                            break;

                        case 7:
                            itemInfo.GradeTYPE = GradeType.Purple;
                            break;

                        case 11:
                            itemInfo.GradeTYPE = GradeType.Orange;
                            break;

                        case 16:
                            itemInfo.GradeTYPE = GradeType.Red;
                            break;
                        }
                        playerData.GetInstance().lotteryInfo.hotList.Add(itemInfo);
                    }
                    //Control.ShowGUI(GameLibrary.UI_Lottery);
                }
            }
        }
        return(true);
    }
示例#23
0
    public bool SellItemResult(CReadPacket packet)
    {
        Debug.Log("SellItemResult");
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            playerData.GetInstance().baginfo.gold = UInt32.Parse(data["gold"].ToString());
            playerData.GetInstance().RoleMoneyHadler(MoneyType.Gold, playerData.GetInstance().baginfo.gold);
            //if (Globe.isSaleSingleGood)
            //{
            //    GoodsDataOperation.GetInstance().RefreshGood();
            //    UISalePanel.instance.RefreshGood();
            //}
            //else
            //{
            //    GoodsDataOperation.GetInstance().RefreshGoldProp();
            //}
        }
        else
        {
            Debug.Log(string.Format("出售物品失败:{0}", data["desc"].ToString()));
            //Control.ShowGUI(GameLibrary.UIPromptBox);
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
        }
        return(true);
    }
示例#24
0
 /// <summary>
 /// 开始监听回调
 /// </summary>
 /// <param name="result"></param>
 private void ReceiveCallback(IAsyncResult result)
 {
     if (m_Client == null || !result.IsCompleted)
     {
         return;
     }
     try
     {
         byte[] data = m_Client.EndReceive(result, ref m_RemoteEP);
         if (data == null || data.Length < 1)
         {
             return;
         }
         CReadPacket readPacket = new CReadPacket(data, data.Length);
         readPacket.ReadData();
         m_ReceivePacketList.Add(readPacket);
     }
     catch (Exception ex)
     {
         string parameter = "";
         GameData.m_GameManager.LogMsgError("AsyncUdpClient", "ReceiveCallback", parameter, ex.Message);
     }
     finally
     {
         m_Client.BeginReceive(ReceiveCallback, null);
     }
 }
示例#25
0
    private bool PvPReq(CReadPacket packet)
    {
        // Debug.Log("OpenUi");
        Dictionary <string, object> data = packet.data;

        return(true);
    }
示例#26
0
    public bool ExitSocietyResult(CReadPacket packet)
    {
        Debug.Log("退出工会结果");
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "退出公会成功");
            //if (SceneManager.GetActiveScene().name == GameLibrary.UI_Major)
            //{
            //    if (Control.GetGUI(GameLibrary.UIHaveJoinSocietyPanel).gameObject.activeSelf)
            //    {
            //        Control.HideGUI(GameLibrary.UIHaveJoinSocietyPanel);
            //    }
            //}
            return(true);
        }
        else
        {
            Debug.Log(string.Format("退出工会失败:{0}", data["desc"].ToString()));
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
            return(false);
        }
    }
示例#27
0
    private bool GetStartFightResultHandle(CReadPacket packet)
    {
        // Debug.Log("Get Start Fight result");

        Dictionary <string, object> data = packet.data;

        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            long st = long.Parse(data["st"].ToString());
            long et = long.Parse(data["et"].ToString());

            GameLibrary.starTime = st;
            GameLibrary.endTime  = et;
            //if (SceneBaseManager.instance != null)
            //    SceneBaseManager.instance.RunTime();
        }
        else
        {
            Debug.Log(string.Format("开始副本战斗错误:{0}", data["desc"].ToString()));
        }

        return(true);
    }
示例#28
0
    public bool KickoutSocietyMemberResult(CReadPacket packet)
    {
        Debug.Log("踢出公会成员结果");
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "踢出成功");
            //再去获取一下公会成员列表
            Dictionary <string, object> newpacket1 = new Dictionary <string, object>();
            newpacket1.Add("arg1", SocietyManager.Single().mySocityID);
            Singleton <Notification> .Instance.Send(MessageID.union_query_all_member_req, newpacket1, C2SMessageType.ActiveWait);

            return(true);
            //ClientSendDataMgr.GetSingle().GetSocietySend().SendGetSocietyMemberList(C2SMessageType.ActiveWait, SocietyManager.Single().mySocityID);
        }
        else
        {
            Debug.Log(string.Format("踢出公会成员失败:{0}", data["desc"].ToString()));
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
            return(false);
        }
    }
示例#29
0
    public bool BuyActionPointResult(CReadPacket packet)
    {
        //  Debug.Log("BuyActionPointResult");
        Dictionary <string, object> data = packet.data;
        int resolt = int.Parse(data["ret"].ToString());

        if (resolt == 0)
        {
            int actionPointType = int.Parse(data["types"].ToString());
            if (actionPointType == 1)
            {
                playerData.GetInstance().ActionPointHandler(ActionPointType.Energy, int.Parse(data["thew"].ToString()));
                playerData.GetInstance().actionData.energyBuyTimes++;
                playerData.GetInstance().actionData.energyBuyTimes = int.Parse(data["bat"].ToString());
                playerData.GetInstance().actionData.maxEnergyBuyTimes = int.Parse(data["max"].ToString());
            }
            else if (actionPointType == 2)
            {
                playerData.GetInstance().ActionPointHandler(ActionPointType.Vitality, int.Parse(data["vigour"].ToString()));
                playerData.GetInstance().actionData.vitalityBuyTimes++;
            }
        }
        else
        {
            // Debug.Log(string.Format("购买体力失败:{0}", data["desc"].ToString()));
            //Control.ShowGUI(GameLibrary.UIPromptBox);
            //UIPromptBox.Instance.ShowLabel(data["desc"].ToString());
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
        }
        return(true);
    }
示例#30
0
 public bool ServerOnQuit(CReadPacket packet)
 {
     ClientSendDataMgr.GetSingle().GetHeroSend().SendQuitGame();
     //UIPromptBox.Instance.ShowLabel("服务器维护中!请重新登录");
     //Control.ShowGUI(GameLibrary.UIPromptBox);
     Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, "服务器维护中!请重新登录");
     return(true);
 }