changeset 179:c1caf467dd40

Re #193: Unhandled exception in dictionary? * Make defaultStats attribute required by schema Also: * Remove some references to log notifier
author IBBoard <dev@ibboard.co.uk>
date Sat, 24 Oct 2009 15:00:36 +0000
parents ca2cd24f6872
children 55dc7c97fcfe
files api/Factories/Xml/WarFoundryXmlFactoryUtils.cs api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs dtds/system.xsd
diffstat 3 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlFactoryUtils.cs	Sat Oct 24 14:01:50 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlFactoryUtils.cs	Sat Oct 24 15:00:36 2009 +0000
@@ -6,7 +6,6 @@
 using System.IO;
 using System.Xml;
 using System.Xml.Schema;
-using IBBoard.Logging;
 using IBBoard.WarFoundry.API.Objects;
 
 namespace IBBoard.WarFoundry.API.Factories.Xml
@@ -92,15 +91,15 @@
 			}
 			catch (IOException ex)
 			{
-				LogNotifier.Warn(typeof(WarFoundryXmlFactoryUtils), "Problem reading schema: " + ex.Message, ex);
+				//TODO: Warn on schema failure
 			}
 			catch (XmlSchemaException ex)
 			{
-				LogNotifier.Warn(typeof(WarFoundryXmlFactoryUtils), "Problem validating schema for WarFoundry data: " + ex.Message, ex);
+				//TODO: Warn on schema failure
 			}
 			catch (XmlException ex)
 			{
-				LogNotifier.Warn(typeof(WarFoundryXmlFactoryUtils), "Problem reading data for schema: " + ex.Message, ex);
+				//TODO: Warn on schema failure
 			}
 		}
 		
@@ -128,12 +127,10 @@
 			
 			if (obj.IsFullyLoaded)
 			{
-				LogNotifier.DebugFormat(typeof(WarFoundryXmlFactoryUtils), "Object of type {0} with ID {1} is already fully loaded", obj.GetType().Name, obj.ID);
 				canLoad = false;
 			}
 			else if (obj.IsLoading)
 			{
-				LogNotifier.WarnFormat(typeof(WarFoundryXmlFactoryUtils), "Object of type {0} with ID {1} is already being loaded", obj.GetType().Name, obj.ID);
 				canLoad = false;
 			}
 			
--- a/api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs	Sat Oct 24 14:01:50 2009 +0000
+++ b/api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs	Sat Oct 24 15:00:36 2009 +0000
@@ -4,9 +4,9 @@
 
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Xml;
 using ICSharpCode.SharpZipLib.Zip;
-using IBBoard.Logging;
 using IBBoard.Xml;
 using IBBoard.WarFoundry.API.Objects;
 
@@ -61,10 +61,9 @@
 			XmlElement systemElement = WarFoundryXmlFactoryUtils.SelectSingleElement(extraData, "/system:system");
 			system.WarnOnError = XmlTools.GetBoolValueFromAttribute(systemElement, "warn");
 			system.AllowAllies = XmlTools.GetBoolValueFromAttribute(systemElement, "allowAllies");
-			LogNotifier.DebugFormat(GetType(), "Completed loading of GameSystem with ID {0}", system.ID);
-			LogNotifier.DebugFormat(GetType(), "GameSystem with ID {0} default stats: {1}", system.ID, system.StandardSystemStatsID);
 			system.SetAsFullyLoaded();
 		}
+
 		
 		private void LoadCategoriesForSystem(GameSystem system, XmlNode elem)
 		{
--- a/dtds/system.xsd	Sat Oct 24 14:01:50 2009 +0000
+++ b/dtds/system.xsd	Sat Oct 24 15:00:36 2009 +0000
@@ -23,7 +23,7 @@
 							</xs:complexType>
 						</xs:element>
 					</xs:sequence>
-					<xs:attribute name="defaultStats" type="xs:IDREF" />
+					<xs:attribute name="defaultStats" type="xs:IDREF" use="required" />
 					<xs:anyAttribute/>
 				</xs:complexType>
 			</xs:element>