GetCurrentPtichID() public method

public GetCurrentPtichID ( ) : int
return int
Beispiel #1
0
        //收摊
        //bSendData 是否回发收摊数据- 玩家下线就不发
        public void ShutPtich(PlayerObject play, bool bSendData = true)
        {
            if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_PTICH) == null) return;
            uint ptich_obj_id = GetPtichObjectTypeID(play.GetCurrentPtichID());
            if (ptich_obj_id == 0) return;

            for (int i = 0; i < mListPtichInfo[play.GetCurrentPtichID()].mSellItemList.Count; i++)
            {
                 GameStruct.RoleItemInfo item = null;
                 if (mListPtichInfo[play.GetCurrentPtichID()].mSellItemList[i].item_id >= IDManager.eudemon_start_id)
                 {
                     RoleData_Eudemon eudemon = play.GetEudemonSystem().FindEudemon(
                         mListPtichInfo[play.GetCurrentPtichID()].mSellItemList[i].item_id);
                     if (eudemon == null) continue;
                     item = play.GetItemSystem().FindItem(eudemon.itemid);

                 }
                 else
                 {
                     item = play.GetItemSystem().FindItem(
                  mListPtichInfo[play.GetCurrentPtichID()].mSellItemList[i].item_id);
                 }

                if (item != null)
                {
                    //放回到包裹
                    //放回到包裹或幻兽背包
                    if (item.typeid >= IDManager.eudemon_start_id)
                    {
                        item.postion = NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK;

                    }
                    else
                    {
                        item.postion = NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK;
                    }

                    if (bSendData)
                    {
                        PacketOut outpack = new PacketOut();
                        outpack.WriteInt16(28);
                        outpack.WriteInt16(1009);
                        outpack.WriteUInt32(item.id);
                        outpack.WriteUInt32(ptich_obj_id);
                        outpack.WriteInt32((byte)NetMsg.MsgOperateItem.PTICH_GETBACK_SELLITEM);
                        outpack.WriteInt32(0);
                        outpack.WriteInt32(0);
                        outpack.WriteInt32(0);
                        play.SendData(outpack.Flush(), true);
                    }
                }
            }
            mListPtichInfo[play.GetCurrentPtichID()].play = null;
            //移除地图对象
            play.GetGameMap().RemoveObj(mListPtichInfo[play.GetCurrentPtichID()].PtichObj);
            mListPtichInfo[play.GetCurrentPtichID()].PtichObj = null;
            mListPtichInfo[play.GetCurrentPtichID()].mSellItemList.Clear();
            if (bSendData)
            {
                PacketOut outpack = new PacketOut();
                outpack.WriteInt16(16);
                outpack.WriteInt16(2031);
                outpack.WriteUInt32(ptich_obj_id);
                outpack.WriteUInt32(play.GetTypeId());
                outpack.WriteInt32(2);
                play.SendData(outpack.Flush(), true);
            }
            //移除摆摊状态
            play.GetTimerSystem().DeleteStatus(GameStruct.RoleStatus.STATUS_PTICH);
        }
Beispiel #2
0
        //摊位取回道具
        public void GetBackItem(PlayerObject play, uint item_id)
        {
            if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_PTICH) == null) return;
            uint ptich_obj_id = GetPtichObjectTypeID(play.GetCurrentPtichID());
            GameStruct.RoleItemInfo item = null;
            if (ptich_obj_id == 0) return;
            if (item_id >= IDManager.eudemon_start_id)
            {

                RoleData_Eudemon eudemon = play.GetEudemonSystem().FindEudemon(item_id);
                if (eudemon == null) return;
                item = play.GetItemSystem().FindItem(eudemon.itemid);
                if (item == null) return;
            }
            else
            {
                item = play.GetItemSystem().FindItem(item_id);
                if (item == null) return;
            }

            int nPtichId = play.GetCurrentPtichID();
            for (int i = 0; i < mListPtichInfo[nPtichId].mSellItemList.Count; i++)
            {
                if (mListPtichInfo[nPtichId].mSellItemList[i].item_id == item_id)
                {
                    mListPtichInfo[nPtichId].mSellItemList.RemoveAt(i);
                    break;
                }
            }
            //放回到包裹或幻兽背包
            if (item_id >= IDManager.eudemon_start_id)
            {
                item.postion = NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK;

            }
            else
            {
                item.postion = NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK;
            }

            PacketOut outpack = new PacketOut();
            outpack.WriteInt16(28);
            outpack.WriteInt16(1009);
            outpack.WriteUInt32(item_id);
            outpack.WriteUInt32(ptich_obj_id);
            outpack.WriteInt32((byte)NetMsg.MsgOperateItem.PTICH_GETBACK_SELLITEM);
            outpack.WriteInt32(0);
            outpack.WriteInt32(0);
            outpack.WriteInt32(0);
            play.SendData(outpack.Flush(), true);
        }
Beispiel #3
0
        //摊位出售道具
        public void SellItem(PlayerObject play, uint item_id, byte type, int price)
        {
            if (play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_PTICH) == null) return;
            uint ptich_obj_id = GetPtichObjectTypeID(play.GetCurrentPtichID());
            GameStruct.RoleItemInfo item = null;
            if (ptich_obj_id == 0) return;
            if (item_id >= IDManager.eudemon_start_id)
            {

                RoleData_Eudemon eudemon = play.GetEudemonSystem().FindEudemon(item_id);
                if (eudemon == null) return;
                item = play.GetItemSystem().FindItem(eudemon.itemid);
                if (item == null) return;
            }
            else
            {
                item = play.GetItemSystem().FindItem(item_id);
                if (item == null) return;
            }

            if (ptich_obj_id == 0) return;
            //判断是否已经在出售摊位列表中- 反作弊
            int nPtichId = play.GetCurrentPtichID();
            for (int i = 0; i < mListPtichInfo[nPtichId].mSellItemList.Count; i++)
            {
                if (mListPtichInfo[nPtichId].mSellItemList[i].item_id == item_id)
                {
                    return;
                }
            }
            //摆摊出售道具已满
            if (mListPtichInfo[nPtichId].mSellItemList.Count >= GameBase.Config.Define.PTICH_SELL_MAX_COUNT)
            {
                return;
            }
            PacketOut outpack = new PacketOut();
            outpack.WriteInt16(28);
            outpack.WriteInt16(1009);
            outpack.WriteUInt32(item_id);
            outpack.WriteInt32(price);
            outpack.WriteInt32(type);
            outpack.WriteInt32(0);
            outpack.WriteInt32(0);
            outpack.WriteInt32(0);
            play.SendData(outpack.Flush(), true);
            //移到摊位状态
            item.postion = NetMsg.MsgItemInfo.ITEMPOSTION_PTICH_PACK;

            PtichSellItemInfo info = new PtichSellItemInfo();
            info.item_id = item_id;
            info.price = price;
            info.sell_type = type;
            mListPtichInfo[nPtichId].mSellItemList.Add(info);
            // {28,0,241,3,8,127,205,7,111,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
        }
Beispiel #4
0
 public PtichObject(PlayerObject Play)
 {
     type = OBJECTTYPE.PTICH;
     mPlay = Play;
     typeid = (uint)(107000 + mPlay.GetCurrentPtichID());
 }