Exemple #1
0
    public void EndBattle(bool isWin, int restHp)
    {
        playerCtrlWnd.SetWndState(false);
        GameRoot.Instance.dynamicWnd.RmvAllHpItemInfo();

        if (isWin == true)
        {
            double endFightTime = timerSvc.GetNowTime();
            // 发送数据到服务器结算
            GameMsg gameMsg = new GameMsg {
                cmd           = (int)CMD.ReqFBFightEnd,
                reqFBFightEnd = new ReqFBFightEnd {
                    fbId     = fbid,
                    win      = isWin,
                    resthp   = restHp,
                    costtime = (int)(endFightTime - startFightTime)
                }
            };

            netSvc.SendMsg(gameMsg);
        }
        else
        {
            SetBattleEndWndState(FBEndType.Lose);
        }
    }
Exemple #2
0
    public void EndBattle(bool isWin, int restHP)
    {
        playerCtrlWnd.SetWndState(false);
        GameRoot.Instance.dynamicWnd.RemoveAllHpItemInfo();

        if (isWin)
        {
            double endTime = timerSvc.GetNowTime();
            //发送结算战斗请求
            GameMsg msg = new GameMsg {
                cmd           = (int)CMD.ReqFBFightEnd,
                reqFBFightEnd = new ReqFBFightEnd {
                    win      = isWin,
                    fbid     = fbid,
                    resthp   = restHP,
                    costtime = (int)((endTime - startTime) / 1000),
                }
            };

            netSvc.SendMsg(msg);
        }
        else
        {
            SetBattleEndWndState(FBEndType.Lose);
        }
    }
Exemple #3
0
 public void SetPlayerCtrlWnd(bool isActive = true)
 {
     playerCtrlWnd.SetWndState(isActive);
 }