private void OnPropertyObject(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream); NFMsg.ObjectPropertyObject propertyData = new NFMsg.ObjectPropertyObject(); propertyData = Serializer.Deserialize <NFMsg.ObjectPropertyObject>(new MemoryStream(xMsg.msg_data)); NFIObject go = NFCKernelModule.Instance().GetObject(PBToNF(propertyData.player_id)); for (int i = 0; i < propertyData.property_list.Count; i++) { NFIPropertyManager propertyManager = go.GetPropertyManager(); NFIProperty property = propertyManager.GetProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name)); if (null == property) { NFIDataList varList = new NFCDataList(); varList.AddObject(new NFGUID()); property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name), varList); } property.SetObject(PBToNF(propertyData.property_list[i].data)); } }
private void EGMI_ACK_PROPERTY_OBJECT(int id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.ObjectPropertyObject xData = NFMsg.ObjectPropertyObject.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.Ident data = xData.PropertyList[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_OBJECT(NFMsg.MsgBase xMsg) { NFMsg.ObjectPropertyObject xData = new NFMsg.ObjectPropertyObject(); xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectPropertyObject)) as NFMsg.ObjectPropertyObject; 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.AddObject(new NFGUID()); property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(xData.property_list[i].property_name), varList); } property.SetObject(NFNetController.PBToNF(xData.property_list[i].data)); } }
public void RequirePropertyObject(NFGUID objectID, string strPropertyName, NFGUID newVar) { NFMsg.ObjectPropertyObject xData = new NFMsg.ObjectPropertyObject(); xData.PlayerId = mHelpModule.NFToPB(objectID); NFMsg.PropertyObject xPropertyObject = new NFMsg.PropertyObject(); xPropertyObject.PropertyName = ByteString.CopyFromUtf8(strPropertyName); xPropertyObject.Data = mHelpModule.NFToPB(newVar); xData.PropertyList.Add(xPropertyObject); mxBody.SetLength(0); xData.WriteTo(mxBody); Debug.Log("send upload Object"); SendMsg((int)NFMsg.EGameMsgID.AckPropertyObject, mxBody); }
public void RequirePropertyObject(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar) { NFMsg.ObjectPropertyObject xData = new NFMsg.ObjectPropertyObject(); xData.player_id = NFBinarySendLogic.NFToPB(objectID); NFMsg.PropertyObject xPropertyObject = new NFMsg.PropertyObject(); xPropertyObject.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName); xPropertyObject.data = NFBinarySendLogic.NFToPB(newVar.ObjectVal()); xData.property_list.Add(xPropertyObject); MemoryStream stream = new MemoryStream(); Serializer.Serialize <NFMsg.ObjectPropertyObject>(stream, xData); Debug.Log("send upload Object"); NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_OBJECT, stream); }
public void RequirePropertyObject(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar) { NFMsg.ObjectPropertyObject xData = new NFMsg.ObjectPropertyObject(); xData.player_id = NFNetController.NFToPB(objectID); NFMsg.PropertyObject xPropertyObject = new NFMsg.PropertyObject(); xPropertyObject.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName); xPropertyObject.data = NFNetController.NFToPB(newVar.ObjectVal()); xData.property_list.Add(xPropertyObject); mxBody.SetLength(0); mxSerializer.Serialize(mxBody, xData); Debug.Log("send upload Object"); NFNetController.Instance.mxNetSender.SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_OBJECT, mxBody); }
private void OnPropertyObject(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.ObjectPropertyObject propertyData = NFMsg.ObjectPropertyObject.Parser.ParseFrom(xMsg.msg_data); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(propertyData.player_id)); for (int i = 0; i < propertyData.property_list.Count; i++) { NFIPropertyManager propertyManager = go.GetPropertyManager(); NFIProperty property = propertyManager.GetProperty(propertyData.property_list[i].property_name.ToStringUtf8()); if (null == property) { NFDataList varList = new NFDataList(); varList.AddObject(new NFGUID()); property = propertyManager.AddProperty(propertyData.property_list[i].property_name.ToStringUtf8(), varList); } property.SetObject(mHelpModule.PBToNF(propertyData.property_list[i].data)); } }
private void EGMI_ACK_PROPERTY_OBJECT(MsgHead head, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream); NFMsg.ObjectPropertyObject propertyData = new NFMsg.ObjectPropertyObject(); propertyData = Serializer.Deserialize<NFMsg.ObjectPropertyObject>(new MemoryStream(xMsg.msg_data)); NFIObject go = NFCKernelModule.Instance.GetObject(PBToNF(propertyData.player_id)); for(int i = 0; i < propertyData.property_list.Count; i++) { NFIPropertyManager propertyManager = go.GetPropertyManager(); NFIProperty property = propertyManager.GetProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name)); if (null == property) { NFIDataList varList = new NFCDataList(); varList.AddObject(new NFGUID()); property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name), varList); } property.SetObject(PBToNF(propertyData.property_list[i].data)); } }
public void RequirePropertyObject(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar) { NFMsg.ObjectPropertyObject xData = new NFMsg.ObjectPropertyObject(); xData.player_id = NFBinarySendLogic.NFToPB(objectID); NFMsg.PropertyObject xPropertyObject = new NFMsg.PropertyObject(); xPropertyObject.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName); xPropertyObject.data = NFBinarySendLogic.NFToPB(newVar.ObjectVal()); xData.property_list.Add(xPropertyObject); MemoryStream stream = new MemoryStream(); Serializer.Serialize<NFMsg.ObjectPropertyObject>(stream, xData); Debug.Log("send upload Object"); NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_OBJECT, stream); }