少年修仙传客户端代码仓库
client_linchunjie
2018-09-27 292b3480f061c40018464d0c6eb0fe3d4e788404
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已添加
7个文件已修改
310 ■■■■■ 已修改文件
System/ClientVersion/VersionUtility.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzEquip.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzPackWin.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/CommonItemBaisc.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/UpgradeWin.cs 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/UpgradeWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Strengthening/GodBeastAttributes.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Strengthening/GodBeastChildNodes.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Strengthening/GodBeastModel.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ClientVersion/VersionUtility.cs
@@ -26,7 +26,7 @@
    }
    public VersionInfo versionInfo { get; private set; }
    public MaoErVersion maoerVersion;
    public JsonData maoerVersion;
    public bool completed { get { return step == Step.Completed; } }
    Step m_Step = Step.None;
@@ -146,7 +146,14 @@
    {
        if (IsMaoErGame())
        {
            return maoerVersion.url;
            if (maoerVersion.Keys.Contains("url"))
            {
                return maoerVersion["url"].ToString();
            }
            else
            {
                return string.Empty;
            }
        }
        else
        {
@@ -159,13 +166,13 @@
    {
        if (IsMaoErGame())
        {
            if (string.IsNullOrEmpty(maoerVersion.content))
            if (maoerVersion.Keys.Contains("content"))
            {
                return string.Empty;
                return StringUtility.Contact(Language.GetFromLocal(30), "\r\n", maoerVersion["content"].ToString());
            }
            else
            {
                return StringUtility.Contact(Language.GetFromLocal(30), "\r\n", maoerVersion.content);
                return string.Empty;
            }
        }
        else
@@ -236,24 +243,20 @@
            var tables = new Dictionary<string, string>();
            tables["uid"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
            var url = "https://api.maoergame.com/update/download/url";
            Debug.LogFormat("猫耳强更url:{0}  uid:{1} ", url, ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account);
            HttpRequest.Instance.RequestHttpPost(url, tables, HttpRequest.defaultHttpContentType, 1, OnMaoErVersionCheckResult);
        }
    }
    private void OnMaoErVersionCheckResult(bool ok, string result)
    {
        UTF8Encoding utf8 = new UTF8Encoding();
        Byte[] encodedBytes = utf8.GetBytes(result);
        String decodedString = utf8.GetString(encodedBytes);
        Debug.LogFormat("猫耳强更请求返回结果 result:{0}:{1}", ok, result);
        Debug.LogFormat("猫耳强更请求返回结果 result:{0}", decodedString);
        if (ok)
        {
            try
            {
                maoerVersion = JsonMapper.ToObject<MaoErVersion>(result);
                if (maoerVersion.code == 0)
                maoerVersion = JsonMapper.ToObject(result);
                if (maoerVersion.Keys.Contains("code") && maoerVersion["code"].ToString() == "0")
                {
                    step = Step.DownLoadPrepared;
                    WindowCenter.Instance.OpenFromLocal<VersionUpdateWin>();
@@ -266,6 +269,7 @@
            }
            catch (System.Exception ex)
            {
                Debug.Log(ex);
                step = Step.None;
                Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
            }
@@ -346,7 +350,7 @@
    public struct MaoErVersion
    {
        public string msg;
        public int code;
        public string code;
        public string content;
        public string url;
    }
System/Dogz/DogzEquip.cs
@@ -15,6 +15,7 @@
        public void Display(ItemModel model)
        {
            itemBaisc.Init(model);
            itemBaisc.bindIcon.gameObject.SetActive(false);
            int strenLv = 0;
            if(model.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus) != null)
            {
System/Dogz/DogzPackWin.cs
@@ -264,7 +264,26 @@
                dogzModel.GetDogzItemListByIndex(dogzModel.presentSelectDogz,i);
                if (dogzModel.selectEquipPlacelist.Count > 0)
                {
                    indexlist.Add(dogzModel.selectEquipPlacelist[0].itemInfo.ItemPlace);
                    ItemModel selectModel = dogzModel.selectEquipPlacelist[0];
                    ItemModel itemModel = null;
                    int equipPlace = dogzModel.GetDogzEquipPlaceByIndex(i);
                    dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz,equipPlace,out itemModel);
                    if(itemModel == null)
                    {
                        indexlist.Add(selectModel.itemInfo.ItemPlace);
                    }
                    else
                    {
                        if (itemModel.chinItemModel.ItemColor < selectModel.chinItemModel.ItemColor
                           || (itemModel.chinItemModel.StarLevel < selectModel.chinItemModel.StarLevel
                           && itemModel.chinItemModel.ItemColor == selectModel.chinItemModel.ItemColor)
                            || (itemModel.equipScore < selectModel.equipScore
                            && itemModel.chinItemModel.ItemColor == selectModel.chinItemModel.ItemColor
                            && itemModel.chinItemModel.StarLevel == selectModel.chinItemModel.StarLevel))
                        {
                            indexlist.Add(dogzModel.selectEquipPlacelist[0].itemInfo.ItemPlace);
                        }
                    }
                }
            }
            if(indexlist.Count > 0)
System/KnapSack/New/CommonItemBaisc.cs
@@ -218,7 +218,8 @@
        {
            ItemConfig config = Config.Instance.Get<ItemConfig>(itemId);
            int playerJob = PlayerDatas.Instance.baseData.Job;
            if (config == null || (!isCompare && compareSocre <= 0) || config.EquipPlace == 0 || score == compareSocre) return 0;
            if (config == null || (!isCompare && compareSocre <= 0) || config.EquipPlace == 0
                || score == compareSocre || type == PackType.rptEquip || type == PackType.rptDogzEquip) return 0;
            ItemModel model = playerPack.GetItemModelByGUID(guid);
            if (model != null && modelInterface.IsOverdue(guid, itemId, model.useDataDict)) return 1;
System/MainInterfacePanel/UpgradeWin.cs
New file
@@ -0,0 +1,87 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, September 26, 2018
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI {
    public class UpgradeWin : Window
    {
        [SerializeField] UIAlphaTween m_UIAlphaTween;
        [SerializeField] ScaleTween m_ScaleTween;
        [SerializeField] UIAlphaTween m_UIAlphaTween1;
        [SerializeField] GameObject m_Guang;
        [SerializeField] Text m_TextLV;
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
        }
        protected override void OnPreOpen()
        {
          //  m_Guang.SetActive(false);
            m_TextLV.text = PlayerDatas.Instance.baseData.LV.ToString();
            m_UIAlphaTween1.SetEndState();
        }
        protected override void OnActived()
        {
            m_UIAlphaTween.Play(ShowOverAlpha);
            m_ScaleTween.Play();
        }
        protected override void OnAfterOpen()
        {
            WindowCenter.Instance.windowBeforeCloseEvent += windowBeforeClose;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418)
        }
        protected override void OnPreClose()
        {
            WindowCenter.Instance.windowBeforeCloseEvent -= windowBeforeClose;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418)
        }
        private void windowBeforeClose(Window _window)
        {
            if (_window is MainInterfaceWin)
            {
                Close();
            }
        }
        private void Updatefighting(PlayerDataRefresh obj)
        {
            if (obj == PlayerDataRefresh.LV)
            {
                m_TextLV.text = PlayerDatas.Instance.baseData.LV.ToString();
            }
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        private void ShowOverAlpha()
        {
            m_UIAlphaTween.Play(true);
            m_UIAlphaTween1.Play(true);
        }
    }
}
System/MainInterfacePanel/UpgradeWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4bcd6e645b0e4dc4fb3359ce209aa612
timeCreated: 1537944869
licenseType: Free
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Strengthening/GodBeastAttributes.cs
@@ -76,7 +76,7 @@
        {
            GodBeast_Number = 0;
            GodBeast_Part = 0;
            GodBeastReinforcementWin.ChooseToModify -= ChooseToModify;
            godBeastModel.AbsorbEvent -= AbsorbEvent;
        }
@@ -96,7 +96,7 @@
            {
                AttributeAssignment();
            }
        }
        private void OnClickStrengthBtn()
        {
@@ -108,15 +108,42 @@
                ListIndex.Add(key);
                ListCount.Add(DicAb[key]);
            }
            if (m_DoubleToggle.isOn)
            if (m_DoubleToggle.isOn)//双倍强化
            {
                if (ListIndex.Count <= 0)
                {
                    return;
                }
                dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
                if (NeedFairyJade <= 0)
                {
                    dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
                }
                else
                {
                    int Gold = (int)UIHelper.GetMoneyCnt(1);//仙玉
                    string strNull = string.Format(Language.Get("DogzDoubleRemind"), NeedFairyJade);
                    ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
                     {
                         if (isOk)
                         {
                             if (Gold >= NeedFairyJade)
                             {
                                 dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
                             }
                             else
                             {
                                 if (VersionConfig.Get().isBanShu)
                                 {
                                     SysNotifyMgr.Instance.ShowTip("GoldErr");
                                     return;
                                 }
                                 WindowCenter.Instance.Open<RechargeTipWin>();
                             }
                         }
                     });
                }
            }
            else
            else//单倍强化
            {
                if (ListIndex.Count <= 0)
                {
@@ -149,7 +176,7 @@
                    {
                        if (itemModel[i].EquipPlace == GodBeastPart)
                        {
                            ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0, itemModel[i].itemInfo.IsBind);
                            ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0, 0);//默认显示不上锁
                            m_ItemCell.Init(ItemModel);
                            m_ItemCell.cellBtn.RemoveAllListeners();
                            int type = i;
@@ -162,7 +189,7 @@
                }
                m_UIAlphaTween.gameObject.SetActive(true);
                m_FrameNull.SetActive(true);
                m_FullLevel.SetActive(false);
                m_FullLevel.SetActive(false);
                GetDogZLevelAndExp();
                AttributeAssignment();
            }
@@ -226,7 +253,7 @@
                }
                else
                {
                    m_StrengthenDoubleBtn.interactable = true;
                    m_StrengthenBtn.interactable = true;
                    m_Text_two.SetActive(true);
@@ -285,7 +312,7 @@
                        else
                        {
                            DoubleProficiency += itemModel.chinItemModel.EffectValueA1 * 2 * DicAb[key];
                            NeedFairyJade += itemModel.chinItemModel.Effect2 * DicAb[key];
                            NeedFairyJade += itemModel.chinItemModel.EffectValueB1 * DicAb[key];
                        }
                    }
                }
@@ -382,7 +409,7 @@
            var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
            if (IudetDogzEquipPlus != null)
            {
                ToExpTotal+= IudetDogzEquipPlus[1];
                ToExpTotal += IudetDogzEquipPlus[1];
            }
            for (int i = lv; i >= 0; i--)
            {
System/Strengthening/GodBeastChildNodes.cs
@@ -46,6 +46,7 @@
        {
            ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, Index);
            m_ItemCell.Init(itemModel);
            m_ItemCell.bindIcon.gameObject.SetActive(false);
            var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
            TextNumber.gameObject.SetActive(false);
            if (IudetDogzEquipPlus != null)
System/Strengthening/GodBeastModel.cs
@@ -18,11 +18,13 @@
    public int ItemInde = 0;//物品下标
    public ItemModel Crystal_ItemModel;//当前所选中的水晶物品
    public int ItemPlace = -1;//神兽装备位置信息
    public  Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//对应品质所能选择的最大强化等级
    public Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//对应品质所能选择的最大强化等级
    DogzModel Dogz_model;
    DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
    PlayerPackModel _playerPack;
    PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
    private const int Redpoint_key1 = 11202;//神兽强化红点
    public Redpoint redPointStre1 = new Redpoint(112, Redpoint_key1);
    public override void Init()
    {
        if (QualityLimit.Count <= 0)
@@ -39,7 +41,44 @@
    public void OnPlayerLoginOk()
    {
        playerPack.ItemCntAddAct -= ItemCntAddAct;
        playerPack.ItemCntReduceAct -= ItemCntReduceAct;
        dogz_model.UpdateAssistDogzEvent -= UpdateAssistDogzEvent;
        FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
        playerPack.ItemCntAddAct += ItemCntAddAct;//物品数量增加
        playerPack.ItemCntReduceAct += ItemCntReduceAct;//物品数量减少
        dogz_model.UpdateAssistDogzEvent += UpdateAssistDogzEvent;
        FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
        GodBeastRedPoint();
    }
    private void OnFuncStateChangeEvent(int obj)
    {
        if (obj == 138)
        {
            GodBeastRedPoint();
        }
    }
    private void UpdateAssistDogzEvent()
    {
        GodBeastRedPoint();
    }
    private void ItemCntReduceAct(PackType packType, int arg2, int arg3)
    {
        if (packType == PackType.rptDogzItem || packType == PackType.rptDogzEquip)
        {
            GodBeastRedPoint();
        }
    }
    private void ItemCntAddAct(PackType packType, int arg2, int arg3)
    {
        if (packType == PackType.rptDogzItem || packType == PackType.rptDogzEquip)
        {
            GodBeastRedPoint();
        }
    }
    public override void UnInit()
@@ -137,7 +176,7 @@
            return false;
        }
        int lv = QualityLimit[itemModel.chinItemModel.ItemColor];
        var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv);
        var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv);
        var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
        if (IudetDogzEquipPlus != null)
@@ -175,7 +214,7 @@
            else
            {
                return false;
            }
            }
        }
        else
        {
@@ -189,6 +228,69 @@
            }
        }
    }
    private void GodBeastRedPoint()//神兽强化红点
    {
        bool Istrue = false;
        int ItemColor = 10;
        var DogzEquipDict = dogz_model.dogzAssistStateDict;
        redPointStre1.state = RedPointState.None;
        int Type = 0;
        foreach (var key in DogzEquipDict.Keys)
        {
            if (DogzEquipDict[key] == 1)
            {
                Type += 1;
                List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
                for (int i = 0; i < itemModel.Count; i++)
                {
                    if (itemModel[i].chinItemModel.ItemColor < ItemColor)//获取最低品质的颜色
                    {
                        ItemColor = itemModel[i].chinItemModel.ItemColor;
                    }
                    var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
                    if (IudetDogzEquipPlus == null)//判断是否都满级 满级不可亮红点
                    {
                        Istrue = true;
                    }
                    else
                    {
                        if (QualityLimit.ContainsKey(itemModel[i].chinItemModel.ItemColor) && IudetDogzEquipPlus[0] < (QualityLimit[itemModel[i].chinItemModel.ItemColor]))
                        {
                            Istrue = true;
                        }
                    }
                }
                if (Istrue)
                {
                    if (playerPack.GetSinglePackModel(PackType.rptDogzItem) == null)
                    {
                        return;
                    }
                    Dictionary<int, ItemModel> BackpackDic = playerPack.GetSinglePackModel(PackType.rptDogzItem).GetPackModelIndexDict();
                    int _ItemColor = 10;
                    foreach (var keyBack in BackpackDic.Keys)
                    {
                        var itemModelBack = BackpackDic[keyBack];
                        if (itemModelBack.chinItemModel.Type == 70)//有神兽水晶时的红点
                        {
                            redPointStre1.state = RedPointState.Simple;
                            return;
                        }
                        if (itemModelBack.chinItemModel.ItemColor < _ItemColor)
                        {
                            _ItemColor = itemModelBack.chinItemModel.ItemColor;
                        }
                    }
                    if (Type >= dogz_model.DogzAssistDefaultCnt && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
                    {
                        redPointStre1.state = RedPointState.Simple;
                        return;
                    }
                }
            }
        }
    }
}