Beispiel #1
0
        public void ProcessDeleteRoleData_Item(byte[] data)
        {
            GameBase.Network.Internal.DeleteItemByID info = new GameBase.Network.Internal.DeleteItemByID();
            info.Create(data);
            if (!Data.DeleteRoleData_Item(info.playerid, info.id))
            {
                Log.Instance().WriteLog("删除角色物品信息失败,角色id:" + info.playerid.ToString());
            }
            const int EUDEMON_PACK = 53;//幻兽位置

            if (info.postion == EUDEMON_PACK)
            {
                Data.DeleteRoleData_Eudemon(info.playerid, info.id);
            }
        }
Beispiel #2
0
        //通过物品id删除一件道具
        public bool DeleteItemByID(uint id)
        {
            //幻兽id特殊处理
            uint _id = id;
            if (id >= IDManager.eudemon_start_id)
            {
                _id = GetEudemonItemId(id);

            }
            if (mDicItem.ContainsKey(_id))
            {
                GameStruct.RoleItemInfo info = mDicItem[_id];
                mDicItem.Remove(_id);
                //幻兽
                if (info.postion == NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK)
                {
                    play.GetEudemonSystem().DeleteEudemon(id);
                }
                else
                {
                    this.ClearItem(id);
                }

                //身上装备- 重新计算属性
                if (info.postion >= NetMsg.MsgItemInfo.ITEMPOSITION_ARMOR && info.postion <= NetMsg.MsgItemInfo.ITEMPOSTION_RUB_SHENGYAOFUWEN)
                {
                    if (info.postion == NetMsg.MsgItemInfo.ITEMPOSITION_ARMOR ||
                        info.postion == NetMsg.MsgItemInfo.ITEMPOSITION_WEAPONR)
                    {
                        CalcEquipLook(info);
                    }
                    play.CalcAttribute();

                }

                //发给数据库服务器,通知删除道具
                GameBase.Network.Internal.DeleteItemByID dbdata = new GameBase.Network.Internal.DeleteItemByID();
                dbdata.id = _id;
                dbdata.playerid = play.GetBaseAttr().player_id;
                dbdata.postion = info.postion;
                DBServer.Instance().GetDBClient().SendData(dbdata.GetBuffer());
                return true;
            }
            return false;
        }