private void EGMI_ACK_RECORD_CLEAR(int id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.MultiObjectRecordList xData = NFMsg.MultiObjectRecordList.Parser.ParseFrom(xMsg.MsgData); for (int i = 0; i < xData.MultiPlayerRecord.Count; ++i) { NFMsg.ObjectRecordList objectRecordList = xData.MultiPlayerRecord[i]; for (int j = 0; j < objectRecordList.RecordList.Count; ++j) { NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(objectRecordList.PlayerId)); if (go == null) { Debug.LogError("error id" + objectRecordList.PlayerId); return; } NFMsg.ObjectRecordBase objectRecordBase = objectRecordList.RecordList[j]; string recordName = objectRecordBase.RecordName.ToStringUtf8(); NFIRecordManager recordManager = go.GetRecordManager(); if (recordManager != null) { NFIRecord record = recordManager.GetRecord(recordName); if (record != null) { record.Clear(); } } } } }
private void OnObjectRecordEntry(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.MultiObjectRecordList xMultiObjectRecordData = NFMsg.MultiObjectRecordList.Parser.ParseFrom(xMsg.msg_data); for (int i = 0; i < xMultiObjectRecordData.multi_player_record.Count; i++) { NFMsg.ObjectRecordList xObjectRecordList = xMultiObjectRecordData.multi_player_record[i]; for (int j = 0; j < xObjectRecordList.record_list.Count; j++) { NFMsg.ObjectRecordBase xObjectRecordBase = xObjectRecordList.record_list[j]; for (int k = 0; k < xObjectRecordBase.row_struct.Count; ++k) { NFMsg.RecordAddRowStruct xAddRowStruct = xObjectRecordBase.row_struct[k]; ADD_ROW(mHelpModule.PBToNF(xObjectRecordList.player_id), xObjectRecordBase.record_name.ToStringUtf8(), xAddRowStruct); } } } }
private void OnObjectRecordEntry(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream); NFMsg.MultiObjectRecordList xMultiObjectRecordData = new NFMsg.MultiObjectRecordList(); xMultiObjectRecordData = Serializer.Deserialize <NFMsg.MultiObjectRecordList>(new MemoryStream(xMsg.msg_data)); for (int i = 0; i < xMultiObjectRecordData.multi_player_record.Count; i++) { NFMsg.ObjectRecordList xObjectRecordList = xMultiObjectRecordData.multi_player_record[i]; for (int j = 0; j < xObjectRecordList.record_list.Count; j++) { NFMsg.ObjectRecordBase xObjectRecordBase = xObjectRecordList.record_list[j]; for (int k = 0; k < xObjectRecordBase.row_struct.Count; ++k) { NFMsg.RecordAddRowStruct xAddRowStruct = xObjectRecordBase.row_struct[k]; ADD_ROW(mHelpModule.PBToNF(xObjectRecordList.player_id), System.Text.Encoding.Default.GetString(xObjectRecordBase.record_name), xAddRowStruct); } } } }
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; } } }
private void AttachObjectData(NFGUID self) { ObjectDataBuff xDataBuff; if (mxObjectDataBuff.TryGetValue(self, out xDataBuff)) { ////////////////record for (int j = 0; j < xDataBuff.xRecordList.record_list.Count; j++) { NFMsg.ObjectRecordBase xObjectRecordBase = xDataBuff.xRecordList.record_list[j]; string srRecordName = System.Text.Encoding.Default.GetString(xObjectRecordBase.record_name); for (int k = 0; k < xObjectRecordBase.row_struct.Count; ++k) { NFMsg.RecordAddRowStruct xAddRowStruct = xObjectRecordBase.row_struct[k]; ADD_ROW(self, System.Text.Encoding.Default.GetString(xObjectRecordBase.record_name), xAddRowStruct); } } ////////////////property NFIObject go = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xDataBuff.xPropertyList.player_id)); NFIPropertyManager xPropertyManager = go.GetPropertyManager(); for (int j = 0; j < xDataBuff.xPropertyList.property_int_list.Count; j++) { string strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.property_int_list[j].property_name); NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName); if (null == xProperty) { NFDataList varList = new NFDataList(); varList.AddInt(0); xProperty = xPropertyManager.AddProperty(strPropertyName, varList); } xProperty.SetInt(xDataBuff.xPropertyList.property_int_list[j].data); } for (int j = 0; j < xDataBuff.xPropertyList.property_float_list.Count; j++) { string strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.property_float_list[j].property_name); NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName); if (null == xProperty) { NFDataList varList = new NFDataList(); varList.AddFloat(0); xProperty = xPropertyManager.AddProperty(strPropertyName, varList); } xProperty.SetFloat(xDataBuff.xPropertyList.property_float_list[j].data); } for (int j = 0; j < xDataBuff.xPropertyList.property_string_list.Count; j++) { string strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.property_string_list[j].property_name); NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName); if (null == xProperty) { NFDataList varList = new NFDataList(); varList.AddString(""); xProperty = xPropertyManager.AddProperty(strPropertyName, varList); } xProperty.SetString(System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.property_string_list[j].data)); } for (int j = 0; j < xDataBuff.xPropertyList.property_object_list.Count; j++) { string strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.property_object_list[j].property_name); NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName); if (null == xProperty) { NFDataList varList = new NFDataList(); varList.AddObject(new NFGUID()); xProperty = xPropertyManager.AddProperty(strPropertyName, varList); } xProperty.SetObject(NFNetController.PBToNF(xDataBuff.xPropertyList.property_object_list[j].data)); } } }