Skip to content
Permalink
Browse files

Added warning for users with Desktop Experience shut off - Kelly

Disabled matchmaking tab for now - Kelly
  • Loading branch information...
kellyelton committed Apr 25, 2014
1 parent f2f22a7 commit 91297b4d5d0725712ee268ab2294884ae86d4954
@@ -2,12 +2,13 @@
<ArrayOfArrayOfArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ArrayOfArrayOfString>
<ArrayOfString>
<string>C:\Users\kellye\Programming\octgn\octgnFX\Octide\Views\MainWindow.xaml.cs</string>
<string>Find Results</string>
</ArrayOfString>
</ArrayOfArrayOfString>
<ArrayOfArrayOfString>
<ArrayOfString>
<string>C:\Users\kellye\Programming\octgn\octgnFX\Octide\GameLoader.cs</string>
<string>C:\Users\kellye\Programming\octgn\octgnFX\Octgn.Library\Schemas\Game.xsd</string>
<string>C:\Users\kellye\Programming\octgn\octgnFX\Octgn.Library\Schemas\Game.xsd</string>
</ArrayOfString>
</ArrayOfArrayOfString>
</ArrayOfArrayOfArrayOfString>
@@ -48,6 +48,7 @@ public static Config Instance

internal Config()
{
Log.Debug("Constructing");
this.cacheLocker = new ReaderWriterLockSlim();
this.locker = new ReaderWriterLockSlim();
cache = new MemoryCache("ConfigCache");
@@ -58,6 +59,7 @@ internal Config()

if (!Directory.Exists(p))
{
Log.Debug("Creating Config Directory");
Directory.CreateDirectory(p);
}
}
@@ -97,7 +99,7 @@ public string ConfigPath

public T ReadValue<T>(string valName, T def)
{
T val;
T val = def;
try
{
locker.EnterUpgradeableReadLock();
@@ -125,25 +127,33 @@ public T ReadValue<T>(string valName, T def)
AddToCache(valName, val);

}
catch (Exception e)
{
Log.Error("ReadValue",e);
}
finally
{
locker.ExitWriteLock();
locker.ExitWriteLock();
}
}

}
catch (Exception e)
{
Log.Error("ReadValue", e);
}
finally
{
locker.ExitUpgradeableReadLock();
}
locker.ExitUpgradeableReadLock();
}
return val;
}

public void WriteValue<T>(string valName, T value)
{
try
{
locker.EnterWriteLock();
locker.EnterWriteLock();
using (var cf = new ConfigFile())
{
cf.AddOrSet(valName, value);
@@ -164,13 +174,13 @@ internal bool GetFromCache<T>(string name, out T val)
{
try
{
this.cacheLocker.EnterReadLock();
this.cacheLocker.EnterReadLock();
if (cache.Contains(name))
{
if (cache[name] is NullObject)
val = default(T);
else
val = (T)cache[name];
else
val = (T)cache[name];
return true;
}
val = default(T);
@@ -186,16 +196,16 @@ internal void AddToCache<T>(string name, T val)
{
try
{
this.cacheLocker.EnterWriteLock();
this.cacheLocker.EnterWriteLock();
Object addObj;
if (typeof(T).IsValueType == false && val == null)
addObj = new NullObject();
if (typeof(T).IsValueType == false && val == null)
addObj = new NullObject();
else
addObj = val;
if(cache.Contains(name))
addObj = val;
if (cache.Contains(name))
cache.Set(name, addObj, DateTime.Now.AddMinutes(1));
else
cache.Add(name, addObj, DateTime.Now.AddMinutes(1));
else
cache.Add(name, addObj, DateTime.Now.AddMinutes(1));
}
finally
{
@@ -207,8 +217,8 @@ internal void SetToCache<T>(string name, T val)
{
try
{
this.cacheLocker.EnterWriteLock();
cache.Set(name,val,DateTime.Now.AddMinutes(1));
this.cacheLocker.EnterWriteLock();
cache.Set(name, val, DateTime.Now.AddMinutes(1));
}
finally
{
@@ -221,6 +231,6 @@ internal void SetToCache<T>(string name, T val)

internal class NullObject
{

}
}
@@ -46,15 +46,15 @@ public ConfigFile()
}
catch (Exception e)
{
Log.Warn("Error reading config file",e);
Log.Warn("Error reading config file", e);
ConfigData = new Hashtable();
}
}

public bool Contains(string key)
{
if(!OpenedFile)
return false;
if (!OpenedFile)
return false;

return ConfigData.ContainsKey(key);
}
@@ -65,12 +65,12 @@ public void Add<T>(string key, T val)

if (typeof(T).IsEnum)
{
ConfigData.Add(key,val.ToString());
ConfigData.Add(key, val.ToString());
}
else if (typeof(T).IsIntegerType(true))
else if (typeof(T).IsIntegerType(true))
ConfigData.Add(key, val.ToString());
else
ConfigData.Add(key,val);
else
ConfigData.Add(key, val);
}

public void AddOrSet<T>(string key, T val)
@@ -94,21 +94,21 @@ public bool Get<T>(string key, out T val)

if (typeof(T).IsEnum)
{
val = (T)Enum.Parse(typeof(T),ConfigData[key].ToString());
val = (T)Enum.Parse(typeof(T), ConfigData[key].ToString());
}
else if (typeof(T).IsIntegerType(true))
val = (T)((object)int.Parse(ConfigData[key].ToString()));
else if (typeof(T) == typeof(Hashtable))
{
var jo = (JObject)ConfigData[key];
var ret = jo.ToObject<Hashtable>();
val = (T)((object)ret);
}
else if (typeof(T) == typeof(ulong))
{
dynamic jo = (ulong)(long)ConfigData[key];
val = (T)jo;
}
else if (typeof(T) == typeof(Hashtable))
{
var jo = (JObject)ConfigData[key];
var ret = jo.ToObject<Hashtable>();
val = (T)((object)ret);
}
else if (typeof(T) == typeof(ulong))
{
dynamic jo = (ulong)(long)ConfigData[key];
val = (T)jo;
}
else
val = (T)ConfigData[key];

@@ -121,12 +121,12 @@ public void Save()

try
{
FileStream.SetLength(0);
var configString = JsonConvert.SerializeObject(ConfigData,Formatting.Indented);
FileStream.SetLength(0);
var configString = JsonConvert.SerializeObject(ConfigData, Formatting.Indented);

var sw = new StreamWriter(FileStream);
sw.Write(configString);
sw.Flush();
sw.Write(configString);
sw.Flush();
}
catch (Exception e)
{
@@ -96,6 +96,7 @@
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Polenter.SharpSerializer, Version=2.18.0.0, Culture=neutral, PublicKeyToken=8f4f20011571ee5f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -32,6 +32,12 @@ public partial class OctgnApp

protected override void OnStartup(StartupEventArgs e)
{
// Need this to load Octgn.Core for the logger
Debug.WriteLine(bi);
GlobalContext.Properties["version"] = Const.OctgnVersion;
GlobalContext.Properties["os"] = Environment.OSVersion.ToString();
AppDomain.CurrentDomain.AssemblyLoad += CurrentDomainOnAssemblyLoad;

int i = 0;
foreach (var a in e.Args)
{
@@ -146,11 +152,6 @@ protected override void OnStartup(StartupEventArgs e)
}
};

// Need this to load Octgn.Core for the logger
Debug.WriteLine(bi);
GlobalContext.Properties["version"] = Const.OctgnVersion;
GlobalContext.Properties["os"] = Environment.OSVersion.ToString();
AppDomain.CurrentDomain.AssemblyLoad += CurrentDomainOnAssemblyLoad;

if (X.Instance.Debug)
{
@@ -239,6 +239,7 @@
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NuGet.Core, Version=2.7.41101.299, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -273,6 +274,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\System.IO.Abstractions.1.4.0.69\lib\net35\System.IO.Abstractions.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Numerics" />
<Reference Include="System.Printing" />
<Reference Include="System.Web" />

0 comments on commit 91297b4

Please sign in to comment.
You can’t perform that action at this time.