private void OnRemoveRow(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.ObjectRecordRemove recordData = NFMsg.ObjectRecordRemove.Parser.ParseFrom(xMsg.msg_data); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(recordData.player_id)); NFIRecordManager recordManager = go.GetRecordManager(); NFIRecord record = recordManager.GetRecord(recordData.record_name.ToStringUtf8()); for (int i = 0; i < recordData.remove_row.Count; i++) { record.Remove(recordData.remove_row[i]); } }
private void OnRemoveRow(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream); NFMsg.ObjectRecordRemove recordData = new NFMsg.ObjectRecordRemove(); recordData = Serializer.Deserialize <NFMsg.ObjectRecordRemove>(new MemoryStream(xMsg.msg_data)); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(recordData.player_id)); NFIRecordManager recordManager = go.GetRecordManager(); NFIRecord record = recordManager.GetRecord(System.Text.Encoding.Default.GetString(recordData.record_name)); for (int i = 0; i < recordData.remove_row.Count; i++) { record.Remove(recordData.remove_row[i]); } }