private static List<GeneralRecordData> LoadAllTableMemberInfo(int start, int count)
{
List<GeneralRecordData> ret = new List<GeneralRecordData>();
try {
using (MySqlCommand cmd = new MySqlCommand()) {
cmd.Connection = DBConn.MySqlConn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "LoadAllTableMemberInfo";
MySqlParameter inputParam;
inputParam = new MySqlParameter("@_Start", MySqlDbType.Int32);
inputParam.Direction = ParameterDirection.Input;
inputParam.Value = start;
cmd.Parameters.Add(inputParam);
inputParam = new MySqlParameter("@_Count", MySqlDbType.Int32);
inputParam.Direction = ParameterDirection.Input;
inputParam.Value = count;
cmd.Parameters.Add(inputParam);
using (DbDataReader reader = cmd.ExecuteReader()) {
while (reader.Read()) {
GeneralRecordData record = new GeneralRecordData();
object val;
TableMemberInfo msg = new TableMemberInfo();
val = reader["MemberGuid"];
msg.MemberGuid = (ulong)val;
record.PrimaryKeys.Add(val.ToString());
val = reader["UserGuid"];
msg.UserGuid = (ulong)val;
record.ForeignKeys.Add(val.ToString());
val = reader["HeroId"];
msg.HeroId = (int)val;
val = reader["Level"];
msg.Level = (int)val;
record.DataVersion = (int)reader["DataVersion"];
record.Data = DbDataSerializer.Encode(msg);
ret.Add(record);
}
}
}
} catch (Exception ex) {
DBConn.Close();
throw ex;
}
return ret;
}