Exemple #1
0
    void RefreshUI()
    {
        int currentPhysics = UserDC.GetPhysical();
        int total          = UserM.GetMaxPhysical(UserDC.GetLevel());

        if (currentPhysics >= total)
        {
            SetType(0);
        }
        else
        {
            SetType(1);
        }

        int serverTime = GlobalTimer.GetNowTimeInt();

        NGUIUtil.SetLableText <string>(MyHead.LblTime, NdUtil.ConvertServerTime(serverTime));
        if (m_iType == 1)
        {
            int resumePhysicsTime = GlobalTimer.instance.GetPhysicsResumeCounter();
            NGUIUtil.SetLableText <string>(MyHead.LblNextResumeTime, NdUtil.TimeFormat(resumePhysicsTime));

            int resumePhysicsAllTime = GlobalTimer.instance.GetPhysicsResumeAllCounter();
            NGUIUtil.SetLableText <string>(MyHead.LblResumeAllTime, NdUtil.TimeFormat(resumePhysicsAllTime));
        }
    }
Exemple #2
0
        public UserDC LoadByPrimaryKey(DBConnection Connection, string UserCode)
        {
            UserDC        objUser = new UserDC();
            StringBuilder sql     = new StringBuilder();

            sql.Append("proc_UsersLoadByPrimaryKey");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_UserCode", DbType.String, UserCode);


            IDataReader reader = null;

            if (Connection.Transaction != null)
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                reader = Connection.dataBase.ExecuteReader(dbCommandWrapper.DBCommand);
            }

            objUser = FillObject(reader);
            return(objUser);
        }
Exemple #3
0
    public bool ShowCaptionUpWnd()
    {
        CombatScene combat = SceneM.GetCurIScene() as CombatScene;

        if (combat != null)
        {
            UserInfo old = combat.m_oldUserInfo;
            if (old.Level < UserDC.GetLevel())
            {
                CaptionUpgradeWnd cuw = WndManager.GetDialog <CaptionUpgradeWnd>();
                int oldMaxPhysical    = UserM.GetMaxPhysical(old.Level);
                int newMaxPhysical    = UserM.GetMaxPhysical(UserDC.GetLevel());
                int oldMaxherolevel   = UserM.GetUserMaxHeroLevel(old.Level);
                int newMaxherolevel   = UserM.GetUserMaxHeroLevel(UserDC.GetLevel());
                cuw.SetData(old.Level, UserDC.GetLevel(),
                            StageDC.GetStageResult().win ? old.Physical - StageDC.GetCounterPartInfo().win_physical : old.Physical - StageDC.GetCounterPartInfo().lose_physical,
                            UserDC.GetPhysical(),
                            oldMaxPhysical, newMaxPhysical, oldMaxherolevel, newMaxherolevel);

                cuw.MyHead.BtnBg.OnClickEventHandler    += BackMainScence;
                cuw.MyHead.BtnClose.OnClickEventHandler += BackMainScence;

                return(true);
            }
        }

        return(false);
    }
Exemple #4
0
 /// <summary>
 /// 获取需要的碎片及拥有数量。
 /// </summary>
 private void GetFragment()
 {
     //获取升级需要的资源。
     buildingM.GetUpStarNeed(m_Info.BuildType, m_Info.StarLevel + 1, ref m_NeedFragment, ref m_NeedCoin);
     m_HaveFragment = ItemDC.GetItemCount(m_Info.fragmentTypeID);//当前灵魂石
     m_haveCoin     = UserDC.GetCoin();
 }
Exemple #5
0
    void Resweep(UIButton sender)
    {
        ItemTypeInfo sweepTicketInfo = ItemDC.GetSweepTickets();

        if (sweepTicketInfo == null || sweepTicketInfo.Num < mSweepCount)
        {
            WndManager.DestoryDialog <StageWipeWnd>();
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("70000229"));
            return;
        }
        CounterPartInfo info           = StageDC.GetCounterPartInfo();
        int             playerPhysical = UserDC.GetPhysical();

        // ÌåÁ¦²»×ã
        if (playerPhysical < info.win_physical * mSweepCount)
        {
            WndManager.DestoryDialog <StageWipeWnd>();
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("99904008"));
            return;
        }

        StageDC.SendStageSweepRequest(StageDC.GetCompaignStageID(), mSweepCount);
        Clear();
        //DataCenter.RegisterHooks((int)gate.Command.CMD.CMD_718, ShowSweepResult);
    }
Exemple #6
0
        public List <UserDC> Post([FromBody] UserDC userDC)
        {
            if (userDC == null)
            {
                return(new List <UserDC>());
            }

            switch (userDC.event_key)
            {
            case "search": {
                return(UserManager.users_search(_context, userDC));
            }

            case "new":
            {
                if (UserManager.users_exists(_context, userDC))
                {
                    return(UserManager.users_search(_context, userDC));
                }
                else
                {
                    return(UserManager.users_create(_context, userDC));
                }
            }

            default:
                break;
            }
            return(new List <UserDC>());
        }
 private void SetSelect()
 {
     if (UserDC.GetLevel() >= m_caption.m_levelneed)
     {
         MyHead.toggle.value = true;
     }
 }
Exemple #8
0
    /// <summary>
    /// 吃经验.
    /// </summary>
    /// <param name="Num">Number.</param>
    private void AddItemUseNum(int Num)
    {
        m_parent.SetItemNum();
        m_iHaveAddNum = m_iHaveAddNum + Num;

        if (!MyHead.LblNumUsed.gameObject.activeInHierarchy)
        {
            MyHead.LblNumUsed.gameObject.SetActive(true);
        }
        MyHead.LblNumUsed.text = "X" + m_iHaveAddNum.ToString();

        int MaxLvl = UserM.GetUserMaxHeroLevel(UserDC.GetLevel());

        Info.EXP += int.Parse(m_ItemInfo.m_args);

        int MaxExp = SoldierM.GetSoldierTotalExpAtLevel(MaxLvl);


        int LevExp = SoldierM.GetSoldierExp(Info.Level);

        if (Info.EXP >= LevExp && Info.Level < MaxLvl)
        {
            int exp = SoldierM.GetSoldierExp(Info.Level);
            CalUplevelNum(exp, MaxLvl);
        }

        int   Exp = SoldierM.GetSoldierExp(Info.Level);
        float pre = (Info.EXP * 1.0f) / (Exp * 1.0f);

        AddLeveAndExp(Info.Level, pre, true);
    }
Exemple #9
0
    private void SetUI()
    {
        ClearUI();
        int leftPoints         = UserDC.GetLeftSkillPoints();
        int maxLeftSkillPoints = ConfigM.GetMaxLeftSkillPoints(UserDC.GetVIPLevel());

        NGUIUtil.SetActive(MyHead.SkillPointsFull, false);
        NGUIUtil.SetActive(MyHead.SkillPointsNotFull, false);
        NGUIUtil.SetActive(MyHead.SkillPointsEmpty, false);
        if (leftPoints >= maxLeftSkillPoints)   //技能点数满
        {
            m_wndType = 0;
            NGUIUtil.SetActive(MyHead.SkillPointsFull, true);
        }
        else if (leftPoints < maxLeftSkillPoints && leftPoints > 0)     //技能点数未满
        {
            m_wndType = 1;
            NGUIUtil.SetActive(MyHead.SkillPointsNotFull, true);
        }
        else if (leftPoints == 0)     //技能点数为0
        {
            m_wndType      = 2;
            m_iTotalSecond = ConfigM.GetResumeSkillTime() + GlobalTimer.GetNowTimeInt();
            NGUIUtil.SetActive(MyHead.SkillPointsEmpty, true);
        }

        SetLeftSkillPoint(leftPoints);
        CreateList();
        NGUIUtil.RepositionTable(MyHead.Parent);
    }
Exemple #10
0
    public static byte[] SerializerProtobuf(int msgno, string name, byte[] networkmsg)
    {
        GateMessage gm = new GateMessage();

        gm.head = new Header();

        gm.head.uid = UserDC.GetUserID();

        gm.head.client_version = ConstantData.g_version;

        gm.head.internal_version = ConstantData.g_Ndversion;

        GateMessage.MessageContent msg = new GateMessage.MessageContent();
        msg.cmd = msgno;

        msg.proto_name = name;


        msg.network_message = networkmsg;

        gm.content.Add(msg);

        MemoryStream gateStream = new MemoryStream();

        ProtoBuf.Serializer.Serialize <GateMessage> (gateStream, gm);

        return(gateStream.ToArray());
    }
Exemple #11
0
    /// <summary>
    /// 陷阱能否升星.
    /// </summary>
    /// <returns>The can up star.</returns>
    /// <param name="Info">Info.</param>
    public static CanStarResult GetCanUpStar(BuildInfo Info)
    {
        if (Info.StarLevel == 5)
        {
            return(CanStarResult.StarMax);
        }

        int NeedCoin        = 0;
        int HaveCoin        = 0;
        int NeedFragmentNum = 0;

        GetUpStarNeed(Info.BuildType, Info.StarLevel + 1, ref NeedFragmentNum, ref NeedCoin);

        int HaveFragmentNum = ItemDC.GetItemCount(Info.fragmentTypeID);        //当前灵魂石

        HaveCoin = UserDC.GetCoin();



        if (HaveCoin < NeedCoin)
        {
            return(CanStarResult.LessCoin);
        }

        if (HaveFragmentNum < NeedFragmentNum)
        {
            return(CanStarResult.LessMater);
        }

        return(CanStarResult.CanUp);
    }
Exemple #12
0
        private UserDC FillObject(DataRow row)
        {
            UserDC objUser = null;

            objUser                  = new UserDC();
            objUser.UserCode         = (String)row["UserCode"];
            objUser.UserID           = (String)row["UserID"];
            objUser.Password         = (String)row["Password"];
            objUser.RoleID           = (String)row["RoleID"];
            objUser.Status           = (Boolean)row["Status"];
            objUser.LastLoginDate    = row["LastLoginDate"] == DBNull.Value ? null : (DateTime?)row["LastLoginDate"];
            objUser.WrongTries       = row["WrongTries"] == DBNull.Value ? null : (int?)row["WrongTries"];
            objUser.LastWrongTryDate = row["LastWrongTryDate"] == DBNull.Value ? null : (DateTime?)row["LastWrongTryDate"];
            objUser.AddOn            = row["AddOn"] == DBNull.Value ? null : (DateTime?)row["AddOn"];
            objUser.AddBy            = row["AddBy"] == DBNull.Value ? null : (String)row["AddBy"];
            objUser.EditOn           = row["EditOn"] == DBNull.Value ? null : (DateTime?)row["EditOn"];
            objUser.EditBy           = (String)row["EditBy"];
            objUser.IsSyncReq        = (Boolean)row["IsSyncReq"];
            objUser.UserName         = (String)row["UserName"];
            objUser.Address1         = (String)row["Address1"];
            objUser.Address2         = row["Address2"] == DBNull.Value ? null : (String)row["Address2"];
            objUser.Email            = (String)row["Email"];
            objUser.PhoneHome        = (String)row["PhoneHome"];
            objUser.Cell1            = (String)row["Cell1"];
            objUser.Cell2            = (String)row["Cell2"];
            objUser.Other            = (String)row["Other"];
            objUser.CompanyID        = row["CompanyID"] == DBNull.Value ? null : (int?)row["CompanyID"];
            objUser.IsSync           = (Boolean)row["IsSync"];
            objUser.RowState         = (String)row["RowState"];
            objUser.SyncDate         = row["SyncDate"] == DBNull.Value ? null : (DateTime?)row["SyncDate"];

            return(objUser);
        }
Exemple #13
0
    /// <summary>
    /// 陷阱是否能升级.
    /// </summary>
    /// <returns><c>true</c> if can up level the specified Info; otherwise, <c>false</c>.</returns>
    /// <param name="Info">Info.</param>
    public static CanLevelResult GetLevelCanUP(BuildInfo Info)
    {
        int needCoin = 0;
        int needWood = 0;

        buildingM.GetUpLevelNeed(Info.BuildType, Info.Level, ref needCoin, ref needWood);
        //获取已有的资源。
        int HaveCoin = UserDC.GetCoin();
        int HaveWood = UserDC.GetWood();

        if (Info.Level >= UserDC.GetLevel())
        {
            return(CanLevelResult.LevelLimit);
        }
        else if (needCoin == 0 && needWood == 0)
        {
            return(CanLevelResult.LevelMax);
        }
        else if (HaveCoin < needCoin)
        {
            return(CanLevelResult.LessCoin);
        }
        else if (HaveWood < needWood)
        {
            return(CanLevelResult.LessMater);
        }
        else if (HaveCoin >= needCoin && HaveWood >= needWood)
        {
            return(CanLevelResult.CanUp);
        }
        else
        {
            return(CanLevelResult.LevelLimit);
        }
    }
Exemple #14
0
    private void SetUI()
    {
        if (m_soldierInfo == null && m_buildInfo == null)
        {
            NGUIUtil.DebugLog("SummonHeroWnd 's Info is null!!!");
            return;
        }
        int NeedNum  = 0;
        int NeedCoin = 0;

        if (m_iWndType == 1 && m_soldierInfo != null)
        {
            SoldierM.GetUpStarNeed(m_soldierInfo.SoldierTypeID, m_soldierInfo.StarLevel, ref NeedNum, ref NeedCoin);
        }
        else if (m_iWndType == 2 && m_buildInfo != null)
        {
            buildingM.GetUpStarNeed(m_buildInfo.BuildType, m_buildInfo.StarLevel, ref NeedNum, ref NeedCoin);
        }


        SetDialogLable(NeedCoin);
        if (NeedCoin > UserDC.GetCoin())
        {
            MyHead.BtnYES.SetState(UIButtonColor.State.Disabled, true);
            MyHead.BtnYES.isEnabled = false;
        }
    }
Exemple #15
0
    public void BtnAddSkill_OnClickEventHandler(UIButton sender)
    {
        ///1 金币不足,2炮弹兵等级不足,0是能够升级,3技能为空不能升级,4技能点不足.
        int result = CheckSkillCanUp();

        if (UserDC.GetLeftSkillPoints() >= 1 && result == 0)
        {
            if (m_iSkillNo < 6)
            {
                PlayAddSkillEffect();
                SoldierDC.Send_SoldierSkillUpRequest(m_dSoldierID, m_iSkillNo);
            }
        }
        else if (result == 1)
        {
            NGUIUtil.ShowTipWndByKey(99901003);
        }
        else if (result == 2)
        {
            NGUIUtil.ShowTipWndByKey(10000104);
        }
        else if (result == 4)
        {
            NGUIUtil.ShowTipWndByKey(99914004);
        }
        else if (result == 5)
        {
            NGUIUtil.ShowTipWndByKey(99914003);
        }
    }
Exemple #16
0
    public int GetPhysicsResumeAllCounter()
    {
        int current = UserDC.GetPhysical();
        int total   = UserM.GetMaxPhysical(UserDC.GetLevel());
        int temp    = (total - current - 1) * ConfigM.GetResumePhysicsTime();

        return(PhysicsResumeCounter + temp);
    }
Exemple #17
0
    /// <summary>
    /// 返回物品的数量
    /// </summary>
    public static int GetItemCount(s_signinInfo info)
    {
        int result            = 0;
        int id                = info.item_type;
        SignInRewardType type = (SignInRewardType)info.reward_type;

        switch (type)
        {
        case SignInRewardType.BlackScience:
            CaptionInfo cInfo = new CaptionInfo();
            GodSkillM.GetCaption(id, ref cInfo);
            if (cInfo.m_captionid > 0)
            {
                result = 1;
            }
            break;

        case SignInRewardType.HeroSoulFragment:
        case SignInRewardType.ItemAndEquip:
        case SignInRewardType.TrapFragment:
        case SignInRewardType.BlackScienceFragment:
            result = ItemDC.GetItemCount(id);
            break;

        case SignInRewardType.Hero:
            SoldierInfo info2 = SoldierM.GetSoldierInfo(id);
            if (info2 != null)
            {
                result = 1;
            }
            break;

        case SignInRewardType.Trap:
            BuildInfo info3 = buildingM.GetStartBuildInfo(id);
            if (info3 != null)
            {
                result = 1;
            }
            break;

        case SignInRewardType.GoldCoin:    //下面内容策划待定
            result = UserDC.GetCoin();
            break;

        case SignInRewardType.Diamond:
            result = UserDC.GetDiamond();
            break;

        case SignInRewardType.Crystal:
            result = UserDC.GetCrystal();
            break;

        case SignInRewardType.Wood:
            result = UserDC.GetWood();
            break;
        }
        return(result);
    }
Exemple #18
0
    void BtnSure_OnClickEventHandler(UIButton sender)
    {
        switch (m_wndType)
        {
        case 1:    //确定
            BtnWndBg_OnClickEventHandler(null);
            break;

        case 2:    //合成公式
            TweenLeft();
            EquipComposeWnd wnd = WndManager.GetDialog <EquipComposeWnd>();
            if (wnd)
            {
                EnableBtn(false);
                wnd.SetData(m_iItemTypeID);
            }
            break;

        case 3:    //穿装备
            PdbycWnd wnd1 = WndManager.FindDialog <PdbycWnd>();
            if (wnd1)
            {
                wnd1.SetEquipDataNoReady();
            }
            MyHead.BtnSure.isEnabled = false;
            SoldierDC.Send_SoldierEquipRequest(m_soldierInfo.ID, m_posIndex);
            WndManager.DestoryDialog <EquipmentInfoWnd>();
            break;

        case 4:    //购买
            //堆叠数量上限判定
            bool overLimit = ItemDC.CheckItemOverLimit(m_iItemTypeID, m_iBuyCount);
            if (overLimit)
            {
                NGUIUtil.ShowTipWndByKey(30000030);
                break;
            }
            //持有代币是否足够
            bool currencyEnough = UserDC.CheckCurrencyEnough(m_iBuyCurrency, m_iBuyPrice);
            if (currencyEnough)
            {
            }
            else
            {
                string currencyName = NGUIUtil.GetStringByKey(99700000 + m_iBuyCurrency);
                string tipText      = string.Format(NGUIUtil.GetStringByKey(30000029), currencyName);
                //NGUIUtil.ShowTipWnd(tipText);
                NGUIUtil.ShowFreeSizeTipWnd(tipText);
            }
            break;

        case 5:    //获得途径
            ItemComeFromWnd Formwnd = WndManager.GetDialog <ItemComeFromWnd>();
            s_itemtypeInfo  info    = ItemM.GetItemInfo(m_iItemTypeID);
            Formwnd.SetData(info, m_soldierInfo, null);
            break;
        }
    }
Exemple #19
0
 /// <summary>
 /// 模拟数据接口。
 /// </summary>
 public static void SimulationData()
 {
     UserDC.SimulationData();
     SoldierDC.SimulationData();
     StageDC.SimulationData();
     BuildDC.SimulationData();
     BlackScienceDC.SimulationData();
     ShipPlanDC.SimulationData();
 }
Exemple #20
0
 /// <summary>
 /// 清理数据中心数据
 /// </summary>
 public static void ClearDC()
 {
     UserDC.ClearDC();
     SoldierDC.ClearDC();
     BuildDC.ClearDC();
     ItemDC.ClearDC();
     BlackScienceDC.ClearDC();
     ShipPlanDC.ClearDC();
 }
Exemple #21
0
    public void UpLevel()
    {
        if (MyHead.togUpLevel.value)
        {
            MyHead.UpStar.SetActive(false);
            MyHead.UpLevel.SetActive(true);
            MyHead.BtnUpStar.gameObject.SetActive(false);
            MyHead.btnUp.gameObject.SetActive(true);
            MyHead.LblNextName.text = NGUIUtil.GetStringByKey(10000154);
            //MyHead.btnUp.isEnabled = false;

            if (m_CurItem != null)
            {
                m_CurItem.ResetUI();
                MyHead.LblStarName.text = "";
                MyHead.lblName.text     = "[71fff0]" + m_CurItem.Godskill.m_name + "[-]  [ffff62]" + NGUIUtil.GetStringByKey("60000005") + m_CurItem.m_caption.m_level1 + "[-]";
                if (m_CurItem.Godskill.m_coinneed == 0 && m_CurItem.Godskill.m_crystalneed == 0)
                {
                    MyHead.lblExplain.text = NGUIUtil.GetStringByKey(10000122);
                }
                else
                {
                    MyHead.lblExplain.text = string.Format("[552d0a]" + m_CurItem.Godskill.m_explain + "[-]");
                }

                MyHead.lblGoldCost.text = m_CurItem.Godskill.m_coinneed.ToString();

                if (UserDC.GetCoin() >= m_CurItem.Godskill.m_coinneed)
                {
                    MyHead.lblGoldCost.color = Color.white;
                }
                else
                {
                    MyHead.lblGoldCost.color = Color.red;
                }

                MyHead.lblDiamondCost.text = m_CurItem.Godskill.m_crystalneed.ToString();
                if (UserDC.GetCrystal() >= m_CurItem.Godskill.m_crystalneed)
                {
                    MyHead.lblDiamondCost.color = Color.white;
                }
                else
                {
                    MyHead.lblDiamondCost.color = Color.red;
                }
                m_CurItem.CheckUp();
                //				MyHead.btnUp.isEnabled = m_CurItem.CheckLevTop() && m_CurItem.m_CanLevUP;
                GodSkillInfo nextInfo = new GodSkillInfo();

                GodSkillM.GetGodSkill(m_CurItem.Godskill.m_type, m_CurItem.Godskill.m_level + 1, ref nextInfo);
                if (nextInfo != null && nextInfo.m_explain != null)
                {
                    MyHead.NextStarDes.text = string.Format("[552d0a]" + nextInfo.m_explain + "[-]");
                }
            }
        }
    }
Exemple #22
0
        private int Update(DBConnection Connection, UserDC objUser)
        {
            int updateCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_UsersUpdate");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);


            dbCommandWrapper.AddInParameter("p_UserCode", DbType.String, objUser.UserCode);
            dbCommandWrapper.AddInParameter("p_UserID", DbType.String, objUser.UserID);
            dbCommandWrapper.AddInParameter("p_Password", DbType.String, objUser.Password);
            dbCommandWrapper.AddInParameter("p_RoleID", DbType.String, objUser.RoleID);
            dbCommandWrapper.AddInParameter("p_Status", DbType.Boolean, objUser.Status);
            dbCommandWrapper.AddInParameter("p_LastLoginDate", DbType.DateTime, objUser.LastLoginDate);
            dbCommandWrapper.AddInParameter("p_WrongTries", DbType.Int32, objUser.WrongTries);
            dbCommandWrapper.AddInParameter("p_LastWrongTryDate", DbType.DateTime, objUser.LastWrongTryDate);
            dbCommandWrapper.AddInParameter("p_AddOn", DbType.DateTime, objUser.AddOn);
            dbCommandWrapper.AddInParameter("p_AddBy", DbType.String, objUser.AddBy);
            dbCommandWrapper.AddInParameter("p_EditOn", DbType.DateTime, objUser.EditOn);
            dbCommandWrapper.AddInParameter("p_EditBy", DbType.String, objUser.EditBy);
            dbCommandWrapper.AddInParameter("p_IsSyncReq", DbType.Boolean, objUser.IsSyncReq);
            dbCommandWrapper.AddInParameter("p_UserName", DbType.String, objUser.UserName);
            dbCommandWrapper.AddInParameter("p_Address1", DbType.String, objUser.Address1);
            dbCommandWrapper.AddInParameter("p_Address2", DbType.String, objUser.Address2);
            dbCommandWrapper.AddInParameter("p_Email", DbType.String, objUser.Email);
            dbCommandWrapper.AddInParameter("p_PhoneHome", DbType.String, objUser.PhoneHome);
            dbCommandWrapper.AddInParameter("p_Cell1", DbType.String, objUser.Cell1);
            dbCommandWrapper.AddInParameter("p_Cell2", DbType.String, objUser.Cell2);
            dbCommandWrapper.AddInParameter("p_Other", DbType.String, objUser.Other);
            dbCommandWrapper.AddInParameter("p_CompanyID", DbType.Int32, objUser.CompanyID);
            dbCommandWrapper.AddInParameter("p_IsSync", DbType.Boolean, objUser.IsSync);
            dbCommandWrapper.AddInParameter("p_RowState", DbType.String, objUser.RowState);
            dbCommandWrapper.AddInParameter("p_SyncDate", DbType.DateTime, objUser.SyncDate);


            if (Connection.Transaction != null)
            {
                updateCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                updateCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            if (updateCount == 0)
            {
                objUser.IsDirty = IsDirty = true;
            }

            return(updateCount);
        }
Exemple #23
0
    public void SetName()
    {
        if (MyHead.LblUserName != null)
        {
            MyHead.LblUserName.text = UserDC.GetName() + NGUIUtil.GetStringByKey(88800038) + UserDC.GetLevel().ToString();
        }


        if (MyHead.LblEnemyName != null)
        {
            MyHead.LblEnemyName.text = CmCarbon.DefenderInfo.Name + NGUIUtil.GetStringByKey(88800038) + CmCarbon.DefenderInfo.Level.ToString();
        }
    }
Exemple #24
0
    /*初始化木头设置*/
    private void SetWood()
    {
        m_iWood = UserDC.GetWood();
        if (MyHead.OurResourceEnergy != null)
        {
            SetNum(m_iWood, MyHead.OurResourceEnergy);
        }

        if (MyHead.EnemyResourceEnergy != null)
        {
            SetNum(CmCarbon.DefenderInfo.Wood, MyHead.EnemyResourceEnergy);
        }
    }
Exemple #25
0
    public override void BuildUI()
    {
        Life.Environment = LifeEnvironment.Combat;
        CombatScheduler.SetCSState(CSState.Ready);

        if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE)
        {
            if (StageDC.GetPveMode() == PVEMode.Attack)
            {
                WndManager.GetDialog <SelectSoldierwnd>();
                BattleEnvironmentM.BuildScene();
            }
            else
            {
                BattleEnvironmentM.BuildScene();
                WndManager.GetDialog <CombatWnd>();
                CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>();
                if (wnd != null)
                {
                    wnd.SetWndMode(CombatInfoMode.combat);
                }
                if (CmCarbon.GetGodSkill(StageDC.GetPveMode() == PVEMode.Attack) != null)
                {
                    //船长技能设置
                    GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>();
                    if (gsw != null)
                    {
                        gsw.SetCurMana(CmCarbon.GetGodSkillMana(true));
                        gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana());
                    }
                }
                //
            }
        }
        else
        {
            WndManager.GetDialog <CombatWnd>();
            WndManager.GetDialog <CombatCountDownWnd>();
            CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>();
            if (wnd != null)
            {
                wnd.SetWndMode(CombatInfoMode.view);
            }
            BattleEnvironmentM.BuildScene();
        }
        BattleEnvironmentM.AddFireSoldierCompent();

        Screen.sleepTimeout    = SleepTimeout.NeverSleep;//prevent  phone from going to sleep
        m_oldUserInfo.Level    = UserDC.GetLevel();
        m_oldUserInfo.Physical = UserDC.GetPhysical();
    }
Exemple #26
0
    public override void WndStart()
    {
        base.WndStart();
        MyHead.BtnBackground.OnClickEventHandler += BtnBackground_OnClickEventHandler;
        MyHead.BtnNO.OnClickEventHandler         += BtnBackground_OnClickEventHandler;
        MyHead.BtnYes.OnClickEventHandler        += BtnYes_OnClickEventHandler;

        List <CaptionInfo> caplist = new List <CaptionInfo>();

        BlackScienceDC.GetCaptions(ref caplist, UserDC.GetLevel());
        LoadCapHeadList(caplist, MyHead.Parent);

        WndEffects.DoWndEffect(gameObject);
    }
Exemple #27
0
    public static bool CheckStarUp(CaptionInfo info)
    {
        GodSkillInfo Godskill  = info.GetGodSkillInfo();
        int          bookcount = ItemDC.GetItemCount(Godskill.m_needbook);

        if (UserDC.GetLevel() >= info.m_levelneed && Godskill.m_needbooknum > 0 && bookcount >= Godskill.m_needbooknum)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Exemple #28
0
    /*初始化时金币设置*/
    public void SetGold()
    {
        m_iCoin = UserDC.GetCoin();

        if (MyHead.OurResourceGold != null)
        {
            SetNum(m_iCoin, MyHead.OurResourceGold);
        }

        if (MyHead.EnemyResourceGold != null)
        {
            SetNum(CmCarbon.DefenderInfo.Coin, MyHead.EnemyResourceGold);
        }
    }
Exemple #29
0
    /// <summary>
    /// 设置剩余技能点数(点数已满)
    /// </summary>
    private void SetLeftSkillPoint(int point)
    {
        int    maxLeftSkillPoints = ConfigM.GetMaxLeftSkillPoints(UserDC.GetVIPLevel());
        string str = string.Format("[FF0000]{0}[-]/[FFFFFF]{1}[-]", point, maxLeftSkillPoints);

        if (m_wndType == 0)
        {
            MyHead.LblSkillPointsFull.text = str;
        }
        else if (m_wndType == 1)
        {
            MyHead.LblSkillPointsNotFull.text = str;
        }
    }
Exemple #30
0
    /// <summary>
    /// 确认能否升星
    /// </summary>
    private void GetNeedItem()
    {
        if (m_build == null)
        {
            return;
        }
        //获取升级需要的资源。
        int NeedCoin = 0;

        buildingM.GetUpLevelNeed(m_build.BuildType, m_build.Level + 1, ref m_NeedCoin, ref m_NeedWood);
        //获取已有的资源。
        m_HaveCoin = UserDC.GetCoin();
        m_HaveWood = UserDC.GetWood();
    }