예제 #1
0
        private void OnClassPlayerEventHandler(NFGUID self, int nContainerID, int nGroupID, NFIObject.CLASS_EVENT_TYPE eType, string strClassName, string strConfigIndex)
        {
            if (eType == NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE_FINISH)
            {
                NFIClass           classObject     = mClassModule.GetElement(strClassName);
                NFIPropertyManager propertyManager = classObject.GetPropertyManager();
                NFIRecordManager   recordManager   = classObject.GetRecordManager();

                NFDataList propertyList = propertyManager.GetPropertyList();
                NFDataList recordList   = recordManager.GetRecordList();

                for (int i = 0; i < propertyList.Count(); ++i)
                {
                    NFIProperty propertyObject = propertyManager.GetProperty(propertyList.StringVal(i));
                    if (propertyObject.GetUpload())
                    {
                        mKernelModule.RegisterPropertyCallback(self, propertyObject.GetKey(), OnPropertyDataHandler);
                    }
                }

                for (int i = 0; i < recordList.Count(); ++i)
                {
                    NFIRecord recordObject = recordManager.GetRecord(recordList.StringVal(i));
                    if (recordObject.GetUpload())
                    {
                        mKernelModule.RegisterRecordCallback(self, recordObject.GetName(), RecordEventHandler);
                    }
                }
            }
        }
예제 #2
0
        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));
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        public void OnClassHandler(NFGUID self, int nContainerID, int nGroupID, NFIObject.CLASS_EVENT_TYPE eType, string strClassName, string strConfigIndex)
        {
            if (eType == NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE)
            {
                NFIObject xObject = NFCKernelModule.Instance.GetObject(self);

                NFIPropertyManager xPropertyManager  = xObject.GetPropertyManager();
                NFDataList         xPropertyNameList = xPropertyManager.GetPropertyList();
                for (int i = 0; i < xPropertyNameList.Count(); i++)
                {
                    string      strPropertyName = xPropertyNameList.StringVal(i);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (xProperty.GetUpload())
                    {
                        xProperty.RegisterCallback(OnPropertyHandler);
                    }
                }

                NFIRecordManager xRecordManager  = xObject.GetRecordManager();
                NFDataList       xRecordNameList = xRecordManager.GetRecordList();
                for (int i = 0; i < xRecordNameList.Count(); i++)
                {
                    string    strRecodeName = xRecordNameList.StringVal(i);
                    NFIRecord xRecord       = xRecordManager.GetRecord(strRecodeName);
                    if (xRecord.GetUpload())
                    {
                        xRecord.RegisterCallback(OnRecordHandler);
                    }
                }
            }
        }
예제 #5
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));
            }
        }
예제 #6
0
        private void EGMI_ACK_PROPERTY_VECTOR3(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectPropertyVector3 xData = new NFMsg.ObjectPropertyVector3();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectPropertyVector3)) as NFMsg.ObjectPropertyVector3;

            NFIObject go = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xData.player_id));

            if (go == null)
            {
                return;
            }

            for (int i = 0; i < xData.property_list.Count; i++)
            {
                NFIPropertyManager propertyManager = go.GetPropertyManager();
                NFIProperty        property        = propertyManager.GetProperty(System.Text.Encoding.Default.GetString(xData.property_list[i].property_name));
                if (null == property)
                {
                    NFDataList varList = new NFDataList();
                    varList.AddVector3(new NFVector3());

                    property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(xData.property_list[i].property_name), varList);
                }

                property.SetVector3(NFNetController.PBToNF(xData.property_list[i].data));
            }
        }
예제 #7
0
 public override void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName];
         xProperty.RegisterCallback(handler);
     }
 }
예제 #8
0
 public override void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName];
         xProperty.RegisterCallback(handler);
     }
 }
예제 #9
0
        public override NFVector3 QueryPropertyVector3(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryVector3());
            }

            return(NFDataList.NULL_VECTOR3);
        }
예제 #10
0
        public override Int64 QueryPropertyInt(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryInt());
            }

            return(0);
        }
예제 #11
0
        public override string QueryPropertyString(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryString());
            }

            return(NFIDataList.NULL_STRING);
        }
예제 #12
0
        public override NFGUID QueryPropertyObject(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryObject());
            }

            return(NFIDataList.NULL_OBJECT);
        }
예제 #13
0
        public override double QueryPropertyDouble(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryDouble());
            }

            return(0.0);
        }
예제 #14
0
        public override double QueryDouble(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryDouble());
            }

            return(0.0);
        }
예제 #15
0
        public override float QueryPropertyFloat(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryFloat());
            }

            return(0.0f);
        }
예제 #16
0
        public override string QueryString(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryString());
            }

            return(NFIDataList.NULL_STRING);
        }
예제 #17
0
        public override NFGUID QueryObject(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryObject());
            }

            return(NFIDataList.NULL_OBJECT);
        }
예제 #18
0
        public override float QueryFloat(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryFloat());
            }

            return(0f);
        }
예제 #19
0
        public override Int64 QueryInt(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryInt());
            }

            return(0);
        }
예제 #20
0
        public override NFIProperty GetProperty(string strPropertyName)
        {
            NFIProperty xProperty = null;

            if (mhtProperty.ContainsKey(strPropertyName))
            {
                xProperty = (NFCProperty)mhtProperty[strPropertyName];
                return(xProperty);
            }

            return(xProperty);
        }
예제 #21
0
 public override bool SetProperty(string strPropertyName, NFDataList varData)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName];
         if (null != xProperty)
         {
             xProperty.SetData(varData.GetData(0));
         }
     }
     return(true);
 }
예제 #22
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);
        }
예제 #23
0
        public override bool SetPropertyDouble(string strPropertyName, double dwValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddDouble(0);
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetDouble(dwValue);
            return(true);
        }
예제 #24
0
        public override bool SetPropertyObject(string strPropertyName, NFGUID obj)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddObject(new NFGUID());
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetObject(obj);
            return(true);
        }
예제 #25
0
        public override bool SetPropertyFloat(string strPropertyName, float fValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddFloat(0.0f);
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetFloat(fValue);
            return(true);
        }
예제 #26
0
        public override bool SetPropertyInt(string strPropertyName, Int64 nValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddInt(0);
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetInt(nValue);
            return(true);
        }
예제 #27
0
        public override bool SetPropertyVector3(string strPropertyName, NFVector3 obj)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFDataList valueList = new NFDataList();
                valueList.AddVector3(new NFVector3());
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetVector3(obj);
            return(true);
        }
예제 #28
0
        public override bool SetPropertyString(string strPropertyName, string strValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddString("");
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetString(strValue);
            return(true);
        }
예제 #29
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;
            }
        }
예제 #30
0
        void AddBasePropertyFormOther(string strName, string strOther)
        {
            NFIClass xOtherClass = GetElement(strOther);
            NFIClass xLogicClass = GetElement(strName);

            if (null != xLogicClass && null != xOtherClass)
            {
                NFDataList xValue = xOtherClass.GetPropertyManager().GetPropertyList();
                for (int i = 0; i < xValue.Count(); ++i)
                {
                    NFIProperty xProperty = xOtherClass.GetPropertyManager().GetProperty(xValue.StringVal(i));
                    xLogicClass.GetPropertyManager().AddProperty(xValue.StringVal(i), xProperty.GetData());
                }
            }
        }
예제 #31
0
        void InitProperty(NFGUID self, string strClassName)
        {
            NFILogicClass xLogicClass = mxLogicClassModule.GetElement(strClassName);
            NFIDataList   xDataList   = xLogicClass.GetPropertyManager().GetPropertyList();

            for (int i = 0; i < xDataList.Count(); ++i)
            {
                string      strPropertyName = xDataList.StringVal(i);
                NFIProperty xProperty       = xLogicClass.GetPropertyManager().GetProperty(strPropertyName);

                NFIObject          xObject          = GetObject(self);
                NFIPropertyManager xPropertyManager = xObject.GetPropertyManager();

                xPropertyManager.AddProperty(strPropertyName, xProperty.GetData());
            }
        }
예제 #32
0
 /////////////////////////////////////////////////////////////
 public abstract void RegisterPropertyCallback(NFIDENTID self, string strPropertyName, NFIProperty.PropertyEventHandler handler);
예제 #33
0
 public abstract void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler);
예제 #34
0
		public override void RegisterPropertyCallback(NFGUID self, string strPropertyName, NFIProperty.PropertyEventHandler handler)
		{
			NFIObject xGameObject = GetObject(self);
			if (null != xGameObject)
			{
				xGameObject.GetPropertyManager().RegisterCallback(strPropertyName, handler);
			}
		}