Exemple #1
0
        public override bool SetVector3(NFVector3 value)
        {
            if (NFDataList.VARIANT_TYPE.VTYPE_VECTOR3 != mxData.GetType())
            {
                UnityEngine.Debug.LogError(this.msPropertyName + " is " + mxData.GetType().ToString() + " but you set type " + NFDataList.VARIANT_TYPE.VTYPE_VECTOR3.ToString());

                return(false);
            }

            if (mxData.Vector3Val() != value)
            {
                NFDataList.TData oldValue = new NFDataList.TData(mxData);
                NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR3);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Exemple #2
0
        public override bool SetVector3(int nRow, int nCol, NFVector3 value)
        {
            if (nRow >= 0 && nRow < mnRow)
            {
                if (!mhtRecordVec.ContainsKey(nRow))
                {
                    AddRow(nRow);
                }
                NFDataList valueList = (NFDataList)mhtRecordVec[nRow];
                if (valueList.GetType(nCol) == NFDataList.VARIANT_TYPE.VTYPE_VECTOR3)
                {
                    if (valueList.Vector3Val(nCol) != value)
                    {
                        NFDataList.TData oldValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR3);
                        NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR3);

                        oldValue.Set(valueList.Vector3Val(nCol));
                        newValue.Set(value);

                        valueList.SetVector3(nCol, value);

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Update, nRow, nCol, oldValue, newValue);
                        }
                    }
                }

                return(true);
            }

            return(false);
        }
        private void EGMI_ACK_PROPERTY_FLOAT(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyFloat xData = NFMsg.ObjectPropertyFloat.Parser.ParseFrom(xMsg.MsgData);

            NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(xData.PlayerId));

            if (go == null)
            {
                return;
            }

            NFIPropertyManager propertyManager = go.GetPropertyManager();

            for (int i = 0; i < xData.PropertyList.Count; i++)
            {
                string name = xData.PropertyList[i].PropertyName.ToStringUtf8();
                float  data = xData.PropertyList[i].Data;

                NFIProperty property = propertyManager.GetProperty(name);
                if (null == property)
                {
                    NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_FLOAT);
                    property = propertyManager.AddProperty(name, var);
                }

                property.SetFloat(data);
            }
        }
        private void EGMI_ACK_PROPERTY_VECTOR3(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyVector3 xData = NFMsg.ObjectPropertyVector3.Parser.ParseFrom(xMsg.MsgData);

            NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(xData.PlayerId));

            if (go == null)
            {
                Debug.LogError("error id" + xData.PlayerId);
                return;
            }

            NFIPropertyManager propertyManager = go.GetPropertyManager();

            for (int i = 0; i < xData.PropertyList.Count; i++)
            {
                string        name = xData.PropertyList[i].PropertyName.ToStringUtf8();
                NFMsg.Vector3 data = xData.PropertyList[i].Data;

                NFIProperty property = propertyManager.GetProperty(name);
                if (null == property)
                {
                    NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR3);
                    property = propertyManager.AddProperty(name, var);
                }

                property.SetVector3(mHelpModule.PBToNF(data));
            }
        }
Exemple #5
0
        public override bool SetFloat(int nRow, int nCol, double value)
        {
            if (nRow >= 0 && nRow < mnRow)
            {
                if (!mhtRecordVec.ContainsKey(nRow))
                {
                    AddRow(nRow);
                }
                NFDataList valueList = (NFDataList)mhtRecordVec[nRow];
                if (valueList.GetType(nCol) == NFDataList.VARIANT_TYPE.VTYPE_FLOAT)
                {
                    if (valueList.FloatVal(nCol) - value > NFDataList.EPS_DOUBLE ||
                        valueList.FloatVal(nCol) - value < -NFDataList.EPS_DOUBLE)
                    {
                        NFDataList.TData oldValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_FLOAT);
                        NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_FLOAT);

                        oldValue.Set(valueList.FloatVal(nCol));
                        newValue.Set(value);

                        valueList.SetFloat(nCol, value);

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Update, nRow, nCol, oldValue, newValue);
                        }
                    }
                }

                return(true);
            }
            return(false);
        }
Exemple #6
0
        private void EGMI_ACK_PROPERTY_OBJECT(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyObject xData = NFMsg.ObjectPropertyObject.Parser.ParseFrom(xMsg.msg_data);

            NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(xData.player_id));

            if (go == null)
            {
                Debug.LogError("error id" + xData.player_id);
                return;
            }

            NFIPropertyManager propertyManager = go.GetPropertyManager();

            for (int i = 0; i < xData.property_list.Count; i++)
            {
                string      name = xData.property_list[i].property_name.ToStringUtf8();
                NFMsg.Ident data = xData.property_list[i].data;

                NFIProperty property = propertyManager.GetProperty(name);
                if (null == property)
                {
                    NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_OBJECT);
                    property = propertyManager.AddProperty(name, var);
                }

                property.SetObject(mHelpModule.PBToNF(data));
            }
        }
Exemple #7
0
        public override bool SetFloat(double value)
        {
            if (NFDataList.VARIANT_TYPE.VTYPE_FLOAT != mxData.GetType())
            {
                UnityEngine.Debug.LogError(this.msPropertyName + " is " + mxData.GetType().ToString() + " but you set type " + NFDataList.VARIANT_TYPE.VTYPE_FLOAT.ToString());

                return(false);
            }

            if (mxData.FloatVal() - value > NFDataList.EPS_DOUBLE ||
                mxData.FloatVal() - value < -NFDataList.EPS_DOUBLE)
            {
                NFDataList.TData oldValue = new NFDataList.TData(mxData);
                NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_FLOAT);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Exemple #8
0
 static void OnPropertydHandler(NFGUID self, string strProperty, NFDataList.TData oldVar, NFDataList.TData newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strProperty);
     Debug.Log(" ");
     Debug.Log(oldVar.IntVal());
     Debug.Log(" ");
     Debug.Log(newVar.IntVal());
     Debug.Log(" ");
 }
Exemple #9
0
 static void OnPropertydHandler(NFGUID self, string strProperty, NFDataList.TData oldVar, NFDataList.TData newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strProperty);
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.WriteLine(" ");
 }
Exemple #10
0
        public override NFIProperty AddProperty(string strPropertyName, NFDataList.TData varData)
        {
            NFIProperty xProperty = null;

            if (!mhtProperty.ContainsKey(strPropertyName))
            {
                xProperty = new NFCProperty(mSelf, strPropertyName, varData);
                mhtProperty[strPropertyName] = xProperty;
            }

            return(xProperty);
        }
Exemple #11
0
        public void OnPropertyHandler(NFGUID self, string strPropertyName, NFDataList.TData oldVar, NFDataList.TData newVar)
        {
            NFIObject   xObject   = NFCKernelModule.Instance.GetObject(self);
            NFIProperty xProperty = xObject.GetPropertyManager().GetProperty(strPropertyName);

            if (!xProperty.GetUpload())
            {
                return;
            }

            switch (oldVar.GetType())
            {
            case NFDataList.VARIANT_TYPE.VTYPE_INT:
            {
                NFNetController.Instance.mxNetSender.RequirePropertyInt(self, strPropertyName, newVar);
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
            {
                NFNetController.Instance.mxNetSender.RequirePropertyFloat(self, strPropertyName, newVar);
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_STRING:
            {
                NFNetController.Instance.mxNetSender.RequirePropertyString(self, strPropertyName, newVar);
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
            {
                NFNetController.Instance.mxNetSender.RequirePropertyObject(self, strPropertyName, newVar);
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
            {
                NFNetController.Instance.mxNetSender.RequirePropertyVector2(self, strPropertyName, newVar);
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
            {
                NFNetController.Instance.mxNetSender.RequirePropertyVector3(self, strPropertyName, newVar);
            }
            break;
            }
        }
Exemple #12
0
        public override bool SetVector3(NFVector3 value)
        {
            if (mxData.Vector3Val() != value)
            {
                NFDataList.TData oldValue = new NFDataList.TData(mxData);
                NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR3);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Exemple #13
0
        public override bool SetObject(NFGUID value)
        {
            if (mxData.ObjectVal() != value)
            {
                NFDataList.TData oldValue = new NFDataList.TData(mxData);
                NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_OBJECT);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Exemple #14
0
        public override bool SetString(string value)
        {
            if (mxData.StringVal() != value)
            {
                NFDataList.TData oldValue = new NFDataList.TData(mxData);
                NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_STRING);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Exemple #15
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;
            }
        }
Exemple #16
0
        public override bool SetFloat(double value)
        {
            if (mxData.FloatVal() - value > NFDataList.EPS_DOUBLE ||
                mxData.FloatVal() - value < -NFDataList.EPS_DOUBLE)
            {
                NFDataList.TData oldValue = new NFDataList.TData(mxData);
                NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_FLOAT);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Exemple #17
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);
        }
Exemple #18
0
        public NFCProperty(NFGUID self, string strPropertyName, NFDataList varData)
        {
            mSelf          = self;
            msPropertyName = strPropertyName;
            mxData         = new NFDataList.TData(varData.GetType(0));

            switch (varData.GetType(0))
            {
            case NFDataList.VARIANT_TYPE.VTYPE_INT:
                mxData.Set(varData.IntVal(0));
                break;

            case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                mxData.Set(varData.FloatVal(0));
                break;

            case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                mxData.Set(varData.ObjectVal(0));
                break;

            case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                mxData.Set(varData.StringVal(0));
                break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                mxData.Set(varData.Vector2Val(0));
                break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                mxData.Set(varData.Vector3Val(0));
                break;

            default:
                break;
            }
        }
Exemple #19
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);
        }
Exemple #20
0
        public void RequireRecordObject(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
            xData.PlayerId   = mHelpModule.NFToPB(objectID);
            xData.RecordName = ByteString.CopyFromUtf8(strRecordName);

            NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
            xData.PropertyList.Add(xRecordObject);
            xRecordObject.Row  = nRow;
            xRecordObject.Col  = nCol;
            xRecordObject.Data = mHelpModule.NFToPB(newVar.ObjectVal());

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

            Debug.Log("send upload record object");
            SendMsg((int)NFMsg.EGameMsgID.AckRecordObject, mxBody);
        }
Exemple #21
0
 public abstract bool SetData(NFDataList.TData x);
Exemple #22
0
        public void OnRecordHandler(NFGUID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFDataList.TData oldVar, NFDataList.TData newVar)
        {
            NFIObject xObject = NFCKernelModule.Instance.GetObject(self);
            NFIRecord xRecord = xObject.GetRecordManager().GetRecord(strRecordName);

            if (!xRecord.GetUpload())
            {
                return;
            }

            switch (eType)
            {
            case NFIRecord.eRecordOptype.Add:
            {
                NFNetController.Instance.mxNetSender.RequireAddRow(self, strRecordName, nRow);
            }
            break;

            case NFIRecord.eRecordOptype.Del:
            {
                NFNetController.Instance.mxNetSender.RequireRemoveRow(self, strRecordName, nRow);
            }
            break;

            case NFIRecord.eRecordOptype.Swap:
            {
                NFNetController.Instance.mxNetSender.RequireSwapRow(self, strRecordName, nRow, nCol);
            }
            break;

            case NFIRecord.eRecordOptype.Update:
            {
                switch (oldVar.GetType())
                {
                case NFDataList.VARIANT_TYPE.VTYPE_INT:
                {
                    NFNetController.Instance.mxNetSender.RequireRecordInt(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                {
                    NFNetController.Instance.mxNetSender.RequireRecordFloat(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                {
                    NFNetController.Instance.mxNetSender.RequireRecordString(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                {
                    NFNetController.Instance.mxNetSender.RequireRecordObject(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                {
                    NFNetController.Instance.mxNetSender.RequireRecordVector2(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                {
                    NFNetController.Instance.mxNetSender.RequireRecordVector3(self, strRecordName, nRow, nCol, newVar);
                }
                break;
                }
            }
            break;
            }
        }
        private void AttachObjectData(NFGUID self)
        {
            //Debug.Log ("AttachObjectData : " + self.ToString () );

            ObjectDataBuff xDataBuff;

            if (mxObjectDataBuff.TryGetValue(self, out xDataBuff))
            {
                ////////////////record
                if (xDataBuff.xRecordList != null)
                {
                    for (int j = 0; j < xDataBuff.xRecordList.RecordList.Count; j++)
                    {
                        NFMsg.ObjectRecordBase xObjectRecordBase = xDataBuff.xRecordList.RecordList[j];
                        string srRecordName = xObjectRecordBase.RecordName.ToStringUtf8();

                        for (int k = 0; k < xObjectRecordBase.RowStruct.Count; ++k)
                        {
                            NFMsg.RecordAddRowStruct xAddRowStruct = xObjectRecordBase.RowStruct[k];

                            ADD_ROW(self, xObjectRecordBase.RecordName.ToStringUtf8(), xAddRowStruct);
                        }
                    }

                    xDataBuff.xRecordList = null;
                }
                ////////////////property
                if (xDataBuff.xPropertyList != null)
                {
                    ///
                    NFIObject          go = mKernelModule.GetObject(mHelpModule.PBToNF(xDataBuff.xPropertyList.PlayerId));
                    NFIPropertyManager xPropertyManager = go.GetPropertyManager();

                    for (int j = 0; j < xDataBuff.xPropertyList.PropertyIntList.Count; j++)
                    {
                        string      strPropertyName = xDataBuff.xPropertyList.PropertyIntList[j].PropertyName.ToStringUtf8();
                        NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                        if (null == xProperty)
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_INT);
                            xProperty = xPropertyManager.AddProperty(strPropertyName, var);
                        }

                        //string className = mKernelModule.QueryPropertyString(self, NFrame.IObject.ClassName);
                        //Debug.LogError (self.ToString() + " " + className + " " + strPropertyName + " : " + xDataBuff.xPropertyList.property_int_list[j].Data);

                        xProperty.SetInt(xDataBuff.xPropertyList.PropertyIntList[j].Data);
                    }

                    for (int j = 0; j < xDataBuff.xPropertyList.PropertyFloatList.Count; j++)
                    {
                        string      strPropertyName = xDataBuff.xPropertyList.PropertyFloatList[j].PropertyName.ToStringUtf8();
                        NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                        if (null == xProperty)
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_FLOAT);
                            xProperty = xPropertyManager.AddProperty(strPropertyName, var);
                        }

                        xProperty.SetFloat(xDataBuff.xPropertyList.PropertyFloatList[j].Data);
                    }

                    for (int j = 0; j < xDataBuff.xPropertyList.PropertyStringList.Count; j++)
                    {
                        string      strPropertyName = xDataBuff.xPropertyList.PropertyStringList[j].PropertyName.ToStringUtf8();
                        NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                        if (null == xProperty)
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_STRING);
                            xProperty = xPropertyManager.AddProperty(strPropertyName, var);
                        }

                        //string className = mKernelModule.QueryPropertyString(self, NFrame.IObject.ClassName);
                        //Debug.LogError(self.ToString() + " " + className + " " + strPropertyName + " : " + xDataBuff.xPropertyList.property_string_list[j].Data.ToStringUtf8());

                        xProperty.SetString(xDataBuff.xPropertyList.PropertyStringList[j].Data.ToStringUtf8());
                    }

                    for (int j = 0; j < xDataBuff.xPropertyList.PropertyObjectList.Count; j++)
                    {
                        string      strPropertyName = xDataBuff.xPropertyList.PropertyObjectList[j].PropertyName.ToStringUtf8();
                        NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                        if (null == xProperty)
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_OBJECT);
                            xProperty = xPropertyManager.AddProperty(strPropertyName, var);
                        }

                        xProperty.SetObject(mHelpModule.PBToNF(xDataBuff.xPropertyList.PropertyObjectList[j].Data));
                    }

                    for (int j = 0; j < xDataBuff.xPropertyList.PropertyVector2List.Count; j++)
                    {
                        string      strPropertyName = xDataBuff.xPropertyList.PropertyVector2List[j].PropertyName.ToStringUtf8();
                        NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                        if (null == xProperty)
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR2);

                            xProperty = xPropertyManager.AddProperty(strPropertyName, var);
                        }

                        xProperty.SetVector2(mHelpModule.PBToNF(xDataBuff.xPropertyList.PropertyVector2List[j].Data));
                    }

                    for (int j = 0; j < xDataBuff.xPropertyList.PropertyVector3List.Count; j++)
                    {
                        string      strPropertyName = xDataBuff.xPropertyList.PropertyVector3List[j].PropertyName.ToStringUtf8();
                        NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                        if (null == xProperty)
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR3);

                            xProperty = xPropertyManager.AddProperty(strPropertyName, var);
                        }

                        xProperty.SetVector3(mHelpModule.PBToNF(xDataBuff.xPropertyList.PropertyVector3List[j].Data));
                    }


                    xDataBuff.xPropertyList = null;
                }
            }
        }
Exemple #24
0
        ////////////////////////////////////修改自身属性
        public void RequirePropertyInt(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyInt xData = new NFMsg.ObjectPropertyInt();
            xData.player_id = NFNetController.NFToPB(objectID);

            NFMsg.PropertyInt xPropertyInt = new NFMsg.PropertyInt();
            xPropertyInt.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
            xPropertyInt.data          = newVar.IntVal();
            xData.property_list.Add(xPropertyInt);

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

            Debug.Log("send upload int");
            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_INT, mxBody);
        }
Exemple #25
0
        public void RequirePropertyString(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyString xData = new NFMsg.ObjectPropertyString();
            xData.player_id = NFNetController.NFToPB(objectID);

            NFMsg.PropertyString xPropertyString = new NFMsg.PropertyString();
            xPropertyString.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
            xPropertyString.data          = System.Text.Encoding.Default.GetBytes(newVar.StringVal());
            xData.property_list.Add(xPropertyString);

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

            Debug.Log("send upload String");
            NFNetController.Instance.mxNetSender.SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_STRING, mxBody);
        }
Exemple #26
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);
        }
Exemple #27
0
        public void RequireRecordObject(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
            xData.player_id   = NFNetController.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 = NFNetController.NFToPB(newVar.ObjectVal());

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

            Debug.Log("send upload record object");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_OBJECT, mxBody);
        }
Exemple #28
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);
        }
Exemple #29
0
 public NFCProperty(NFGUID self, string strPropertyName, NFDataList.TData varData)
 {
     mSelf          = self;
     msPropertyName = strPropertyName;
     mxData         = new NFDataList.TData(varData);
 }
Exemple #30
0
 static void OnRecordEventHandler(NFGUID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFDataList.TData oldVar, NFDataList.TData newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strRecordName);
     Console.Write(" ");
     Console.Write(eType.ToString());
     Console.Write(" ");
     Console.Write(nRow);
     Console.Write(" ");
     Console.Write(nCol);
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.WriteLine(" ");
 }