NFToPB() static public method

static public NFToPB ( NFrame xID ) : Ident
xID NFrame
return NFMsg.Ident
    public void RequireRemoveRow(NFrame.NFGUID self, string strRecordName, int nRow)
    {
        NFMsg.ObjectRecordRemove xData = new NFMsg.ObjectRecordRemove();
        xData.player_id   = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);
        xData.remove_row.Add(nRow);

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordRemove>(stream, xData);
        Debug.Log("send upload record removeRow");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_REMOVE_ROW, stream);
    }
    public void RequireSwapRow(NFrame.NFGUID self, string strRecordName, int nOriginRow, int nTargetRow)
    {
        NFMsg.ObjectRecordSwap xData = new NFMsg.ObjectRecordSwap();
        xData.player_id          = NFBinarySendLogic.NFToPB(self);
        xData.origin_record_name = System.Text.Encoding.Default.GetBytes(strRecordName);
        xData.target_record_name = System.Text.Encoding.Default.GetBytes(strRecordName);
        xData.row_origin         = nOriginRow;
        xData.row_target         = nTargetRow;

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordSwap>(stream, xData);
        Debug.Log("send upload record swapRow");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_SWAP_ROW, stream);
    }
    public void RequireRecordVector3(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFIDataList.TData newVar)
    {
        NFMsg.ObjectRecordVector3 xData = new NFMsg.ObjectRecordVector3();
        xData.player_id   = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

        NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3();
        xRecordVector.row  = nRow;
        xRecordVector.col  = nCol;
        xRecordVector.data = NFBinarySendLogic.NFToPB(newVar.Vector3Val());

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordVector3>(stream, xData);
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_VECTOR3, stream);
    }
    public void RequirePropertyVector3(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyVector3 xData = new NFMsg.ObjectPropertyVector3();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyVector3 xProperty = new NFMsg.PropertyVector3();
        xProperty.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xProperty.data          = NFBinarySendLogic.NFToPB(newVar.Vector3Val());
        xData.property_list.Add(xProperty);

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectPropertyVector3>(stream, xData);

        NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_VECTOR3, stream);
    }
    public void RequirePropertyObject(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyObject xData = new NFMsg.ObjectPropertyObject();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyObject xPropertyObject = new NFMsg.PropertyObject();
        xPropertyObject.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xPropertyObject.data          = NFBinarySendLogic.NFToPB(newVar.ObjectVal());
        xData.property_list.Add(xPropertyObject);

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectPropertyObject>(stream, xData);
        Debug.Log("send upload Object");
        NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_OBJECT, stream);
    }
    public void RequireRecordObject(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFIDataList.TData newVar)
    {
        NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
        xData.player_id   = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

        NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
        xData.property_list.Add(xRecordObject);
        xRecordObject.row  = nRow;
        xRecordObject.col  = nCol;
        xRecordObject.data = NFBinarySendLogic.NFToPB(newVar.ObjectVal());

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordObject>(stream, xData);
        Debug.Log("send upload record object");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_OBJECT, stream);
    }
    public void RequireAddRow(NFrame.NFGUID self, string strRecordName, int nRow)
    {
        NFMsg.ObjectRecordAddRow xData = new NFMsg.ObjectRecordAddRow();
        xData.player_id   = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

        NFMsg.RecordAddRowStruct xRecordAddRowStruct = new NFMsg.RecordAddRowStruct();
        xData.row_data.Add(xRecordAddRowStruct);
        xRecordAddRowStruct.row = nRow;

        NFIObject   xObject  = NFCKernelModule.Instance.GetObject(self);
        NFIRecord   xRecord  = xObject.GetRecordManager().GetRecord(strRecordName);
        NFIDataList xRowData = xRecord.QueryRow(nRow);

        for (int i = 0; i < xRowData.Count(); i++)
        {
            switch (xRowData.GetType(i))
            {
            case NFIDataList.VARIANT_TYPE.VTYPE_INT:
            {
                NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
                xRecordInt.row  = nRow;
                xRecordInt.col  = i;
                xRecordInt.data = xRowData.IntVal(i);
                xRecordAddRowStruct.record_int_list.Add(xRecordInt);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
            {
                NFMsg.RecordFloat xRecordFloat = new NFMsg.RecordFloat();
                xRecordFloat.row  = nRow;
                xRecordFloat.col  = i;
                xRecordFloat.data = (float)xRowData.FloatVal(i);
                xRecordAddRowStruct.record_float_list.Add(xRecordFloat);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
            {
                NFMsg.RecordString xRecordString = new NFMsg.RecordString();
                xRecordString.row  = nRow;
                xRecordString.col  = i;
                xRecordString.data = System.Text.Encoding.Default.GetBytes(xRowData.StringVal(i));
                xRecordAddRowStruct.record_string_list.Add(xRecordString);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
            {
                NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
                xRecordObject.row  = nRow;
                xRecordObject.col  = i;
                xRecordObject.data = NFBinarySendLogic.NFToPB(xRowData.ObjectVal(i));
                xRecordAddRowStruct.record_object_list.Add(xRecordObject);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2:
            {
                NFMsg.RecordVector2 xRecordVector = new NFMsg.RecordVector2();
                xRecordVector.row  = nRow;
                xRecordVector.col  = i;
                xRecordVector.data = NFBinarySendLogic.NFToPB(xRowData.Vector2Val(i));
                xRecordAddRowStruct.record_vector2_list.Add(xRecordVector);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3:
            {
                NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3();
                xRecordVector.row  = nRow;
                xRecordVector.col  = i;
                xRecordVector.data = NFBinarySendLogic.NFToPB(xRowData.Vector3Val(i));
                xRecordAddRowStruct.record_vector3_list.Add(xRecordVector);
            }
            break;
            }
        }

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordAddRow>(stream, xData);
        Debug.Log("send upload record addRow");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_ADD_ROW, stream);
    }