public void RequireRecordVector2(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar) { NFMsg.ObjectRecordVector2 xData = new NFMsg.ObjectRecordVector2(); xData.PlayerId = mHelpModule.NFToPB(objectID); xData.RecordName = ByteString.CopyFromUtf8(strRecordName); NFMsg.RecordVector2 xRecordVector = new NFMsg.RecordVector2(); xRecordVector.Row = nRow; xRecordVector.Col = nCol; xRecordVector.Data = mHelpModule.NFToPB(newVar.Vector2Val()); mxBody.SetLength(0); xData.WriteTo(mxBody); SendMsg((int)NFMsg.EGameMsgID.AckRecordVector2, mxBody); }
public void RequireRecordVector2(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar) { NFMsg.ObjectRecordVector2 xData = new NFMsg.ObjectRecordVector2(); xData.player_id = NFNetController.NFToPB(self); xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName); NFMsg.RecordVector2 xRecordVector = new NFMsg.RecordVector2(); xRecordVector.row = nRow; xRecordVector.col = nCol; xRecordVector.data = NFNetController.NFToPB(newVar.Vector2Val()); mxBody.SetLength(0); mxSerializer.Serialize(mxBody, xData); SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_VECTOR2, mxBody); }
public void RequirePropertyVector2(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar) { NFMsg.ObjectPropertyVector2 xData = new NFMsg.ObjectPropertyVector2(); xData.player_id = NFNetController.NFToPB(objectID); NFMsg.PropertyVector2 xProperty = new NFMsg.PropertyVector2(); xProperty.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName); xProperty.data = NFNetController.NFToPB(newVar.Vector2Val()); xData.property_list.Add(xProperty); mxBody.SetLength(0); mxSerializer.Serialize(mxBody, xData); NFNetController.Instance.mxNetSender.SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_VECTOR2, 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); }