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); }
public void RequireRecordString(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar) { NFMsg.ObjectRecordString xData = new NFMsg.ObjectRecordString(); xData.PlayerId = mHelpModule.NFToPB(objectID); xData.RecordName = ByteString.CopyFromUtf8(strRecordName); NFMsg.RecordString xRecordString = new NFMsg.RecordString(); xData.PropertyList.Add(xRecordString); xRecordString.Row = nRow; xRecordString.Col = nCol; xRecordString.Data = ByteString.CopyFromUtf8(newVar.StringVal()); mxBody.SetLength(0); xData.WriteTo(mxBody); Debug.Log("send upload record string"); SendMsg((int)NFMsg.EGameMsgID.AckRecordString, mxBody); }
public void RequireRecordString(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar) { NFMsg.ObjectRecordString xData = new NFMsg.ObjectRecordString(); xData.player_id = NFNetController.NFToPB(self); xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName); NFMsg.RecordString xRecordString = new NFMsg.RecordString(); xData.property_list.Add(xRecordString); xRecordString.row = nRow; xRecordString.col = nCol; xRecordString.data = System.Text.Encoding.Default.GetBytes(newVar.StringVal()); mxBody.SetLength(0); mxSerializer.Serialize(mxBody, xData); Debug.Log("send upload record string"); SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_STRING, mxBody); }
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; } }
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); }