Modernization Fixes & Updates to Default Values (#3)
This commit is contained in:
parent
445eddff68
commit
dcf64091b1
768 changed files with 10507 additions and 14196 deletions
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Reports
|
||||
{
|
||||
|
|
@ -154,14 +154,14 @@ namespace Server.Engines.Reports
|
|||
DateTime startPeriod = history.Snapshots[0].TimeStamp.Date + TimeSpan.FromDays(1.0);
|
||||
DateTime endPeriod = history.Snapshots[history.Snapshots.Count - 1].TimeStamp.Date;
|
||||
|
||||
ArrayList regions = new ArrayList();
|
||||
List<BarRegion> regions = new List<BarRegion>();
|
||||
|
||||
DateTime curDate = DateTime.MinValue;
|
||||
int curPeak = -1;
|
||||
int curLow = 1000;
|
||||
int curTotl = 0;
|
||||
int curCont = 0;
|
||||
int curValu = 0;
|
||||
int curValu;
|
||||
|
||||
for (int i = 0; i < history.Snapshots.Count; ++i)
|
||||
{
|
||||
|
|
@ -195,7 +195,7 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
else
|
||||
{
|
||||
BarRegion region = (BarRegion)regions[regions.Count - 1];
|
||||
BarRegion region = regions[regions.Count - 1];
|
||||
|
||||
if (region.m_Name == mnthName)
|
||||
region.m_RangeTo = barGraph.Items.Count;
|
||||
|
|
@ -220,7 +220,7 @@ namespace Server.Engines.Reports
|
|||
curDate = thisDate;
|
||||
}
|
||||
|
||||
barGraph.Regions = (BarRegion[])regions.ToArray(typeof(BarRegion));
|
||||
barGraph.Regions = regions.ToArray();
|
||||
|
||||
return barGraph;
|
||||
}
|
||||
|
|
@ -239,7 +239,7 @@ namespace Server.Engines.Reports
|
|||
barGraph.FontSize = 6;
|
||||
barGraph.Interval = ival;
|
||||
|
||||
ArrayList regions = new ArrayList();
|
||||
List<BarRegion> regions = new List<BarRegion>();
|
||||
|
||||
for (int i = 0; i < history.Snapshots.Count; ++i)
|
||||
{
|
||||
|
|
@ -275,7 +275,7 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
else
|
||||
{
|
||||
BarRegion region = (BarRegion)regions[regions.Count - 1];
|
||||
BarRegion region = regions[regions.Count - 1];
|
||||
|
||||
if (region.m_Name == dayName)
|
||||
region.m_RangeTo = barGraph.Items.Count;
|
||||
|
|
@ -286,7 +286,7 @@ namespace Server.Engines.Reports
|
|||
barGraph.Items.Add(hours + (realHours >= 12 ? " PM" : " AM"), val);
|
||||
}
|
||||
|
||||
barGraph.Regions = (BarRegion[])regions.ToArray(typeof(BarRegion));
|
||||
barGraph.Regions = regions.ToArray();
|
||||
|
||||
return barGraph;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,9 +127,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
public void UpdateResolver()
|
||||
{
|
||||
string resolvedBy;
|
||||
DateTime timeResolved;
|
||||
PageResolution res = GetResolution(out resolvedBy, out timeResolved);
|
||||
PageResolution res = GetResolution(out string resolvedBy, out DateTime timeResolved);
|
||||
|
||||
if (m_History != null && IsStaffResolution(res))
|
||||
Resolver = m_History.GetStaffInfo(resolvedBy);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Server.Engines.Reports
|
||||
|
|
@ -15,17 +16,17 @@ namespace Server.Engines.Reports
|
|||
Pages = new PageInfoCollection();
|
||||
QueueStats = new QueueStatusCollection();
|
||||
|
||||
UserInfo = new Hashtable(StringComparer.OrdinalIgnoreCase);
|
||||
StaffInfo = new Hashtable(StringComparer.OrdinalIgnoreCase);
|
||||
UserInfo = new Dictionary<string, UserInfo>(StringComparer.OrdinalIgnoreCase);
|
||||
StaffInfo = new Dictionary<string, StaffInfo>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public PageInfoCollection Pages{ get; set; }
|
||||
|
||||
public QueueStatusCollection QueueStats{ get; set; }
|
||||
|
||||
public Hashtable UserInfo{ get; set; }
|
||||
public Dictionary<string, UserInfo> UserInfo{ get; set; }
|
||||
|
||||
public Hashtable StaffInfo{ get; set; }
|
||||
public Dictionary<string, StaffInfo> StaffInfo{ get; set; }
|
||||
|
||||
public void AddPage(PageInfo info)
|
||||
{
|
||||
|
|
@ -221,7 +222,6 @@ namespace Server.Engines.Reports
|
|||
|
||||
if (ts >= min && ts < max)
|
||||
{
|
||||
DateTime date = ts.Date;
|
||||
TimeSpan time = ts.TimeOfDay;
|
||||
|
||||
int hour = time.Hours;
|
||||
|
|
@ -232,9 +232,8 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
|
||||
BarGraph barGraph = new BarGraph("Average pages in queue", "graph_pagequeue_avg", 10, "Time", "Pages",
|
||||
BarGraphRenderMode.Lines);
|
||||
BarGraphRenderMode.Lines) { FontSize = 6 };
|
||||
|
||||
barGraph.FontSize = 6;
|
||||
|
||||
for (int i = 7; i <= totals.Length + 7; ++i)
|
||||
{
|
||||
|
|
@ -303,9 +302,8 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
}
|
||||
|
||||
BarGraph barGraph = new BarGraph(title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines);
|
||||
BarGraph barGraph = new BarGraph(title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines) { FontSize = 6 };
|
||||
|
||||
barGraph.FontSize = 6;
|
||||
|
||||
for (int i = 7; i <= totals.Length + 7; ++i)
|
||||
{
|
||||
|
|
@ -348,7 +346,7 @@ namespace Server.Engines.Reports
|
|||
return report;
|
||||
}
|
||||
|
||||
private PieChart[] ChartTotalPages(StaffInfo[] staff, TimeSpan ts, string title, string fname)
|
||||
private PersistableObject[] ChartTotalPages(StaffInfo[] staff, TimeSpan ts, string title, string fname)
|
||||
{
|
||||
DateTime max = DateTime.UtcNow;
|
||||
DateTime min = max - ts;
|
||||
|
|
@ -385,7 +383,7 @@ namespace Server.Engines.Reports
|
|||
resChart.Items.Add("Logged Out", countLogged);
|
||||
resChart.Items.Add("Unresolved", countUnres);
|
||||
|
||||
return new[] { staffChart, resChart };
|
||||
return new PersistableObject[] { staffChart, resChart };
|
||||
}
|
||||
|
||||
#region Type Identification
|
||||
|
|
@ -399,4 +397,4 @@ namespace Server.Engines.Reports
|
|||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,3 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.573
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Reports
|
||||
{
|
||||
|
|
@ -7,11 +8,11 @@ namespace Server.Engines.Reports
|
|||
|
||||
public sealed class PersistableTypeRegistry
|
||||
{
|
||||
private static Hashtable m_Table;
|
||||
private static Dictionary<string, PersistableType> m_Table;
|
||||
|
||||
static PersistableTypeRegistry()
|
||||
{
|
||||
m_Table = new Hashtable(StringComparer.OrdinalIgnoreCase);
|
||||
m_Table = new Dictionary<string, PersistableType>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
Register(Report.ThisTypeID);
|
||||
Register(BarGraph.ThisTypeID);
|
||||
|
|
@ -31,7 +32,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
public static PersistableType Find(string name)
|
||||
{
|
||||
return m_Table[name] as PersistableType;
|
||||
return m_Table[name];
|
||||
}
|
||||
|
||||
public static void Register(PersistableType type)
|
||||
|
|
@ -53,4 +54,4 @@ namespace Server.Engines.Reports
|
|||
|
||||
public ConstructCallback Constructor{ get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,12 +41,12 @@ namespace Server.Engines.Reports
|
|||
|
||||
public override int GetInt32(string key)
|
||||
{
|
||||
return XmlConvert.ToInt32(m_Xml.GetAttribute(key));
|
||||
return XmlConvert.ToInt32(m_Xml.GetAttribute(key) ?? "");
|
||||
}
|
||||
|
||||
public override bool GetBoolean(string key)
|
||||
{
|
||||
return XmlConvert.ToBoolean(m_Xml.GetAttribute(key));
|
||||
return XmlConvert.ToBoolean(m_Xml.GetAttribute(key) ?? "");
|
||||
}
|
||||
|
||||
public override string GetString(string key)
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
try
|
||||
{
|
||||
string renamed = null;
|
||||
string renamed;
|
||||
|
||||
if (File.Exists(m_RealFilePath))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -516,7 +516,7 @@ namespace Server.Engines.Reports
|
|||
for (int i = 0; i < VerticalTickCount; i++)
|
||||
{
|
||||
float currentY = _topBuffer + i * _yTickValue / _scaleFactor; // Position for tick mark
|
||||
float labelY = currentY - lblFont.Height / 2; // Place label in the middle of tick
|
||||
float labelY = currentY - lblFont.Height / 2.0f; // Place label in the middle of tick
|
||||
RectangleF lblRec = new RectangleF(_spacer + fo - 6, labelY, _maxTickValueWidth, lblFont.Height);
|
||||
|
||||
float currentTick = _maxValue - i * _yTickValue; // Calculate tick value from top to bottom
|
||||
|
|
|
|||
|
|
@ -3,16 +3,6 @@ using System.Drawing;
|
|||
|
||||
namespace Server.Engines.Reports
|
||||
{
|
||||
// Modified from MS sample
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// ChartItem Class
|
||||
//
|
||||
// This class represents a data point in a chart
|
||||
//
|
||||
//*********************************************************************
|
||||
|
||||
public class DataItem
|
||||
{
|
||||
private DataItem()
|
||||
|
|
@ -42,12 +32,6 @@ namespace Server.Engines.Reports
|
|||
public float SweepSize{ get; set; }
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// Custom Collection for ChartItems
|
||||
//
|
||||
//*********************************************************************
|
||||
|
||||
public class ChartItemsCollection : CollectionBase
|
||||
{
|
||||
public DataItem this[int index]
|
||||
|
|
|
|||
|
|
@ -116,10 +116,11 @@ namespace Server.Engines.Reports
|
|||
{
|
||||
Process p = Process.Start(psi);
|
||||
|
||||
p.WaitForExit();
|
||||
p?.WaitForExit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
Console.WriteLine("Reports: {0}: Upload complete", m_Title);
|
||||
|
|
@ -130,6 +131,7 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -192,8 +194,6 @@ namespace Server.Engines.Reports
|
|||
|
||||
html.RenderBeginTag(HtmlTag.Center);
|
||||
TimeZone tz = TimeZone.CurrentTimeZone;
|
||||
bool isDaylight = tz.IsDaylightSavingTime(m_TimeStamp);
|
||||
TimeSpan utcOffset = tz.GetUtcOffset(m_TimeStamp);
|
||||
|
||||
html.Write("Snapshot taken at {0:d} {0:t}. All times are {1}.", m_TimeStamp, tz.StandardName);
|
||||
html.RenderEndTag();
|
||||
|
|
@ -258,8 +258,6 @@ namespace Server.Engines.Reports
|
|||
html.Write("<br>");
|
||||
|
||||
TimeZone tz = TimeZone.CurrentTimeZone;
|
||||
bool isDaylight = tz.IsDaylightSavingTime(m_TimeStamp);
|
||||
TimeSpan utcOffset = tz.GetUtcOffset(m_TimeStamp);
|
||||
|
||||
html.Write("Snapshot taken at {0:d} {0:t}. All times are {1}.", m_TimeStamp, tz.StandardName);
|
||||
html.RenderEndTag();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ namespace Server.Engines.Reports
|
|||
private const int _bufferSpace = 125;
|
||||
private Color _backgroundColor;
|
||||
private Color _borderColor;
|
||||
private ArrayList _chartItems;
|
||||
private List<DataItem> _chartItems;
|
||||
private int _legendFontHeight;
|
||||
private float _legendFontSize;
|
||||
private string _legendFontStyle;
|
||||
|
|
@ -29,19 +29,13 @@ namespace Server.Engines.Reports
|
|||
private int _perimeter;
|
||||
private float _total;
|
||||
|
||||
public PieChartRenderer()
|
||||
public PieChartRenderer() : this(Color.White)
|
||||
{
|
||||
_chartItems = new ArrayList();
|
||||
_perimeter = 250;
|
||||
_backgroundColor = Color.White;
|
||||
_borderColor = Color.FromArgb(63, 63, 63);
|
||||
_legendFontSize = 8;
|
||||
_legendFontStyle = "Verdana";
|
||||
}
|
||||
|
||||
public PieChartRenderer(Color bgColor)
|
||||
{
|
||||
_chartItems = new ArrayList();
|
||||
_chartItems = new List<DataItem>();
|
||||
_perimeter = 250;
|
||||
_backgroundColor = bgColor;
|
||||
_borderColor = Color.FromArgb(63, 63, 63);
|
||||
|
|
@ -118,7 +112,7 @@ namespace Server.Engines.Reports
|
|||
//Draw all wedges and legends
|
||||
for (int i = 0; i < _chartItems.Count; i++)
|
||||
{
|
||||
DataItem item = (DataItem)_chartItems[i];
|
||||
DataItem item = _chartItems[i];
|
||||
SolidBrush brs = null;
|
||||
try
|
||||
{
|
||||
|
|
@ -188,7 +182,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
for (int i = 0; i < _chartItems.Count; i++)
|
||||
{
|
||||
DataItem item = (DataItem)_chartItems[i];
|
||||
DataItem item = _chartItems[i];
|
||||
try
|
||||
{
|
||||
grp.DrawPie(new Pen(_borderColor, 0.5f), pieRect, item.StartPos, item.SweepSize);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Server.Accounting;
|
||||
|
|
@ -132,24 +131,24 @@ namespace Server.Engines.Reports
|
|||
|
||||
Ladder ladder = Ladder.Instance;
|
||||
|
||||
if (ladder != null)
|
||||
if (ladder == null)
|
||||
return chart;
|
||||
|
||||
List<LadderEntry> entries = ladder.Entries;
|
||||
|
||||
for (int i = entries.Count - 1; i >= 0; --i)
|
||||
{
|
||||
ArrayList entries = ladder.ToArrayList();
|
||||
LadderEntry entry = entries[i];
|
||||
int level = Ladder.GetLevel(entry.Experience);
|
||||
|
||||
for (int i = entries.Count - 1; i >= 0; --i)
|
||||
if (lastItem == null || level != lastLevel)
|
||||
{
|
||||
LadderEntry entry = (LadderEntry)entries[i];
|
||||
int level = Ladder.GetLevel(entry.Experience);
|
||||
|
||||
if (lastItem == null || level != lastLevel)
|
||||
{
|
||||
chart.Items.Add(lastItem = new ChartItem(level.ToString(), 1));
|
||||
lastLevel = level;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastItem.Value++;
|
||||
}
|
||||
chart.Items.Add(lastItem = new ChartItem(level.ToString(), 1));
|
||||
lastLevel = level;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastItem.Value++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -171,11 +170,11 @@ namespace Server.Engines.Reports
|
|||
|
||||
if (ladder != null)
|
||||
{
|
||||
ArrayList entries = ladder.ToArrayList();
|
||||
List<LadderEntry> entries = ladder.Entries;
|
||||
|
||||
for (int i = 0; i < entries.Count && i < 15; ++i)
|
||||
{
|
||||
LadderEntry entry = (LadderEntry)entries[i];
|
||||
LadderEntry entry = entries[i];
|
||||
int level = Ladder.GetLevel(entry.Experience);
|
||||
string guild = "";
|
||||
|
||||
|
|
@ -204,40 +203,40 @@ namespace Server.Engines.Reports
|
|||
|
||||
Preferences prefs = Preferences.Instance;
|
||||
|
||||
if (prefs != null)
|
||||
if (prefs == null)
|
||||
return chart;
|
||||
|
||||
List<Arena> arenas = Arena.Arenas;
|
||||
|
||||
for (int i = 0; i < arenas.Count; ++i)
|
||||
{
|
||||
List<Arena> arenas = Arena.Arenas;
|
||||
Arena arena = arenas[i];
|
||||
|
||||
for (int i = 0; i < arenas.Count; ++i)
|
||||
string name = arena.Name;
|
||||
|
||||
if (name != null)
|
||||
chart.Items.Add(name, 0);
|
||||
}
|
||||
|
||||
List<PreferencesEntry> entries = prefs.Entries;
|
||||
|
||||
for (int i = 0; i < entries.Count; ++i)
|
||||
{
|
||||
PreferencesEntry entry = entries[i];
|
||||
List<string> list = entry.Disliked;
|
||||
|
||||
for (int j = 0; j < list.Count; ++j)
|
||||
{
|
||||
Arena arena = arenas[i];
|
||||
string disliked = list[j];
|
||||
|
||||
string name = arena.Name;
|
||||
|
||||
if (name != null)
|
||||
chart.Items.Add(name, 0);
|
||||
}
|
||||
|
||||
ArrayList entries = prefs.Entries;
|
||||
|
||||
for (int i = 0; i < entries.Count; ++i)
|
||||
{
|
||||
PreferencesEntry entry = (PreferencesEntry)entries[i];
|
||||
ArrayList list = entry.Disliked;
|
||||
|
||||
for (int j = 0; j < list.Count; ++j)
|
||||
for (int k = 0; k < chart.Items.Count; ++k)
|
||||
{
|
||||
string disliked = (string)list[j];
|
||||
ChartItem item = chart.Items[k];
|
||||
|
||||
for (int k = 0; k < chart.Items.Count; ++k)
|
||||
if (item.Name == disliked)
|
||||
{
|
||||
ChartItem item = chart.Items[k];
|
||||
|
||||
if (item.Name == disliked)
|
||||
{
|
||||
++item.Value;
|
||||
break;
|
||||
}
|
||||
++item.Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -364,7 +363,7 @@ namespace Server.Engines.Reports
|
|||
report.Columns.Add("28%", "center", "Office");
|
||||
report.Columns.Add("16%", "center", "Kill Points");
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
List<PlayerState> list = new List<PlayerState>();
|
||||
|
||||
List<Faction> factions = Faction.Factions;
|
||||
|
||||
|
|
@ -380,7 +379,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
for (int i = 0; i < list.Count && i < 15; ++i)
|
||||
{
|
||||
PlayerState pl = (PlayerState)list[i];
|
||||
PlayerState pl = list[i];
|
||||
|
||||
string office;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue