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); } } } }
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)); } }
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); } }
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); } } } }
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)); } }
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)); } }
public override void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler) { if (mhtProperty.ContainsKey(strPropertyName)) { NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName]; xProperty.RegisterCallback(handler); } }
public override NFVector3 QueryPropertyVector3(string strPropertyName) { NFIProperty property = mPropertyManager.GetProperty(strPropertyName); if (null != property) { return(property.QueryVector3()); } return(NFDataList.NULL_VECTOR3); }
public override Int64 QueryPropertyInt(string strPropertyName) { NFIProperty property = mPropertyManager.GetProperty(strPropertyName); if (null != property) { return(property.QueryInt()); } return(0); }
public override string QueryPropertyString(string strPropertyName) { NFIProperty property = mPropertyManager.GetProperty(strPropertyName); if (null != property) { return(property.QueryString()); } return(NFIDataList.NULL_STRING); }
public override NFGUID QueryPropertyObject(string strPropertyName) { NFIProperty property = mPropertyManager.GetProperty(strPropertyName); if (null != property) { return(property.QueryObject()); } return(NFIDataList.NULL_OBJECT); }
public override double QueryPropertyDouble(string strPropertyName) { NFIProperty property = mPropertyManager.GetProperty(strPropertyName); if (null != property) { return(property.QueryDouble()); } return(0.0); }
public override double QueryDouble(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return(xProperty.QueryDouble()); } return(0.0); }
public override float QueryPropertyFloat(string strPropertyName) { NFIProperty property = mPropertyManager.GetProperty(strPropertyName); if (null != property) { return(property.QueryFloat()); } return(0.0f); }
public override string QueryString(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return(xProperty.QueryString()); } return(NFIDataList.NULL_STRING); }
public override NFGUID QueryObject(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return(xProperty.QueryObject()); } return(NFIDataList.NULL_OBJECT); }
public override float QueryFloat(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return(xProperty.QueryFloat()); } return(0f); }
public override Int64 QueryInt(string strName) { NFIProperty xProperty = GetPropertyManager().GetProperty(strName); if (null != xProperty) { return(xProperty.QueryInt()); } return(0); }
public override NFIProperty GetProperty(string strPropertyName) { NFIProperty xProperty = null; if (mhtProperty.ContainsKey(strPropertyName)) { xProperty = (NFCProperty)mhtProperty[strPropertyName]; return(xProperty); } return(xProperty); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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; } }
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()); } } }
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()); } }
///////////////////////////////////////////////////////////// public abstract void RegisterPropertyCallback(NFIDENTID self, string strPropertyName, NFIProperty.PropertyEventHandler handler);
public abstract void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler);
public override void RegisterPropertyCallback(NFGUID self, string strPropertyName, NFIProperty.PropertyEventHandler handler) { NFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetPropertyManager().RegisterCallback(strPropertyName, handler); } }