public ServerMapInfo[] GetAllServerMap() { List<ServerMapInfo> infos = new List<ServerMapInfo>(); SqlDataReader reader = null; try { db.GetReader(ref reader, "SP_Maps_Server_All"); while (reader.Read()) { ServerMapInfo info = new ServerMapInfo(); info.ServerID = (int)reader["ServerID"]; info.OpenMap = reader["OpenMap"].ToString(); info.IsSpecial = (int)reader["IsSpecial"]; infos.Add(info); } } catch (Exception e) { if (log.IsErrorEnabled) log.Error("GetAllMapWeek", e); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } return infos.ToArray(); }
public static XElement CreateMapServer(ServerMapInfo info) { return new XElement("Item", new XAttribute("ServerID", info.ServerID), new XAttribute("OpenMap", info.OpenMap), new XAttribute("IsSpecial", info.IsSpecial)); }