コード例 #1
0
        public uint Execute(PacketDistributed ipacket)
        {
            CG_BELLE_REST packet = (CG_BELLE_REST )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
コード例 #2
0
    public void SelectRoleToMatrix(int belleID, bool isMatrix)
    {
        m_myBelleWindow.gameObject.SetActive(false);
        int curMatrixID = -1;

        if (null != BelleMatrixWindow.Instance())
        {
            curMatrixID = Int32.Parse(BelleMatrixWindow.Instance().CurSelectMatrix.gameObject.name);
        }
        #region//此段逻辑暂时只在客户端有,提醒服务器添加
        Belle belle; BelleMatrix bellematrix;
        if (BelleData.OwnedBelleMap.TryGetValue(belleID, out belle) && BelleData.OwnedMatrixMap.TryGetValue(belle.matrixID, out bellematrix) && bellematrix.isActive)
        {
            Tab_BelleMatrix tbm = TableManager.GetBelleMatrixByID(bellematrix.id, 0);
            if (tbm != null)
            {
                if (isMatrix)
                {
                    GUIData.AddNotifyData2Client(false, "#{11328}", tbm.Name);
                }
                else
                {
                    GUIData.AddNotifyData2Client(false, "#{11327}", tbm.Name);
                }
            }
            return;
        }
        #endregion
        //如果在当前阵上阵上,就下阵,不在当前阵上就上阵
        if (isMatrix)
        {
            CG_BELLE_REST restRequest = (CG_BELLE_REST)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BELLE_REST);
            restRequest.SetBelleID(belleID);
            restRequest.SendPacket();
        }
        else
        {
            CG_BELLE_BATTLE battleRequest = (CG_BELLE_BATTLE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BELLE_BATTLE);
            battleRequest.SetBelleID(belleID);
            battleRequest.SetMatrixID(curMatrixID);
            battleRequest.SetMatrixIndex(this.m_curMatrixIndex);
            battleRequest.SendPacket();
        }
    }