예제 #1
0
        public void RequireRecordVector3(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordVector3 xData = new NFMsg.ObjectRecordVector3();
            xData.PlayerId   = mHelpModule.NFToPB(objectID);
            xData.RecordName = ByteString.CopyFromUtf8(strRecordName);

            NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3();
            xRecordVector.Row  = nRow;
            xRecordVector.Col  = nCol;
            xRecordVector.Data = mHelpModule.NFToPB(newVar.Vector3Val());

            mxBody.SetLength(0);
            xData.WriteTo(mxBody);

            SendMsg((int)NFMsg.EGameMsgID.AckRecordVector3, mxBody);
        }
예제 #2
0
        public void RequireRecordVector3(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordVector3 xData = new NFMsg.ObjectRecordVector3();
            xData.player_id   = NFNetController.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 = NFNetController.NFToPB(newVar.Vector3Val());

            mxBody.SetLength(0);
            mxSerializer.Serialize(mxBody, xData);

            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_VECTOR3, mxBody);
        }
예제 #3
0
        public void RequirePropertyVector3(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyVector3 xData = new NFMsg.ObjectPropertyVector3();
            xData.player_id = NFNetController.NFToPB(objectID);

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

            mxBody.SetLength(0);
            mxSerializer.Serialize(mxBody, xData);


            NFNetController.Instance.mxNetSender.SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_VECTOR3, mxBody);
        }
예제 #4
0
        private void OnPropertyDataHandler(NFGUID self, string strProperty, NFDataList.TData oldVar, NFDataList.TData newVar)
        {
            switch (newVar.GetType())
            {
            case NFDataList.VARIANT_TYPE.VTYPE_INT:
            {
                mNetModule.RequirePropertyInt(self, strProperty, newVar.IntVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
            {
                mNetModule.RequirePropertyFloat(self, strProperty, newVar.FloatVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_STRING:
            {
                mNetModule.RequirePropertyString(self, strProperty, newVar.StringVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
            {
                mNetModule.RequirePropertyObject(self, strProperty, newVar.ObjectVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
            {
                mNetModule.RequirePropertyVector2(self, strProperty, newVar.Vector2Val());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
            {
                mNetModule.RequirePropertyVector3(self, strProperty, newVar.Vector3Val());
            }
            break;

            default:
                break;
            }
        }
예제 #5
0
        public override bool SetData(NFDataList.TData x)
        {
            if (NFDataList.VARIANT_TYPE.VTYPE_UNKNOWN == mxData.GetType() ||
                x.GetType() == mxData.GetType())
            {
                switch (mxData.GetType())
                {
                case NFDataList.VARIANT_TYPE.VTYPE_INT:
                    SetInt(x.IntVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                    SetString(x.StringVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                    SetFloat(x.FloatVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                    SetObject(x.ObjectVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                    SetVector2(x.Vector2Val());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                    SetVector3(x.Vector3Val());
                    break;

                default:
                    break;
                }

                return(true);
            }

            return(false);
        }