public void RequireUseItem(NFrame.NFGUID objectID, string strItemID, NFrame.NFGUID nTargetID) { NFMsg.ReqAckUseItem xData = new NFMsg.ReqAckUseItem(); xData.user = NFNetController.NFToPB(objectID); xData.item_guid = new NFMsg.Ident(); xData.item = new ItemStruct(); xData.item.item_id = strItemID; xData.item.item_count = 1; xData.targetid = (NFNetController.NFToPB(nTargetID)); mxBody.SetLength(0); mxSerializer.Serialize(mxBody, xData); SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_ITEM_OBJECT, mxBody); }
public void RequireUseItem(NFrame.NFGUID objectID, string strItemID, NFrame.NFGUID nTargetID, UnityEngine.Vector3 pos) { NFMsg.ReqAckUseItem xData = new NFMsg.ReqAckUseItem(); xData.user = NFNetController.NFToPB(objectID); xData.item_guid = new NFMsg.Ident(); xData.item = new ItemStruct(); xData.item.item_id = UnicodeEncoding.Default.GetBytes(strItemID); xData.item.item_count = 1; xData.targetid = (NFNetController.NFToPB(nTargetID)); xData.position = (NFNetController.NFToPB(new NFVector3(pos.x, pos.y, pos.z))); mxBody.SetLength(0); mxSerializer.Serialize(mxBody, xData); SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_ITEM_OBJECT, mxBody); }