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

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
コード例 #2
0
    void MsgBoxBuyGuildItemOK(int nCurNum)
    {
        //nCurNum数量判断
        if (nCurNum < 1 || nCurNum > m_LeftCount)
        {
            return;
        }

        //判断帮会GUID
        if (false == GameManager.gameManager.PlayerDataPool.IsHaveGuild())
        {
            return;
        }

        //背包判断
        if (GameManager.gameManager.PlayerDataPool.BackPack.GetCanContainerSize() <= 0)
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{1903}");

            return;
        }

        //判断个人公会积分是否够
        int nRealCost = m_nPrice * nCurNum;

        if (nRealCost > 0)
        {
            int nGuildDKP = GameManager.gameManager.PlayerDataPool.GuildDKP;
            if (nRealCost > nGuildDKP)
            {
                //个人公会积分,返回
                GUIData.AddNotifyData("#{2465}");
                return;
            }
        }
        else
        {
            //可能溢出,直接返回
            return;
        }

        //发送购买消息包
        CG_BUY_GUILDGOODS msg = (CG_BUY_GUILDGOODS)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BUY_GUILDGOODS);

        msg.GoodID    = m_GoodsId;
        msg.BuyNum    = nCurNum;
        msg.GoodIndex = m_GoodsIndex;
        msg.SendPacket();
    }