private void EGMI_ACK_ADD_ROW(NFMsg.MsgBase xMsg) { NFMsg.ObjectRecordAddRow xData = new NFMsg.ObjectRecordAddRow(); xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordAddRow)) as NFMsg.ObjectRecordAddRow; NFIObject go = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xData.player_id)); NFIRecordManager recordManager = go.GetRecordManager(); for (int i = 0; i < xData.row_data.Count; i++) { ADD_ROW(NFNetController.PBToNF(xData.player_id), System.Text.Encoding.Default.GetString(xData.record_name), xData.row_data[i]); } }
private void OnAddRow(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.ObjectRecordAddRow recordData = NFMsg.ObjectRecordAddRow.Parser.ParseFrom(xMsg.msg_data); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(recordData.player_id)); NFIRecordManager recordManager = go.GetRecordManager(); for (int i = 0; i < recordData.row_data.Count; i++) { ADD_ROW(mHelpModule.PBToNF(recordData.player_id), recordData.record_name.ToStringUtf8(), recordData.row_data[i]); } }
private void OnAddRow(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream); NFMsg.ObjectRecordAddRow recordData = new NFMsg.ObjectRecordAddRow(); recordData = Serializer.Deserialize <NFMsg.ObjectRecordAddRow>(new MemoryStream(xMsg.msg_data)); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(recordData.player_id)); NFIRecordManager recordManager = go.GetRecordManager(); for (int i = 0; i < recordData.row_data.Count; i++) { ADD_ROW(mHelpModule.PBToNF(recordData.player_id), System.Text.Encoding.Default.GetString(recordData.record_name), recordData.row_data[i]); } }
private void EGMI_ACK_ADD_ROW(MsgHead head, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream); NFMsg.ObjectRecordAddRow recordData = new NFMsg.ObjectRecordAddRow(); recordData = Serializer.Deserialize <NFMsg.ObjectRecordAddRow>(new MemoryStream(xMsg.msg_data)); NFIObject go = NFCKernel.Instance.GetObject(PBToNF(recordData.player_id)); NFIRecordManager recordManager = go.GetRecordManager(); for (int i = 0; i < recordData.row_data.Count; i++) { ADD_ROW(PBToNF(recordData.player_id), System.Text.Encoding.Default.GetString(recordData.record_name), recordData.row_data[i]); } }
private void EGMI_ACK_ADD_ROW(int id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.ObjectRecordAddRow xData = NFMsg.ObjectRecordAddRow.Parser.ParseFrom(xMsg.MsgData); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(xData.PlayerId)); if (go == null) { Debug.LogError("error id" + xData.PlayerId); return; } NFIRecordManager recordManager = go.GetRecordManager(); for (int i = 0; i < xData.RowData.Count; i++) { ADD_ROW(mHelpModule.PBToNF(xData.PlayerId), xData.RecordName.ToStringUtf8(), xData.RowData[i]); } }
private void EGMI_ACK_ADD_ROW(MsgHead head, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream); NFMsg.ObjectRecordAddRow recordData = new NFMsg.ObjectRecordAddRow(); recordData = Serializer.Deserialize<NFMsg.ObjectRecordAddRow>(new MemoryStream(xMsg.msg_data)); NFIObject go = NFCKernelModule.Instance.GetObject(PBToNF(recordData.player_id)); NFIRecordManager recordManager = go.GetRecordManager(); for (int i = 0; i < recordData.row_data.Count; i++) { ADD_ROW(PBToNF(recordData.player_id), System.Text.Encoding.Default.GetString(recordData.record_name), recordData.row_data[i]); } }
public void RequireAddRow(NFGUID objectID, string strRecordName, int nRow) { NFMsg.ObjectRecordAddRow xData = new NFMsg.ObjectRecordAddRow(); xData.PlayerId = mHelpModule.NFToPB(objectID); xData.RecordName = ByteString.CopyFromUtf8(strRecordName); NFMsg.RecordAddRowStruct xRecordAddRowStruct = new NFMsg.RecordAddRowStruct(); xData.RowData.Add(xRecordAddRowStruct); xRecordAddRowStruct.Row = nRow; NFIObject xObject = mKernelModule.GetObject(objectID); NFIRecord xRecord = xObject.GetRecordManager().GetRecord(strRecordName); NFDataList xRowData = xRecord.QueryRow(nRow); for (int i = 0; i < xRowData.Count(); i++) { switch (xRowData.GetType(i)) { case NFDataList.VARIANT_TYPE.VTYPE_INT: { NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt(); xRecordInt.Row = nRow; xRecordInt.Col = i; xRecordInt.Data = xRowData.IntVal(i); xRecordAddRowStruct.RecordIntList.Add(xRecordInt); } break; case NFDataList.VARIANT_TYPE.VTYPE_FLOAT: { NFMsg.RecordFloat xRecordFloat = new NFMsg.RecordFloat(); xRecordFloat.Row = nRow; xRecordFloat.Col = i; xRecordFloat.Data = (float)xRowData.FloatVal(i); xRecordAddRowStruct.RecordFloatList.Add(xRecordFloat); } break; case NFDataList.VARIANT_TYPE.VTYPE_STRING: { NFMsg.RecordString xRecordString = new NFMsg.RecordString(); xRecordString.Row = nRow; xRecordString.Col = i; xRecordString.Data = ByteString.CopyFromUtf8(xRowData.StringVal(i)); xRecordAddRowStruct.RecordStringList.Add(xRecordString); } break; case NFDataList.VARIANT_TYPE.VTYPE_OBJECT: { NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject(); xRecordObject.Row = nRow; xRecordObject.Col = i; xRecordObject.Data = mHelpModule.NFToPB(xRowData.ObjectVal(i)); xRecordAddRowStruct.RecordObjectList.Add(xRecordObject); } break; case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2: { NFMsg.RecordVector2 xRecordVector = new NFMsg.RecordVector2(); xRecordVector.Row = nRow; xRecordVector.Col = i; xRecordVector.Data = mHelpModule.NFToPB(xRowData.Vector2Val(i)); xRecordAddRowStruct.RecordVector2List.Add(xRecordVector); } break; case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3: { NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3(); xRecordVector.Row = nRow; xRecordVector.Col = i; xRecordVector.Data = mHelpModule.NFToPB(xRowData.Vector3Val(i)); xRecordAddRowStruct.RecordVector3List.Add(xRecordVector); } break; } } mxBody.SetLength(0); xData.WriteTo(mxBody); Debug.Log("send upload record addRow"); SendMsg((int)NFMsg.EGameMsgID.AckAddRow, mxBody); }
public void RequireAddRow(NFrame.NFGUID self, string strRecordName, int nRow) { NFMsg.ObjectRecordAddRow xData = new NFMsg.ObjectRecordAddRow(); xData.player_id = NFBinarySendLogic.NFToPB(self); xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName); NFMsg.RecordAddRowStruct xRecordAddRowStruct = new NFMsg.RecordAddRowStruct(); xData.row_data.Add(xRecordAddRowStruct); xRecordAddRowStruct.row = nRow; NFIObject xObject = NFCKernelModule.Instance.GetObject(self); NFIRecord xRecord = xObject.GetRecordManager().GetRecord(strRecordName); NFIDataList xRowData = xRecord.QueryRow(nRow); for (int i = 0; i < xRowData.Count(); i++) { switch (xRowData.GetType(i)) { case NFIDataList.VARIANT_TYPE.VTYPE_INT: { NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt(); xRecordInt.row = nRow; xRecordInt.col = i; xRecordInt.data = xRowData.IntVal(i); xRecordAddRowStruct.record_int_list.Add(xRecordInt); } break; case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT: { NFMsg.RecordFloat xRecordFloat = new NFMsg.RecordFloat(); xRecordFloat.row = nRow; xRecordFloat.col = i; xRecordFloat.data = (float)xRowData.FloatVal(i); xRecordAddRowStruct.record_float_list.Add(xRecordFloat); } break; case NFIDataList.VARIANT_TYPE.VTYPE_STRING: { NFMsg.RecordString xRecordString = new NFMsg.RecordString(); xRecordString.row = nRow; xRecordString.col = i; xRecordString.data = System.Text.Encoding.Default.GetBytes(xRowData.StringVal(i)); xRecordAddRowStruct.record_string_list.Add(xRecordString); } break; case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT: { NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject(); xRecordObject.row = nRow; xRecordObject.col = i; xRecordObject.data = NFBinarySendLogic.NFToPB(xRowData.ObjectVal(i)); xRecordAddRowStruct.record_object_list.Add(xRecordObject); } break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2: { NFMsg.RecordVector2 xRecordVector = new NFMsg.RecordVector2(); xRecordVector.row = nRow; xRecordVector.col = i; xRecordVector.data = NFBinarySendLogic.NFToPB(xRowData.Vector2Val(i)); xRecordAddRowStruct.record_vector2_list.Add(xRecordVector); } break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3: { NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3(); xRecordVector.row = nRow; xRecordVector.col = i; xRecordVector.data = NFBinarySendLogic.NFToPB(xRowData.Vector3Val(i)); xRecordAddRowStruct.record_vector3_list.Add(xRecordVector); } break; } } MemoryStream stream = new MemoryStream(); Serializer.Serialize <NFMsg.ObjectRecordAddRow>(stream, xData); Debug.Log("send upload record addRow"); SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_ADD_ROW, stream); }
public void RequireAddRow(NFrame.NFGUID self, string strRecordName, int nRow) { NFMsg.ObjectRecordAddRow xData = new NFMsg.ObjectRecordAddRow(); xData.player_id = NFBinarySendLogic.NFToPB(self); xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName); NFMsg.RecordAddRowStruct xRecordAddRowStruct = new NFMsg.RecordAddRowStruct(); xData.row_data.Add(xRecordAddRowStruct); xRecordAddRowStruct.row = nRow; NFIObject xObject = NFCKernelModule.Instance.GetObject(self); NFIRecord xRecord = xObject.GetRecordManager().GetRecord(strRecordName); NFIDataList xRowData = xRecord.QueryRow(nRow); for(int i = 0;i<xRowData.Count();i++) { switch(xRowData.GetType(i)) { case NFIDataList.VARIANT_TYPE.VTYPE_INT: { NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt(); xRecordInt.row = nRow; xRecordInt.col = i; xRecordInt.data = xRowData.IntVal(i); xRecordAddRowStruct.record_int_list.Add(xRecordInt); } break; case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT: { NFMsg.RecordFloat xRecordFloat = new NFMsg.RecordFloat(); xRecordFloat.row = nRow; xRecordFloat.col = i; xRecordFloat.data = (float)xRowData.FloatVal(i); xRecordAddRowStruct.record_float_list.Add(xRecordFloat); } break; case NFIDataList.VARIANT_TYPE.VTYPE_STRING: { NFMsg.RecordString xRecordString = new NFMsg.RecordString(); xRecordString.row = nRow; xRecordString.col = i; xRecordString.data = System.Text.Encoding.Default.GetBytes(xRowData.StringVal(i)); xRecordAddRowStruct.record_string_list.Add(xRecordString); } break; case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT: { NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject(); xRecordObject.row = nRow; xRecordObject.col = i; xRecordObject.data = NFBinarySendLogic.NFToPB(xRowData.ObjectVal(i)); xRecordAddRowStruct.record_object_list.Add(xRecordObject); } break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2: { NFMsg.RecordVector2 xRecordVector = new NFMsg.RecordVector2(); xRecordVector.row = nRow; xRecordVector.col = i; xRecordVector.data = NFBinarySendLogic.NFToPB(xRowData.Vector2Val(i)); xRecordAddRowStruct.record_vector2_list.Add(xRecordVector); } break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3: { NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3(); xRecordVector.row = nRow; xRecordVector.col = i; xRecordVector.data = NFBinarySendLogic.NFToPB(xRowData.Vector3Val(i)); xRecordAddRowStruct.record_vector3_list.Add(xRecordVector); } break; } } MemoryStream stream = new MemoryStream(); Serializer.Serialize<NFMsg.ObjectRecordAddRow>(stream, xData); Debug.Log("send upload record addRow"); SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_ADD_ROW, stream); }